Your Image

Isopix Module

Module Information

Isopix is a powerful Python library that offers a user-friendly and intuitive approach to automate tasks in Isotropix's Clarisse software. With its Houdini-like syntax,
Isopix serves as a valuable alternative to Clarisse's native Python API, enabling users to easily learn and utilize Python for automating various tasks.

Requires Python 3.7 or Later, Below are some quick start examples

Create Node

This example demonstrates how to create a new node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
# Create a new 'polysphere' node with the name 'my_sphere'.
isopix.createNode('GeometryPolysphere', 'my_sphere')

print("Successfully created a new 'polysphere' node with the name 'my_sphere'.")
# Output/result: 
Successfully created a new 'polysphere' node with the name 'my_sphere'.

Create Reference Node

This example demonstrates how to create a file reference node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix


# Create a file reference node in the '/my_context' context with the specified geometry file path.
isopix.refNode('build://context', 'file_path/to/geometry.usd')

print("Successfully created a file reference node in the 'build://context' context with the specified geometry file path.")
# Output/result: 
Successfully created a file reference node in the 'build://context' context with the specified geometry file path.

Get Attributes

This example demonstrates how to get component attribute values of a node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/my_node'')

translation = node.get_attrib('translate')
print(f"The translation attribute value is: {translation}")
# Output/result: 
The  translation attribute value is: (0,0,0)

Get X, Y, Z Attributes

This example demonstrates how to get X, Y, Z attribute values of a node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/my_node')
translation_x = node.get_attrib('translate').x()
translation_y = node.get_attrib('translate').y()
translation_z = node.get_attrib('translate').z()

print(f"The X translation attribute value is: {translation_x}")
print(f"The Y translation attribute value is: {translation_y}")
print(f"The Z translation attribute value is: {translation_z}")
# Output/result: 
The X translation attribute value is: 0
The Y translation attribute value is: 0
The Z translation attribute value is: 0

Set X,Y,Z Component of Attribute

This example demonstrates how to set the X,Y,Z component of an attribute .

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/my_node')

node.set_attrib('translate').x(1)
node.set_attrib('translate').y(1.2)
node.set_attrib('translate').z(2.1)

print("Successfully set the X component of the 'translate' attribute to 1.")
print("Successfully set the Y component of the 'translate' attribute to 1.2.")
print("Successfully set the Z component of the 'translate' attribute to 2.1.")
# Output/result: 
Successfully set the X component of the 'translate' attribute to 1.
Successfully set the Y component of the 'translate' attribute to 1.2.
Successfully set the Z component of the 'translate' attribute to 2.1.

Set Component of Attribute using the Set Method

This example demonstrates how to use the set method to set the attribute

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/my_node')
node_obj.set_attrib('translate').set([4,0.5,12])

print("Successfully set the all component of the 'translate' attribute to [4,0.5,12]")
# Output/result: 
Successfully set the all component of the 'translate' attribute to [4,0.5,12].

Get All Nodes in Context

This example demonstrates how to get child nodes of a context in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context')
children_list = node_obj.children()

print(children_list)
# Output/result: 
{
    "Name": ['/context/Object1','/context/Object2','/context/Reference1','/context/Reference2','/context/Reference3','/context/Context1','/context/Context2','/context/Context3'],
    "Instance": [class Isopix obj1, class Isopix obj2,class Isopix ref1, class Isopix ref2, class Isopix ref3,class Isopix cxt1, class Isopix cxt2, class Isopix cxt3]
}

Filter Selection of Object, Context, and Reference Nodes in a Context

This example demonstrates how to get object, context, and reference nodes in a context in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context')

objects = node.children().obj()
contexts= node.children().cxt()
references = node.children().ref()

print('Objects are:' + str(objects))
print('Contexts are:' + str(contexts))
print('References are:' + str(references))
# Output/result: 
Objects are: {Name: ['/context/Object1','/context/Object2'], Instance: [class Isopix obj1, class Isopix obj2]}
Contexts are: {Name: ['/context/Context1','/context/Context2','/context/Context3'], Instance: [class Isopix cxt1, class Isopix cxt2, class Isopix cxt3]}
References are: {Name: ['/context/Reference1','/context/Reference2','/context/Reference3'], Instance: [class Isopix ref1, class Isopix ref2, class Isopix ref3]}

Get Node Type

This example demonstrates how to determine the type of a node in Isotropix Clarisse and get boolean values.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context')

# Check if the node is a reference node.
is_reference = node.is_ref()
print(f"Is Reference Node: {is_reference}")

# Check if the node is an object node.
is_object = node.is_obj()
print(f"Is Object Node: {is_object}")

# Check if the node is a context node.
is_context = node.is_cxt()
print(f"Is Context Node: {is_context}")
# Output/result: 
Is Reference Node: False
Is Object Node: False
Is Context Node: True

Get Name of Node

This example demonstrates how to get the name of a node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/polysphere')
node_name = node.name()

print(f"The name of the node is: {node_name}")
# Output/result: 
The name of the node is: polysphere

Get Path of Node

This example demonstrates how to get the path of a node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/my_node')
node_path = node.path()

print(f"The path of the node is: {node_path}")
# Output/result: 
The path of the node is: /my_context/my_node

Get Context of Node

This example demonstrates how to get the context of a node in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/node')
context_node = node.get_context()

print(f"The context of the node is: {context_node}")
# Output/result: 
The context of the node is: /context

Get Child Node by Name

This example demonstrates how to get a specific child node of a context by its name in Isotropix Clarisse.

# Import the required module.
from Isopix import isopix

# Initialize the node object from the isopix module with the specified context path.
node = isopix.node('/context/my_sphere')
child_node = node.child('my_sphere')

print(f"Child node 'my_sphere': {child_node}")
# Output/result: 
Child node 'my_sphere': 'build://context/my_sphere'