Hi,
import c4d
from c4d import gui
#Welcome to the world of Python
def main():
name = "cube"
c4d.CallCommand(100004766)
objList = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_0)
for obj in objList:
if obj.GetName().find(name) == int(-1):
doc.SetSelection(obj, c4d.SELECTION_SUB)
c4d.EventAdd()
if __name__=='__main__':
main()
The whole script works. Just wondering how to read this particular line. (The line after the For loop command)
In the docu, (1) GetName requires a string. However, in the code referred, it works despite not having a string.
This gives me the impression that .find() is the string. Okay maybe it is, but (2)where do I locate the find() command in the docu (tried searching but there were several find commands and they are not specific to names).
Lastly, what does this mean (3) command means int(-1):?
Credits: The code is lifted on this thread https://www.cineversity.com/forums/viewthread/1305/#4453
Thank you for your time.