Jump to content

accessing hou.Geometry() from SIM_SopGeometry DopData


static

Recommended Posts

Is there a way to access hou.Geometry() for hou.DopData() that isn't native "Geometry" subdata?

I have a series of rbd box objects, and each contains a "trigger" geometry subdata (a single point that has an int attrib "active"). The plan is that when the active value switches, the object becomes active. I can access the trigger data just fine, and its data type is SIM_SopGeometry. However, I don't know how to access the point data it contains. It doesn't seem to have any hooks to a hou.Geometry() object. A hook exists for the normal "Geometry" subdata that exists for all rbd dopobjects, but I can't store my data in there...

Here's a pic to simplify what I'm trying to access.

detailsView.png

Any help would be appreciated :)

Link to comment
Share on other sites

There currently isn't. It took me a bit of fighting and nagging to even get the ability to get the regular geometry as geometry. Right now the best you'd be able to do is to use the soppath field on the data to look back into SOPs and retrieve the value from there.

data = dopobject.findSubData("trigger")
options = data.options()
soppath = options.field("soppath")
sopnode = hou.node(soppath)
geo = sopnode.geometry()
active = geo.iterPoints()[0].attribValue("active")

Edited by graham
Link to comment
Share on other sites

There currently isn't. It took me a bit of fighting and nagging to even get the ability to get the regular geometry as geometry. Right now the best you'd be able to do is to use the soppath field on the data to look back into SOPs and retrieve the value from there.

Nice suggestion. The expression was getting pretty long, so I decided to just wrap up an hscript expression in python to access the value a little more easily.

hscriptExpression('point("..:%s/trigger",0,"active",0)' % expandString('$OBJNAME'))

hip file attached to demonstrate.

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