Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 before the quote mark (\") is used:

 

Code Block
languagepy
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)