Interface: nodeSelectionSet

Interfaces > Core Interfaces > nodeSelectionSet

 

   

Core Interfaces - Quick Navigation

NEW in 3ds Max 2015: The nodeSelectionSet Core Interface provides methods for querying the current node selection to determine the state of the display and render UI controls.

   

Methods:

<boolean>nodeSelectionSet.getDisplayPropState <enum>propID <enum>condition 

    propID enums: {#DisplayProp_Transparent | #DisplayProp_Bone | #DisplayProp_FrozenWithMaterial | 
        #DisplayProp_Hidden | #DisplayProp_Frozen | #DisplayProp_Box | #DisplayProp_BackfaceCull | 
        #DisplayProp_AllEdges | #DisplayProp_BoneOnly | #DisplayProp_BoneAsLine | #DisplayProp_ShowTrajectory | 
        #DisplayProp_VertexTicks | #DisplayProp_IgnoreExtents | #DisplayProp_XRay} 

    condition enums: {#Cond_AnyChecked | #Cond_AnyUnchecked | #Cond_Indeterminate | #Cond_Enabled}


Returns True if the Display Property specified by the propID enum argument has the state specified by the condition emum argument, otherwise returns False.

A valid scene selection is required for this method to return a meaningful result, if the selection is empty, a value of False will be returned.

#Cond_AnyChecked will return True if the specified Display property is checked in at least one of the selected objects, and False if all objects have the property unchecked.

#Cond_AnyUnchecked will return True if the specified Display property is unchecked in at least one of the selected objects, and False if all objects have the property checked.

#Cond_Indeterminate will return True if at least one object has the specified Display property in a different state than the other objects, and False if all objects have the same state, regardless of whether it is checked or unchecked.

#Cond_Enabled will return True if the checkbox is enabled and can be set using the mouse, or False if the property cannot be set interactively because the current selection does not support setting this property for all objects.

   

<void>nodeSelectionSet.setDisplayPropState <enum>propID <boolean>val 

    propID enums: {#DisplayProp_Transparent | #DisplayProp_Bone | #DisplayProp_FrozenWithMaterial | 
        #DisplayProp_Hidden | #DisplayProp_Frozen | #DisplayProp_Box | #DisplayProp_BackfaceCull | 
        #DisplayProp_AllEdges | #DisplayProp_BoneOnly | #DisplayProp_BoneAsLine | #DisplayProp_ShowTrajectory | 
        #DisplayProp_VertexTicks | #DisplayProp_IgnoreExtents | #DisplayProp_XRay}


Sets the state of the Display Property specified by the first argument to the Boolean state given by the second argument.

   

<boolean>nodeSelectionSet.getRenderPropState <enum>propID <enum>condition 

    propID enums: {#RenderProp_Renderable | #RenderProp_CastShadows | #RenderProp_ReceiveShadows | 
        #RenderProp_MotionBlur | #RenderProp_DisplayTexture | #RenderProp_InheritVisibility | #RenderProp_ColorVerts | 
        #RenderProp_ShadeColorVerts | #RenderProp_VelocityMotionBlur | #RenderProp_RenderOccluded | #RenderProp_CastCaustic | 
        #RenderProp_ReceiveCaustics | #RenderProp_ApplyAtmospherics | #RenderProp_CastGlobalIllumination | 
        #RenderProp_ReceiveGlobalIllumination | #RenderProp_InvisibleToCamera | #RenderProp_InvisibleToReflections} 

    condition enums: {#Cond_AnyChecked | #Cond_AnyUnchecked | #Cond_Indeterminate | #Cond_Enabled}


Returns True if the Render Property specified by the propID enum argument has the state specified by the condition emum argument, otherwise returns False.

A valid scene selection is required for this method to return a meaningful result, if the selection is empty, a value of False will be returned.

#Cond_AnyChecked will return True if the specified Render Property is checked in at least one of the selected objects, and False if all objects have the property unchecked.

#Cond_AnyUnchecked will return True if the specified Render Property is unchecked in at least one of the selected objects, and False if all objects have the property checked.

#Cond_Indeterminate will return True if at least one object has the specified Render Property in a different state than the other objects, and False if all objects have the same state, regardless of whether it is checked or unchecked.

#Cond_Enabled will return True if the checkbox is enabled and can be set using the mouse, or False if the property cannot be set interactively because the current selection does not support setting this property for all objects.

   

<void>nodeSelectionSet.setRenderPropState <enum>propID <boolean>val 

    propID enums: {#RenderProp_Renderable | #RenderProp_CastShadows | #RenderProp_ReceiveShadows | 
        #RenderProp_MotionBlur | #RenderProp_DisplayTexture | #RenderProp_InheritVisibility | #RenderProp_ColorVerts | 
        #RenderProp_ShadeColorVerts | #RenderProp_VelocityMotionBlur | #RenderProp_RenderOccluded | #RenderProp_CastCaustic | 
        #RenderProp_ReceiveCaustics | #RenderProp_ApplyAtmospherics | #RenderProp_CastGlobalIllumination | 
        #RenderProp_ReceiveGlobalIllumination | #RenderProp_InvisibleToCamera | #RenderProp_InvisibleToReflections}


Sets the state of the Render Property specified by the first argument to the Boolean state given by the second argument.

   

EXAMPLE

b = box()
--> $Box:Box001 @ [0.000000,0.000000,0.000000]
c = cylinder pos:[0,100,0]
--> $Cylinder:Cylinder001 @ [0.000000,100.000000,0.000000]
s = sphere pos:[100,0,0]
--> $Sphere:Sphere001 @ [100.000000,0.000000,0.000000]
b.vertexTicks = c.vertexTicks  = s.vertexTicks  = true
-->true
c.boxMode = true
-->true

--Check to see if the Display As Box property is checked in any of the objects:
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_AnyChecked
-->false --because nothing is selected in the scene!
select #(b,c,s) --select all three objects
-->OK
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_AnyChecked
-->true --because at least one of them has the Display As Box checked!
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_Indeterminate
-->true --because some are checked and some are not
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_AnyUnchecked
-->true --because two are unchecked
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_Enabled
-->true --because the checkbox is enabled and can be set to another state with the mouse
c.boxMode = false --let's turn off the Box mode of the Cylinder 
-->false
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_AnyChecked
-->false --now none of the three objects has the state checked. so we get false
nodeSelectionSet.getDisplayPropState #DisplayProp_Box #Cond_AnyUnchecked
-->false --same reason, all are checked!

--Now let's explore the Vertex Ticks display property:
nodeSelectionSet.getDisplayPropState #DisplayProp_VertexTicks  #Cond_AnyChecked
-->true --because the Vertex Ticks option of all three objects is checked
nodeSelectionSet.getDisplayPropState #DisplayProp_VertexTicks  #Cond_Indeterminate
-->false --the Vertex Ticks of all three objects are checked, so the checkbox is not indeterminate
nodeSelectionSet.getDisplayPropState #DisplayProp_VertexTicks #Cond_AnyUnchecked
-->false --the Vertex Ticks of all three objects are checked, ergo none is unchecked!

--Now let's explore the Renderable property:
nodeSelectionSet.getRenderPropState #RenderProp_Renderable #Cond_AnyChecked 
--true --right now all three objects are renderable
nodeSelectionSet.getRenderPropState #RenderProp_Renderable #Cond_AnyUnchecked 
--false --so of course none of them has the Renderable property unchecked...
nodeSelectionSet.getRenderPropState #RenderProp_Renderable  #Cond_Indeterminate
--false --that's why the checkbox is not intederminate, it is checked for all three
s.renderable = false --so let's uncheck the renderable property of the Sphere
-->false
nodeSelectionSet.getRenderPropState #RenderProp_Renderable #Cond_AnyUnchecked 
--true --now there is one property that is unchecked, so we get true as result!
nodeSelectionSet.getRenderPropState #RenderProp_Renderable  #Cond_Indeterminate
--true --and of course the checkbox would now be indeterminate

--finally, let's turn off the renderable property of all three objects
nodeSelectionSet.setRenderPropState #RenderProp_Renderable false 
-->OK
nodeSelectionSet.getRenderPropState #RenderProp_Renderable #Cond_AnyChecked 
-->false --we successfully unchecked the Renderable property of the current selection!