An expression function to find the global scale of an object??

   1479   3   1
User Avatar
Member
517 posts
Joined: 12月 2013
Offline
Hi there,

I'm just looking for an expression function that I could use to get an object's global scale. I'd like to use it to detect if parts of my rig have been mirrored.

Any ideas?
Thanks!
Pete
Edited by peteski - 2018年3月26日 23:49:21
User Avatar
Member
69 posts
Joined: 11月 2016
Offline
You can use Python to get the value of the scales using evalParmTuple.

Something like this:

spam = hou.node("path/to/object/you/want/to/get/the/scale")

egg = spam.evalParmTuple("s")

print egg

# (-1.0, -1.0, -1.0)
User Avatar
Member
517 posts
Joined: 12月 2013
Offline
Hey thanks huey_yeng! I was looking for an expression function though so I could put it into a channel.



Is that a case where I'd maybe switch this to python? (I've never actually done that).
Edited by peteski - 2018年3月27日 08:17:37
User Avatar
Member
69 posts
Joined: 11月 2016
Offline
Yeap you can switch that to Python for Python expression.

If I'm not mistaken, Houdini will colour code the parameter with purple if the expression it is expecting was invalid.

You can also toggle the expression type anytime by right clicking it and go to Expression > Change Language to whatever.
  • Quick Links