Jump to content

how to make variable evaluate in real time?


panupat

Recommended Posts

Hi. A total new Houdini user here :) I'm following some tutorial on Youtube and it's showing how to use $F in channel box. In the video, the value got updated in real time as the user scroll the time line (or click play button). However in my Houdini the value only updates when I release my mouse to after I click the stop button. How can I make it update in real time?

Edited by panupat
Link to comment
Share on other sites

Thanks Graham!

I have another question. When I copy parameter and do a Paste Copied Reference, is there a way to paste without replacing what's already there?

For example I have

ch("/obj/stair/copy1/ncy")

And I want to add ty

ch("/obj/stair/copy1/ncy") * ch("/obj/stair/copy1/ty")

But when I paste ty, it replaces the whole thing.

Link to comment
Share on other sites

I have another question. When I copy parameter and do a Paste Copied Reference, is there a way to paste without replacing what's already there?

It's been a long-time requested feature and nope, it's not possible yet... :(

What most people do is paste copied reference to another parameter and then cut-and-paste in the desired parameter.

Cheers

  • Like 1
Link to comment
Share on other sites

It's been a long-time requested feature and nope, it's not possible yet... :(

Ah that's quite a surprised :blink:

@Graham - sounds a bit advance... I'm sure I'll be able to do that someday!

Thanks guys.

Edited by panupat
Link to comment
Share on other sites

It is quite possible to actually write something like this yourself by using the information returned by hou.parmClipboardContents() and custom PARMmenu.xml entries.

Awesome! I'm reading about it now...

Now if it's so easy why is it not a default behavior?! :S

Link to comment
Share on other sites

It is quite possible to actually write something like this yourself by using the information returned by hou.parmClipboardContents() and custom PARMmenu.xml entries.

Indeed, I just managed to write one and it works quite nicely, except that I can't disable the commands when the hou.parmClipboardContents is empty.

Thanks for the tip, Graham!

Cheers

Link to comment
Share on other sites

Indeed, I just managed to write one and it works quite nicely, except that I can't disable the commands when the hou.parmClipboardContents is empty.

Thanks for the tip, Graham!

Cheers

hi Rafael ,

rambling in vain through houdini py and xml files didnt helped me to understand or ' connect things ' .

since my interest in changing the RightClickMenu-s is , actually , greater than my shame about asking " how can i ? " so

, here it comes my brave question :

=) how could you make it ??

can you describe in short what you modified ?

.cheers

Link to comment
Share on other sites

can you describe in short what you modified ?

Hey Zarti, I generally post files, but in this case, since I was figuring this out at work and later shared with the team, I was a bit concerned that it would be looked upon badly... :ph34r:

Nevertheless, here goes a quickie. I mainly looked at this page of the documentation:

http://www.sidefx.com/docs/houdini12.1/basics/config_menus

From there I learned about creating the PARMmenu.xml inside my $HOME/houdinixx.x/

The contents of my XML are:


<?xml version="1.0" encoding="UTF-8"?>
<menuDocument>
<menu>
<addScriptItem id="append_ref">
<parent>root_menu</parent>
<label>Append Copied References</label>
<scriptPath>append_reference.py</scriptPath>
<insertBefore>del_channels</insertBefore>
<scriptArgs>-abs</scriptArgs>
</addScriptItem>
</menu>
<menu>
<addScriptItem id="append_rel_ref">
<parent>root_menu</parent>
<label>Append Copied Relative References</label>
<scriptPath>append_reference.py</scriptPath>
<insertBefore>del_channels</insertBefore>
<scriptArgs>-rel</scriptArgs>
</addScriptItem>
</menu>
</menuDocument>
[/CODE]

You'll have to modify the scriptpath tag with the path to your script in your machine

My python script is this:

[CODE]
# imports the hou module so we can start accessing houdini's commands
import hou
from sys import argv

def append_ref(mykwargs, mode='-abs'):
# check for contents of parm clipboard
myParmClip = hou.parmClipboardContents()
if myParmClip != ():
relPathPrefix = mykwargs['parms'][0].node().relativePathTo(hou.parm(myParmClip[0]['path']).node())
for i in range(min(len(myParmClip), len(mykwargs['parms']))):
parmFrom = {'path':myParmClip[i]['path'], 'language':myParmClip[i]['expressionLanguage'], 'name':hou.parm(myParmClip[i]['path']).name()}
parmTo = mykwargs['parms'][i]
# test if parm already has an expression assigned
try:
parmToExp = {'expression':parmTo.expression(), 'language':parmTo.expressionLanguage()}
except:
parmToExp = {'expression':"", 'language':hou.exprLanguage.Hscript}
# sets the expressions
if argv[1] == '-abs':
parmTo.setExpression(expression=parmToExp['expression'] + "ch(\"" + parmFrom['path'] + "\")", language=parmToExp['language'])
elif argv[1] == '-rel':
parmTo.setExpression(expression=parmToExp['expression'] + "ch(\"" + relPathPrefix + "/" + parmFrom['name'] + "\")", language=parmToExp['language'])
# return success
return 0
else:
# return failure
return -1
append_ref(kwargs, argv[1])
[/CODE]

Now, while it does work fine here, I'm not proud of the code nor do I guarantee anything! :D

Cheers

  • Like 1
Link to comment
Share on other sites

..

http://www.sidefx.co...cs/config_menus

Now, while it does work fine here, I'm not proud of the code nor do I guarantee anything! :D

Cheers

oho ! it works and you should be proud even if it was only just for the link to onlineDocs .. =)

searching with 'menu' keyword on helpSytem brought many other thing , but ..

anyway , thanks Rafael . appreciate your reply .

.cheers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...