Injecting new FBMs / morph channels : Calculation Order - How to?



  • Hello

    this is a rather specialized question, but an interesting one.

    I have a figure and want to inject a new morph into it.
    Neither the valueParm in the BODY nor the targetGeom in the body parts are predefined.

    So I write an injection file which first creates the valueParms in the BODY, and then the targetGeoms in the body parts.

    It looks like this:

    {
    	version
    	{
    		number 10
    	}
    	runPythonScript "Inject BODY FBMs XP.py"
    	actor BODY:1
    	{
    		channels
    		{
    			#//specified data of the channels to follow//
    		}
    	}
    	actor hip:1
    	{
    		channels
    		{
    			#//specified data of the channels to follow//
    		}
    	}
    	{
    	figure
    	}
    }
    

    The Python script which creates the valueParms in the BODY looks like this:

    import poser
    scene = poser.Scene()
    figura = scene.CurrentFigure()
    bodyActor = figura.ActorByInternalName("BODY") # FBM valueParm dial in BODY
    subActor = figura.ActorByInternalName("chest") # more valueParms in body parts
    channelName = "SBM EXPERIMENTAL MORPH"
    
    
    def main():
    
        if not figura:
            poser.DialogSimple.MessageBox("No figure selected...")
            return
    
        try:
            itExists = bodyActor.ValueParameter(channelName)
            if itExists:
                poser.DialogSimple.MessageBox("Looks like the channel \n -"+channelName+"- \n already exists!")
        except:
            try: # to create the channels
                dummy = bodyActor.CreateValueParameter(channelName)
                dummy = subActor.CreateValueParameter(channelName)
                return
            except: # just sod off...
                poser.DialogSimple.MessageBox("Unknown Error \n -SORRY-")
    
    
    def doNothing():
        _void = 0
    
    
    main()
    

    (I know that I can create the FBM dials in the BODY with the "createFBM" line in a pz2 file too, but I prefer the Python way because it also lets me delete obsolete valueParms.)

    NOW, the big question is:

    Whichever method I use, Poser always adds the new morph channels on top of the parameters list in the cr2 file.

    This is most annoying because for a correct calculation order of the morphs I need them inserted in a specific place of the morph list, or at least at the bottom of it.

    Not on top!

    Example:

    {
    	channels
    	{
    		groups
    			{etc...}
    	}
          	valueParm _New_Channel # instead of here
          	valueParm ExistingChannel_1
          	valueParm ExistingChannel_2
          	valueParm ExistingChannel_3
          	valueParm ExistingChannel_4
          	valueParm _New_Channel # I need it here!
          	valueParm ExistingChannel_5
          	valueParm ExistingChannel_6
          	valueParm _New_Channel # ...or at least here...
          	zOffsetA zOffset
          		{etc...}
    }
    

    Any ideas?

    Peter


  • Poser Ambassadors

    From the arrow on the right in the properties panel (next to properties) select Display in Calculation order.
    Then when you see the list you can drag the morphs up and down - changing the calculation order.


  • Poser Ambassadors

    I reread the entire post.
    Sorry, i do not know how to do it in Python



  • Dank U wel Wim,
    of course you're perfectly right.

    But that's not the real problem.

    My aim is to make it with the injection already, in order to spare the (dumm I mean: "not-so-experienced") user this procedure (which about 95% of them probably would be challenged with it anyway).

    It's the KISS *1 approach I'm aimimg at.

    Peter

    Footnote 1:
    KISS = "Keep It Simple Stupid"


Log in to reply
 

Looks like your connection to Graphics Forum was lost, please wait while we try to reconnect.