Versions Compared

Key

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

...

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

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

...