ok so i have made some changes, not exactly as you have suggested cause i
wanted to support layout and logic too, but i can't even get a single
parameter to be copied up.


so i added a new attribute to the component guide class, and i am
collecting the gear_PSets added. moving forward if the custom property has
'gear_' in front then its to be copied...

>gear\xsi\rig\component\guide.py

self.tra[name] = obj.Kinematics.Global.Transform
self.atra.append(obj.Kinematics.Global.Transform)
self.pos[name] = obj.Kinematics.Global.Transform.Translation
self.apos.append(obj.Kinematics.Global.Transform.Translation)
gearProps = obj.Properties.Filter(c.siCustomParamSet, c.siPropertyFamily,
"gear_*")
self.cpsets.extend(list(gearProps))

then in main component class, i added three new methods

def step_01(self):
    self.getHost()
    self.addParameters()
    self.addLayout()
    self.addLogic()
    self.addCustomParameters()
    self.addCustomLayout()
    self.addCustomLogic()
    self.setUI()
    return

lets ignore layout and logic at this time and look at adding simple new
parameters...

def addCustomParameters(self):

    for cpset in self.guide.cpsets:
        for param in cpset.Parameters:
            # skip string type ie. layout and logic params, also skip debug
flag
            if param.ValueType == c.siString or param.Name == "debug":
                continue
            self.addAnimParam(param.ScriptName, param.ValueType,\
                param.Value, param.Min, param.Max, param.SuggestedMin,\
                param.SuggestedMax)

i chose to use addAnimParam thinking it would fall in line better with the
GEAR system. also so i can have the setUI() take care of the gui. i tried
adding the parameters after the setUI() and used AddParameter2() softimage
method directly on the anim_prop but it seems to get overwritten. the build
doesn't fail, all my code is being executed (some debug log messages
helping me here) and the final result doesn't have my parameters. it looks
like it is getting overwritten or discarded in some later process/step.

ideas?


On Tue, Apr 23, 2013 at 4:54 PM, Steven Caron <car...@gmail.com> wrote:

> thanks for the tips jeremie, i am going to try this.
>
>

Reply via email to