Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

Getting Names

Add this script to a "Batch Script" editor (F10) and execute it with Script > Run.

The script prints out the names of all scene nodes:

sceneNodes = scene.getNodes()
 
for node in sceneNodes:
	nodeName = node.getName()
	scene.message(nodeName)

Renaming Nodes

Add this script to a "Batch Script" editor (F10) and execute it with Script > Run.

The script renames objects inside the "Object_Group" and adds leading 0s:

objectGroup = scene.getGroup("Object_Group")
objects     = objectGroup.getNodes()
namePrefix  = "RealFlow_Object_"
counter     = 0
 
for entry in objects:
	if (counter < 10)                   : padding = "00"+str(counter)
	if (counter >= 10 and counter < 100): padding = "0"+str(counter)
	if (counter >= 100)                 : padding = str(counter)
 
completeName = namePrefix+padding
entry.setName(completeName)
 
counter += 1

Grouping Nodes

Add this script to a "Batch Script" editor (F10) and execute it with Script > Run.

The script looks for daemons in the scene and groups them under a new "Daemon_Group" node:

daemons = scene.getDaemons()
group   = scene.addGroup()
 
group.setName("Daemon_Group")
 
for entry in daemons:
	group.add(entry.getName())

Hiding and Showing Nodes

Add this script to a "Batch Script" editor (F10) and execute it with Script > Run.

The script changes a node selection's visibility to hidden:

nodeSelection = scene.getSelectedNodes()

for entry in nodeSelection:
	entry.setParameter("Visible", False) # make the nodes visible again with ("Visible", True)

Simulation States

Add this script to a "Batch Script" editor (F10) and execute it with Script > Run.

The script sets the nodes from the "Rigid_Bodies" group to inactive:

group = scene.getGroup("Rigid_Bodies")
groupNodes = group.getNodes()
 
for entry in groupNodes:
	entry.setParameter("Simulation", "Inactive")
  • No labels