Digital Art Zone

 
     
Setting parameter value by name
Posted: 13 December 2012 10:03 PM   [ Ignore ]
New Member
Total Posts:  1
Joined  2004-11-10

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

Profile
 
 
Posted: 14 December 2012 06:42 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  14697
Joined  2003-10-09

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 );
}
}
}

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile