just to clarify
above mentioned modes of parameter (exp
ression/string) are just UI way to tell the user what he is looking at/will edit when Alt+E
therefore they doesn't change/activate/deactivate anything
the same principle as float values, when you want to switch between looking at exp
ression or computed value
hou.Parm.exp
ression() will return you exp
ression on current frame of animated parameter
"4" is perfectly good exp
ression and it evaluates to string 4
"return 4" in python is another exp
ression which evaluates to 4
hou.Parm.exp
ression() always returns exp
ression, so don't be fooled by "4" exp
ression, it is still perfectly valid and it's not just a value that's returned, because it could have been anything else with the same result
all animated parameters have exp
ression on each keyframe so if you are animating strings you are actually setting exp
ressions, if parameter doesn't have any keyframe, it doesn't have any exp
ression (in case of direct references the keyframe is not visible in channel view, since you see referenced parameter directly, but it is there anyway)
to make it even more clear even simple keyframed animation on float parameters is made from exp
ression functions like bezier(), linear(), this concept is very powerful since you can mix hand keyframed animation with other functions
the only thing I agree that may be confusing is that string parameters don't set keyframe when writing python exp
ression in exp
ression mode directly to the field it works only with Alt+E or if the keyframe is already present
I guess that if this is fixed, it will be less confusing for many people, this still doesn't mean that keyframe should be present since most of the time you need to have Alt+E editor open when you are dealing with multiline python exp
ressions so it's just the matter of going there from exp
ression mode, setting keyframe to write exp
ression isn't the big deal either since keyfrme needs to be set for every exp
ression anyway and Alt+Click is certainly as easy as writing ` `
the consistency with Hscript may not be a big problem either since Python was planned to replace Hscript at some point so I don't mind if it has different rules.
Edited by anim, 28 July 2012 - 08:41 PM.