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

Version 1 Next »

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

The script compares all nodes against a given name, prints out a message if the name has been found, and selects the appropriate node. If the object does not exist you will also get a message.

The script's output is formatted and the name of the searched object is printed in quotes ("Cube03"). To do this, the escape character (\) is used:

checkForName  = "Cube03"
nodeNames     = []
nodeSelection = []
sceneNodes    = scene.getNodes()
 
for entry in sceneNodes:
	nodeNames.append(entry.getName())
 
if (checkForName in nodeNames):
	scene.message("Object \""+checkForName+"\" exists.")
	nodeSelection.append(scene.getObject(checkForName))
 
else:
	scene.message("Object \""+checkForName+"\" ist not part of the project.")
 
scene.selectNodes(nodeSelection, True)

  • No labels