Jump to content

Camera Path Object attribute update upon delete


Recommended Posts

Hi!

I'm wondering the following. I have a camera object on which I attach a curve path object. If I delete the curve object the camera automatically updates. I need this sort of behavior as I have a situation where a master node (derived from OBJ_Null) is the link to a bake format. And other nodes, like SOP for example, point to this one. So if I delete the master node I want the dependent nodes to be updated (throw an error). Any clues about this?

Thanks guys!

P.S. - In the SOP's case is not a big deal as they copy the geometry, but later I'll want to add cameras an so...

Edited by nestumkiller
Link to comment
Share on other sites

Are these custom SOPs? If so, they need to call addExtraInput(OP_DATA_INTEREST, obj_node) and make sure to do right thing when obj_node is NULL.

Yes, they are custom ones. By the way, I call that code inside cookMySop() and I start having my node out of date after I change something on the object I'm pointing to. The SOP basically extracts pieces of geo from the other node, and when I change the scene the SOP all shows the previous one. So, I noticed the existence of clearExtraInputs(), which seems to make it work fine. Do you know why? This mechanism seems like a kind of Listener pattern... is it something like this?

Anyway, thanks a lot Ed!

Cheers

Link to comment
Share on other sites

Yes, they are custom ones. By the way, I call that code inside cookMySop() and I start having my node out of date after I change something on the object I'm pointing to.

From your description it sounds like you're dependent on a different SOP, not an object since you're extracting geometry from a SOP. Then make sure that you're doing addExtraInput() with the other SOP node. Anyhow, it sounds like its behaving as it should since changing a parameter on the other node changes its data, which in turn means that your extract node needs to recook.

Link to comment
Share on other sites

From your description it sounds like you're dependent on a different SOP, not an object since you're extracting geometry from a SOP. Then make sure that you're doing addExtraInput() with the other SOP node. Anyhow, it sounds like its behaving as it should since changing a parameter on the other node changes its data, which in turn means that your extract node needs to recook.

The other objecyt is not actually a SOP but a OBJ_Null-derived object. Since it represents more than geometry (cams, lights, etc...) I decided to code it at that level. Do I need to also add the addExtraInput() to that node (when you say "Then make sure that you're doing addExtraInput() with the other SOP node")? Having cross-references?

Thanks once again Ed :)

Link to comment
Share on other sites

I'm confused about your setup then. In anycase, here's how it works generically. Suppose we have node_A which uses data created by node_B. Then in node_A's cook method, it needs a addExtraInput(OP_DATA_INTEREST, node_B) call.

Link to comment
Share on other sites

I'm confused about your setup then. In anycase, here's how it works generically. Suppose we have node_A which uses data created by node_B. Then in node_A's cook method, it needs a addExtraInput(OP_DATA_INTEREST, node_B) call.

Lol. Sorry if I wasn't clear. Well, it's pretty simple, I have a custom importer node, derived from OBJ_Null which acts as a bake format importer. Then, the SOP that I mentioned, when connected to the importer, gets the geo.

Anyway, I did what you said, and it's working just fine :).

Thanks a lot for all the help. It's pretty hard to get documentation on HDK :S (as everyone knows...).

Cheers

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...