Digital Art Zone

 
     
Change subdivision and Resolution level
Posted: 22 August 2012 03:22 PM   [ Ignore ]   [ # 7 ]
Addict
Avatar
RankRankRankRank
Total Posts:  8351
Joined  2009-05-14

Sorry I am unsure what you mean so I will start at the begining. smile


If a figure as in the case of Genesis is subdivided then the resolution details can be found under the Parameters Pane when the figure/prop is selected.


Let us know if this is not what you are asking for or have futher questions about this.

 Signature 

Pete

Somethings to Consider when starting to learn CG

My Gallery

My Render Thread and Tutorials

Proud member of the Bald Wizards Club and Co-operative

Facebook

Profile
 
 
Posted: 22 August 2012 03:27 PM   [ Ignore ]   [ # 8 ]
New Member
Avatar
Total Posts:  8
Joined  2003-10-09

Hi smile
I could have been more precise. I mean how to get these two properties using scripting smile

Forgot that it is not a scripting forum, but the dev forum smile

Profile
 
 
Posted: 22 August 2012 04:36 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  15792
Joined  2003-10-09

I’m not sure, but looking at the DS3 scripting docs try (with errror checking added)

oShape = oNode.getObject().getCurrentShape();

which should be some derivative of DzSubDBase, but then I run into a brick wall as the scripting docs are talking about settings from the older implementation when there was a render level setting - but you could check the members of whatever type of object you get for possibilities.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 26 August 2012 12:53 AM   [ Ignore ]   [ # 10 ]
New Member
Avatar
Total Posts:  8
Joined  2003-10-09
Richard Haseltine - 22 August 2012 04:36 PM

but you could check the members of whatever type of object you get for possibilities.

How ? Is it possible to check this directly in the Scripting IDE ?

Profile
 
 
Posted: 26 August 2012 02:05 AM   [ Ignore ]   [ # 11 ]
New Member
Avatar
Total Posts:  8
Joined  2003-10-09

Another question - is it possible to get and set the values from the ‘Property’ object ? Here is a code (taken from Node Property.dsa in the samples and a little bit edited).

This script will identify and display the Subdivision and Resolution level property. But I can’t find a way to get it’s value or set it’s value!?!!

/*********************************************************************/
// Array<DzProperty> :
function getGroupPropertiesoGroupbTraversebRecurse )
{
 
// Declare an array to hold properties
 
var aProperties [];
 
 
// If a group isn't passed in
 
if( !oGroup ){
  
// We're done, return an empty array
  
return aProperties;
 
// If a group is passed in
 
else {
  
// Get the number of proeprties in the group
  
var nProperties oGroup.getNumProperties();
  
// Pre-size the properties array
  
aProperties = new Array( nProperties );
  
// Iterate over the properties, setting each element in the array
  
for( var 0nProperties+= ){
   aProperties[ i ] 
oGroup.getProperty);
  
}
  
  
// If we are recursing
  
if( bRecurse ){
   
// Concatenate the properties array from child groups
   
aProperties aProperties.concatgetGroupPropertiesoGroup.getFirstChild(), bTraversebRecurse ) );
  
}
  
  
// If we are traversing
  
if( bTraverse ){
   
// Concatenate the properties array from sibling groups
   
aProperties aProperties.concatgetGroupPropertiesoGroup.getNextSibling(), bTraversebRecurse ) );
  
}
 }
 
 
// Return the array of properties
 
return aProperties;
}

/*********************************************************************/
// Array<DzProperty> :
function getNodePropertiesoNodebTraversebRecurse )
{
 
// Get the property group tree for the node
 
var oPropertyGroupTree oNode.getPropertyGroups();
 
// Get the first group in the tree
 
var oPropertyGroup oPropertyGroupTree.getFirstChild();
 
// Get the properties for the node
 
return getGroupPropertiesoPropertyGroupbTraversebRecurse );
}

/*********************************************************************/
// Get the primary selection
var oNode Scene.getPrimarySelection();
// If something is selected
if( oNode ){
 
// Get the properties available to the user by way of the selected node
 
var aProperties getNodePropertiesoNodetruetrue );
 
// Declare variables we'll be using as we iterate
 
var oPropertyoOwneroPresentation;
 
// Iterate over all properties
 
for( var 0aProperties.length+= ){
  
// Get the "current" property
  
oProperty aProperties[ i ];
  
// Get the owner of the property
  
oOwner oProperty.getOwner();
  
  
// Get the property's presentation
  
oPresentation oProperty.getPresentation();
  
// If the property doesn't have a presentation, skip it
  
if (oProperty.getLabel()=="SubDivision Level"){
   
print(oProperty.getLabel());
   print(
oProperty.getName());
  
else if(oProperty.getLabel()=="Resolution Level"){
   
print(oProperty.getLabel());
   print(
oProperty.getName());
  
}
 }
Profile
 
 
Posted: 26 August 2012 05:38 AM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  15792
Joined  2003-10-09

Find out what type of property it is with className(), but you will probably want getValueChannel.

As for getting the members of an object, the trick Rob showed was to use:

var itemToCheck DzNode() ;

for ( var 
member in itemToCheck {
 
print ( member );
 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 01 September 2012 05:29 AM   [ Ignore ]   [ # 13 ]
Member
Rank
Total Posts:  62
Joined  2004-12-26
semidieu - 26 August 2012 02:05 AM

Another question - is it possible to get and set the values from the ‘Property’ object ? Here is a code (taken from Node Property.dsa in the samples and a little bit edited).

This script will identify and display the Subdivision and Resolution level property. But I can’t find a way to get it’s value or set it’s value!?!!

/*********************************************************************/
// Array<DzProperty> :
function getGroupPropertiesoGroupbTraversebRecurse )
{
 
// Declare an array to hold properties
 
var aProperties [];
 
 
// If a group isn't passed in
 
if( !oGroup ){
  
// We're done, return an empty array
  
return aProperties;
 
// If a group is passed in
 
else {
  
// Get the number of proeprties in the group
  
var nProperties oGroup.getNumProperties();
  
// Pre-size the properties array
  
aProperties = new Array( nProperties );
  
// Iterate over the properties, setting each element in the array
  
for( var 0nProperties+= ){
   aProperties[ i ] 
oGroup.getProperty);
  
}
  
  
// If we are recursing
  
if( bRecurse ){
   
// Concatenate the properties array from child groups
   
aProperties aProperties.concatgetGroupPropertiesoGroup.getFirstChild(), bTraversebRecurse ) );
  
}
  
  
// If we are traversing
  
if( bTraverse ){
   
// Concatenate the properties array from sibling groups
   
aProperties aProperties.concatgetGroupPropertiesoGroup.getNextSibling(), bTraversebRecurse ) );
  
}
 }
 
 
// Return the array of properties
 
return aProperties;
}

/*********************************************************************/
// Array<DzProperty> :
function getNodePropertiesoNodebTraversebRecurse )
{
 
// Get the property group tree for the node
 
var oPropertyGroupTree oNode.getPropertyGroups();
 
// Get the first group in the tree
 
var oPropertyGroup oPropertyGroupTree.getFirstChild();
 
// Get the properties for the node
 
return getGroupPropertiesoPropertyGroupbTraversebRecurse );
}

/*********************************************************************/
// Get the primary selection
var oNode Scene.getPrimarySelection();
// If something is selected
if( oNode ){
 
// Get the properties available to the user by way of the selected node
 
var aProperties getNodePropertiesoNodetruetrue );
 
// Declare variables we'll be using as we iterate
 
var oPropertyoOwneroPresentation;
 
// Iterate over all properties
 
for( var 0aProperties.length+= ){
  
// Get the "current" property
  
oProperty aProperties[ i ];
  
// Get the owner of the property
  
oOwner oProperty.getOwner();
  
  
// Get the property's presentation
  
oPresentation oProperty.getPresentation();
  
// If the property doesn't have a presentation, skip it
  
if (oProperty.getLabel()=="SubDivision Level"){
   
print(oProperty.getLabel());
   print(
oProperty.getName());
  
else if(oProperty.getLabel()=="Resolution Level"){
   
print(oProperty.getLabel());
   print(
oProperty.getName());
  
}
 }

Int properties and Enum properties, which what the properties you are looking for are, have setValue, getValue functions.

Profile