Setting parameter value by name

I'm aiming to migrate my scripts from PoserPython to DAZ Studio but so far I am completely stuck with how to set a parameter value by name. Could someone tell me if it is possible to script something like this?

poser.Scene().Figure("SimonG2").Actor("Head").SetParameter("NoseHeight",0.5 )

I managed to do it by modifying one of the samples that went through all the nodes until I found the one I wanted, but that doesn't seem so elegant.

Thanks,
Michael

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,842
    edited December 1969

    How about something like:

    var oObj = actor.getObject();
    if ( oObj ) {
    var oMod = oObj.findModifier( “NoseHeight” );
    if ( oMod ) {
    if ( oMod.inherits( "DzMorph" ) {
    oMod.getValueChannel().setValue( 0.5 );
    }
    }
    }

Sign In or Register to comment.