Hi, I’m trying to work out the code Id need to run to build a component without using the shifter ui.
I’ve been working on getting Spine IK 01 module to run via the maya script editor.
Id like be able to build a guide with code, have a user adjust the guides, and run code to do the actual build.
I’ve been trying different import statements all morning
from mgear.shifter_classic_components import spine_ik_01
from spine_ik_01 import guide
#Build the guide
spine_guide_object = guide.Guide()
spine_guide_object.parent = "??" # im not sure what this parent is supposed to be
spine_guide_object.postInit()
spine_guide_object.addParameters()
spine_guide_object.addObjects() #this builds the guide? I get the following error -
# Error: 'str' object has no attribute 'addChild'
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# File "C:/Users/Admin/Documents/maya/modules/scripts/mgear/shifter_classic_components\spine_ik_01\guide.py", line 51, in addObjects
# self.root = self.addRoot()
# File "C:\Users\Admin\Documents\maya\modules\scripts\mgear\shifter\component\guide.py", line 580, in addRoot
# "root"), color=13, m=self.tra["root"])
# File "C:\Users\Admin\Documents\maya\modules\scripts\mgear\core\icon.py", line 1062, in guideRootIcon
# rootIco = null(parent, name, width, color, m, pos_offset, rot_offset)
# File "C:\Users\Admin\Documents\maya\modules\scripts\mgear\core\icon.py", line 937, in null
# node = curve.addCurve(parent, name, points, False, 1, m)
# File "C:\Users\Admin\Documents\maya\modules\scripts\mgear\core\curve.py", line 88, in addCurve
# parent.addChild(node)
# AttributeError: 'str' object has no attribute 'addChild'
#Build the component based on the modified guide - havent made much progress here
from mgear.shifter import component ##?
spine_component_object = spine_ik_01.Component(??) #Im getting the following beacuse im not sure what to pass here
# TypeError: __init__() takes exactly 3 arguments (2 given) #
Anyone have experience doing something like this?
(Edited to fix code formatting)