RBD - gluestrength triggering issues

   1217   0   0
User Avatar
Member
85 posts
Joined: 8月 2010
Offline
Hi there

I am simulating destruction using the rbd solver
I am using a color attribute to drive glue strength

in order to trigger the impulses to break the glue, i am using a lookup in an expression but am running into problems. I am a bit baffled, i am creating a python expression inside on the glue strength attribute of the rbdstate node

I want to return the current object name in the dop, when i use hou.lvar(“OBJNAME”) it returns a float value
in the docs it says that that variable should return a string

I need this name as a string so i can look up color values in a sopgroup with the same name
this is the python expression that I am using:

node = hou.node('/obj/mysopPath')
groupName = hou.lvar('OBJNAME')
geo = node.geometry()
groupies = geo.primGroups()
r = None

for g in groupies:
if groupName == g.name():
p = g.prims()
r = p.attribValue('Cd')

if r == 1.0:
return 0
else:
return -1

I printed groupName and got a float value?

any help would be muchly appreciated!
Sam Swift-Glasman
Art Director
Five AI
  • Quick Links