Congratulations! You are a March Madness BONUS BUYER!

Enjoy 10% OFF* ALL PURCHASES STOREWIDE or enjoy 30% OFF items with a SKU number lower than 16000 & 30% OFF items from Runtime DNA.

Take an EXTRA 20% OFF of today's related items

Offer valid for intended recipient only
* 10% discount DOES apply to Gift Cards and Memberships. **Items must be in cart simultaneously for discount to apply.
[ collapse ]

Setting parameter value by name

Michael BeeMichael Bee Posts: 0

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: 32,553
    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.