Sounds simple, but I can't seem to find any info on how to get the name of the current take with python (or hscript, for that matter). Anyone know how to go about this?
Thanks!
Python Question
3503 5 2- Okkine
- Member
- 6 posts
- Joined: June 2008
- Offline
- Anonymous
- Member
- 678 posts
- Joined: July 2005
- Offline
It looks that you are out of luck:
http://www.sidefx.com/docs/houdini12.0/hom/hou/Take [sidefx.com]
http://www.sidefx.com/docs/houdini12.0/hom/hou/takes [sidefx.com]
http://www.sidefx.com/docs/houdini12.0/hom/hou/Take [sidefx.com]
http://www.sidefx.com/docs/houdini12.0/hom/hou/takes [sidefx.com]
- Solitude
- Member
- 373 posts
- Joined: March 2009
- Offline
according to: http://www.sidefx.com/docs/houdini12.0/commands/takeset [sidefx.com] the variable $ACTIVETAKE lists the current take. In python you should be able to do:
import os
os.getenv('ACTIVETAKE')
or something along those lines – I don't have it open to test at the moment.
import os
os.getenv('ACTIVETAKE')
or something along those lines – I don't have it open to test at the moment.
Ian Farnsworth
- graham
- Member
- 1907 posts
- Joined: Nov. 2006
- Offline
With Houdini variables, os.environ isn't reliable/useful. ACTIVETAKE kind of works given how early it is set by Houdini, however it breaks down soon afterwards. Creating a new take and switching to it will leave the value incorrect. You should use hou.expandString() instead.
>>> os.environ.get(“ACTIVETAKE”)
'Main'
>>> hou.expandString(“$ACTIVETAKE”)
'take1'
>>> os.environ.get(“ACTIVETAKE”)
'Main'
>>> hou.expandString(“$ACTIVETAKE”)
'take1'
Graham Thompson, Technical Artist @ Rockstar Games
- Solitude
- Member
- 373 posts
- Joined: March 2009
- Offline
- VisualCortexLab
- Member
- 509 posts
- Joined: July 2005
- Offline
graham
With Houdini variables, os.environ isn't reliable/useful. ACTIVETAKE kind of works given how early it is set by Houdini, however it breaks down soon afterwards. Creating a new take and switching to it will leave the value incorrect. You should use hou.expandString() instead.
>>> os.environ.get(“ACTIVETAKE”)
'Main'
>>> hou.expandString(“$ACTIVETAKE”)
'take1'
THANKS.this just saved my after banging my head against the screen for 2 hours!! .. what I don't understand is *why* suddenly is.environ didn't work anymore! (in my case that was the culprit variable)
but anyway… Thanks! .. now I can go home.
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
VisualCortexLab Ltd :: www.visualcortexlab.com
-
- Quick Links