How to use *::2.0 nodes in python-like component snippet?

   639   2   2
User Avatar
Member
29 posts
Joined: 5月 2015
Offline
Sometimes I come across APEX nodes that is 2.0 version, for example transform::LookAt::2.0.
In component snippet, if I use
xform.LookAt(lookat_xform, lookup_xform)
, a 1.0 version lookat node will be created. I wonder what's the correct way to use 2.0 version node in snippet?
Edited by NMVHS - 2024年9月28日 00:37:18
User Avatar
スタッフ
83 posts
Joined: 5月 2021
Offline
you can always set this directly using:

xform.LookAt.v2_0(lookat_xform, lookup_xform)


There is however a way to automatically get the latest version of a given callback.

On your SOP node go to the Header folder. Turn the header toggle on and use the toggle add Version. Then a little function called HoudiniVersion() will be added to the beggining of you snippet. Based on your current houdini version we can now automatically deduce which version to use. meaning that

xform.LookAt(lookat_xform, lookup_xform)

should give the correct latest version.
Having said that. This is currently not supported for your own custom functions.

I hope this helps
User Avatar
Member
29 posts
Joined: 5月 2015
Offline
esttri
you can always set this directly using:

xform.LookAt.v2_0(lookat_xform, lookup_xform)


There is however a way to automatically get the latest version of a given callback.

On your SOP node go to the Header folder. Turn the header toggle on and use the toggle add Version. Then a little function called HoudiniVersion() will be added to the beggining of you snippet. Based on your current houdini version we can now automatically deduce which version to use. meaning that

xform.LookAt(lookat_xform, lookup_xform)

should give the correct latest version.
Having said that. This is currently not supported for your own custom functions.

I hope this helps
That's great info, thank you!
  • Quick Links