Jump to content

PYTHON::Dynamic Operator


sanostol

Recommended Posts

Hi, I'm trying to update some rbds positions and rotations with pytondop.

it works but it is slow. I use code like this:

objects = hou.pwd().objectsToProcess()
ctrl = hou.node("/obj/box_object1/add1")

simulation = hou.node("..").simulation()

for item in objects:
    id = simulation.findData(item.name()+"/CopyInfo/").options().field("copynum")

    ....

I'm not sure if I get this right, but I think for every processed object the loop is run, for 1000 objects that means a lot of double work. so my question is there a way to do this just for the current processed object

Martin

Link to comment
Share on other sites

You could easily test if it is running the loop for each object by putting a print in there and just using 3 objects or something. If it prints it more than 3 times its running it for each object.

I feel that if it is running for each object there should be some function in hou.DopNode to get current object but I can't see any.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...