Is there any way to store last modified translate parm value

   536   2   1
User Avatar
Member
37 posts
Joined: 4月 2020
Offline
I'm making a tank rig,I need to computer distance between new position and last position
User Avatar
Member
243 posts
Joined: 5月 2017
Offline
Unfortunately there are no OnReleas, OnPress parameter events to store the last parm value. But you can compare time delta(cached/current time) with a tolarance value, which is not perfect but gives you a similar effect.

In the hip / embedded hda / scripts / python module you will find a constant MAX_TIME_DELTA, which is the tolarance value in milliseconds. Currently it is set to 300, you can play with it to find a sweet spot that might work for you.

If you more up to get distance while moving something in the viewport you can impliment hou.ViewerDragger [www.sidefx.com]. See drag_delta.hip example.

Image Not Found

Image Not Found

Attachments:
store_last_parm_value.gif (112.3 KB)
store_last_parm_value.hiplc (97.9 KB)
drag_delta.hiplc (116.3 KB)

User Avatar
Member
37 posts
Joined: 4月 2020
Offline
vikus
Unfortunately there are no OnReleas, OnPress parameter events to store the last parm value. But you can compare time delta(cached/current time) with a tolarance value, which is not perfect but gives you a similar effect.

In the hip / embedded hda / scripts / python module you will find a constant MAX_TIME_DELTA, which is the tolarance value in milliseconds. Currently it is set to 300, you can play with it to find a sweet spot that might work for you.
Image Not Found

If you more up to get distance while moving something in the viewport you can impliment hou.ViewerDragger [www.sidefx.com]. See drag_delta.hip example.

Image Not Found

Image Not Found
Thank you very much!
I'll try it!
  • Quick Links