How to list all the properties of a group ?
ratus69_c6741fefbf
Posts: 34
hello,
I'm looking to list all the properties of a group name "ZBrush" but I can't figure out how to do
I can get the list of all pathes using :
const oNODE = Scene.getPrimarySelection();
if( oNODE ){
const aGROUPS = oNODE.getPropertyGroups();
const paths = aGROUPS.getAllPaths();
var oProperty;
for( var i = 0; i < paths.length; i++ ){
oProperty = paths[ i ];
print( oProperty );
}
}
But what method can list all the properties (morphs) of a group ?
Thanks
Post edited by ratus69_c6741fefbf on
Comments
You need to get the actual PropertyGroups, using getDefaultgroup and getFirstChild, thenthen once you have that you can use getNextSibling on that to go through the top level groups, and recurse on get FirstChild on each group to go through their children. In each group use oGroup.getNumProperties() and then use a loop to get the properties with oGroup.getProperty( n ).
thanks Richard
I have found a usefull script from Rob "Getting the properties associated with a node" here http://docs.daz3d.com/doku.php/artzone/wiki/user/rbtwhiz/technotes/daz_script/node_properties/start
It lists all the Dzmorph in a recursive way that is useful
but I can't achieve using getDefaultgroup with oNODE (const oNODE = Scene.getPrimarySelection();)
when I try oNODE.getDefaultgroup () I get a oNODE.getDefaultgroup[Undefined] is not a function
You get the PropertyTree for the node, then the groups from that.
ok I finally found out how to get a list of all the morphs present in a specific group, I just change the end of Rob's script to do so :
and here I get the name of the group with oGroup = oProperty.getGroup()
and I set the channel value to a minimum of 0 for all the morphs with oOwner.getValueChannel().setMin( 0 )
thanks for your help Richard
ah, just to refine my script, is there a way to know which group is curently selected in the viewport ?
I'm not sure - it would probably be a pane method if so (use paneMgr to find the Parameters pane and then go through gettings its proeprties - there is at least one thread discussing that in this forum).
thanks Richard, I've found a script from Rob where I can get the selected morph
here : http://www.daz3d.com/forums/discussion/37769/how-do-you-set-the-property-value-slider-in-the-parameters-tab
I had forgotten that discussion.