Oops sorry! I assumed my link to the video was sufficient.
So here’s the original, just copied from Miquel’s tutorial.
import os
import mgear.shifter.custom_step as cstp
import pymel.core as pm
class CustomShifterStep(cstp.customShifterMainStep):
def setup(self):
"""
Setting the name property makes the custom step accessible
in later steps.
i.e: Running self.custom_step("import_bodygeo") from steps ran after
this one, will grant this step.
"""
self.name = "import_bodygeo"
def run(self):
"""Run method.
i.e: self.mgear_run.global_ctl
gets the global_ctl from shifter rig build base
i.e: self.component("control_C0").ctl
gets the ctl from shifter component called control_C0
i.e: self.custom_step("otherCustomStepName").ctlMesh
gets the ctlMesh from a previous custom step called
"otherCustomStepName"
Returns:
None: None
"""
self.import_geometry()
pm.select("guide")
def import_geometry(self):
path = "\\".join(os.path.abspath(
os.path.dirname(__file__)).split("\\")[:-2])
pm.importFile("C:\Users\.........\build\assets\bodygeo.ma")
In reference to the backslashes/raw string, here’s both of those.
import os
import mgear.shifter.custom_step as cstp
import pymel.core as pm
class CustomShifterStep(cstp.customShifterMainStep):
def setup(self):
"""
Setting the name property makes the custom step accessible
in later steps.
i.e: Running self.custom_step("import_bodygeo") from steps ran after
this one, will grant this step.
"""
self.name = "import_bodygeo"
def run(self):
"""Run method.
i.e: self.mgear_run.global_ctl
gets the global_ctl from shifter rig build base
i.e: self.component("control_C0").ctl
gets the ctl from shifter component called control_C0
i.e: self.custom_step("otherCustomStepName").ctlMesh
gets the ctlMesh from a previous custom step called
"otherCustomStepName"
Returns:
None: None
"""
self.import_geometry()
pm.select("guide")
def import_geometry(self):
path = "\\".join(os.path.abspath(
os.path.dirname(__file__)).split("\\")[:-2])
pm.importFile("C:\\Users\\.........\\build\\assets\\bodygeo.ma")
or
import os
import mgear.shifter.custom_step as cstp
import pymel.core as pm
class CustomShifterStep(cstp.customShifterMainStep):
def setup(self):
"""
Setting the name property makes the custom step accessible
in later steps.
i.e: Running self.custom_step("import_bodygeo") from steps ran after
this one, will grant this step.
"""
self.name = "import_bodygeo"
def run(self):
"""Run method.
i.e: self.mgear_run.global_ctl
gets the global_ctl from shifter rig build base
i.e: self.component("control_C0").ctl
gets the ctl from shifter component called control_C0
i.e: self.custom_step("otherCustomStepName").ctlMesh
gets the ctlMesh from a previous custom step called
"otherCustomStepName"
Returns:
None: None
"""
self.import_geometry()
pm.select("guide")
def import_geometry(self):
path = "\\".join(os.path.abspath(
os.path.dirname(__file__)).split("\\")[:-2])
pm.importFile(r"C:\\Users\\.........\\build\\assets\\bodygeo.ma")
I hope this is sufficient information, I’m a bit embarrassed aha. The learning curve is steep ya’ll!