It seems that houdini is not able to evaluate two conditions when the two parms driving them are mixed (one from outside the parmblock folder and one other from inside)
Or it's most likely that I'm just plain dumb.
In any case, would you please have a look?
I'm trying to disable the “local seed” when the general switch is OFF (local seed on?) and when the corresponding sequence type is set to STEP.
As you can see in the picture, the “localSeedOn” toggle is not checked, but it is not able to drive the “disable” action on the local seeds subparms.
Thanks a lot
Found 900 posts.
Search results Show results as topic list.
Houdini Indie and Apprentice » How to disable multiparm parm with combined conditions?
- Andr
- 900 posts
- Offline
Technical Discussion » Assigning Custom hotkey to a python function
- Andr
- 900 posts
- Offline
I was wondering if now the following method is supported:
OnLoaded, a digital asset temporally assigns an hotkey to a python function.
The hotkey would launch a function inside the otl (10 frames jump in the timeline).
Then OnDeleted the original hotkey is restored.
cheers
OnLoaded, a digital asset temporally assigns an hotkey to a python function.
The hotkey would launch a function inside the otl (10 frames jump in the timeline).
Then OnDeleted the original hotkey is restored.
cheers
Technical Discussion » documentation for toolutils
- Andr
- 900 posts
- Offline
Houdini Indie and Apprentice » Asset from single wrangle node?
- Andr
- 900 posts
- Offline
I think the fastest way is to save that wrangle as a preset, less hassle than making a digital asset
Technical Discussion » documentation for toolutils
- Andr
- 900 posts
- Offline
Hello, why is the module toolutils separated from hou? And why the documentation is not on sidefx? Is it a module created by other people? I'm confused
Can I do the following with just the hou module, without toolutils?
I'm not able to get an instance of the sceneViewer class just with the hou module
any help welcome!
cheers
Can I do the following with just the hou module, without toolutils?
import toolutils viewer = toolutils.sceneViewer() viewer.displayRadialMenu("myCustomRadialMenu")
I'm not able to get an instance of the sceneViewer class just with the hou module
any help welcome!
cheers
Edited by Andr - 2019年2月3日 09:29:54
Technical Discussion » Promote Specific Parameter with Python
- Andr
- 900 posts
- Offline
You mean you want to create channel references?
I guess you should just feed the one paramater value with one parm object
example when both parms are in the same node:
I guess you should just feed the one paramater value with one parm object
example when both parms are in the same node:
node = hou.pwd() first = node.parm("first") second = node.parm("second") first.set(second) # this will link the first parm to the values of the second parm
Technical Discussion » PolyExtrude in VEX
- Andr
- 900 posts
- Offline
following this thread.
I always wanted to try to build one in vex because the original one can't be compiled.
I always wanted to try to build one in vex because the original one can't be compiled.
Technical Discussion » Selected prims in Python...
- Andr
- 900 posts
- Offline
graham
import toolutils
viewer = toolutils.sceneViewer()
geo = viewer.selectGeometry()
print geo.mergedSelectionString()
thanks!
With primitives already selected in the viewport, I call this code from a button parameter: it returns the values, but also the viewport will lose the selection. Do you know how to avoid that?
It seems that it is the hou.SceneViewer.selectGeometry() function to cause this behavior.
I'm reading [www.sidefx.com] that the function should expect the user to perform the selection first and it would return the selected prims.
ps. I'm also getting this error sometimes: Execute Code - Recursion in parm callback
Edited by Andr - 2019年2月3日 04:45:33
Houdini Indie and Apprentice » Python: Creating nodes without the view 'jumping' to an other context?
- Andr
- 900 posts
- Offline
Hi, I had the same problem and just found out that u can just write node.setPicked(1) just after you create a node.
“node” would be the node you want stay with.
Example:
cheers
“node” would be the node you want stay with.
Example:
myNode = hou.pwd() obj = hou.node("/obj/") obj.createNode("cam" , "myNewCam") myNode.setPicked(1) #let's go back to myNode level
cheers
Houdini Indie and Apprentice » [Python] Failed to modify node or parameter because of a permission error
- Andr
- 900 posts
- Offline
hey Micheal, thanks for the tip!
The node inside is a simple null, so it's already “unlocked”..
I'll try the second option you mentioned.
Cheers!
The node inside is a simple null, so it's already “unlocked”..
I'll try the second option you mentioned.
Cheers!
Houdini Indie and Apprentice » Chances of random number based on ramp
- Andr
- 900 posts
- Offline
hey Aizatulin, thanks for the effort, I don't know if I fully understand what you are trying to achieve there, anyway thanks to your words I came up with a solution. The keyword was density.
It was just a matter of using a ramp to drive the density of a scatter node, which scatter points on a line of length 1.
Then I can just pick @P.x for every point to have my random generated value, based on density.
Dumb me, it was so easy.
Thanks again!! cheers
It was just a matter of using a ramp to drive the density of a scatter node, which scatter points on a line of length 1.
Then I can just pick @P.x for every point to have my random generated value, based on density.
Dumb me, it was so easy.
Thanks again!! cheers
Houdini Indie and Apprentice » [Python] Failed to modify node or parameter because of a permission error
- Andr
- 900 posts
- Offline
In the PythonModule of my digital asset I have this function:
The function, which is called by a button on the OTL, is trying to set the value of a parameter belonging to a node inside the same digital asset.
I get the following error whenever I try to run the function:
PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions
That's because the digital asset is locked, so I have to allow the editing of content of the OTL in order to make it work.
But this is not what I want to do.
What's the proper workflow with python to set a parameter of a node inside the digital asset?
Any help very appreciated,
cheers
def setChildParm(node): node.parm("/pathToNodeInsideOtl/parm").set(value)
I get the following error whenever I try to run the function:
PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions
That's because the digital asset is locked, so I have to allow the editing of content of the OTL in order to make it work.
But this is not what I want to do.
What's the proper workflow with python to set a parameter of a node inside the digital asset?
Any help very appreciated,
cheers
Edited by Andr - 2019年2月1日 16:17:06
Technical Discussion » Take saved through python can't be loaded back manually?
- Andr
- 900 posts
- Offline
When I save a take with python I can only load it back with python, not manually.
And vice versa, if I manually save a take, I can't load it back with python.
Is there any reason for this behavior?
What I noticed is that take files saved with python come with hexadecimal encoding (don't know if it's the correct term).
Also, reading from hou.Take.loadChildTakeFromFile(filename) help:
This seems misleading or I don't understand it.
I was able to load a take saved with python in a new hip file, and in a different version of houdini (17 vs 16.5), given that the new hip file has the same structure.
And vice versa, if I manually save a take, I can't load it back with python.
Is there any reason for this behavior?
What I noticed is that take files saved with python come with hexadecimal encoding (don't know if it's the correct term).
Also, reading from hou.Take.loadChildTakeFromFile(filename) help:
Note that you can only load files that have been saved from the same .hip file session. If Houdini is restarted or if the .hip file is closed and re-opened after the save then the file will fail to load.
This seems misleading or I don't understand it.
I was able to load a take saved with python in a new hip file, and in a different version of houdini (17 vs 16.5), given that the new hip file has the same structure.
Edited by Andr - 2019年2月1日 03:31:04
Technical Discussion » How could I split a geo using polysplit..?
- Andr
- 900 posts
- Offline
I guess u might want to use a boolean to do that?
check this example and see if it helps,
cheers
check this example and see if it helps,
cheers
Houdini Learning Materials » Looking for crystal creation video
- Andr
- 900 posts
- Offline
Houdini Indie and Apprentice » Chances of random number based on ramp
- Andr
- 900 posts
- Offline
There's the attribute randomize node that provides the “ramp distribution method”. But it's quite counter intuitive to use in my opinion.
Take these two attribute randomize nodes for example: these two ramps would output the same random values with the same chances, right?
Ideally I'd like to have a ramp distribution that works the other way round, where the X axis represents the random values it can output(0-1), and Y axis is the chance of these values to be picked.
So in the following example, my ideal ramp would output with high chances values close to 1. And zero chances for values less than 0.5
Do you have any idea how to accomplish it?
How to modulate a random generator with a function (a ramp)?
Take these two attribute randomize nodes for example: these two ramps would output the same random values with the same chances, right?
Ideally I'd like to have a ramp distribution that works the other way round, where the X axis represents the random values it can output(0-1), and Y axis is the chance of these values to be picked.
So in the following example, my ideal ramp would output with high chances values close to 1. And zero chances for values less than 0.5
Do you have any idea how to accomplish it?
How to modulate a random generator with a function (a ramp)?
Edited by Andr - 2019年1月29日 15:52:20
Houdini Indie and Apprentice » [py] Custom event profiling in HDA? [old title: Some questions about HDAs creation]
- Andr
- 900 posts
- Offline
Thanks a lot Thomas, I didn't realize the wedge node is actually a subnetwork.
Now I understand better the logic.
Regarding question 5, I've found that render() function is documented in the RopNode class help page.
Glad to know that there are no hidden commands
Now I understand better the logic.
Regarding question 5, I've found that render() function is documented in the RopNode class help page.
Glad to know that there are no hidden commands
Houdini Indie and Apprentice » What is $HDA_TABLE_AND_NAME meaning?
- Andr
- 900 posts
- Offline
Houdini Indie and Apprentice » [py] Custom event profiling in HDA? [old title: Some questions about HDAs creation]
- Andr
- 900 posts
- Offline
I was inspecting the wedge node, which has a Python Module that controls the asset and launch the render.
I have few questions:
Thanks for any help!
I copy paste the pyhton module of the Wedge Node, so you can have a look at the code I'm talking about.
Cheers
I have few questions:
- The functions inside the python module are not called by any parameter of the wedge. There's no callback script in any of the parms. I thought you should invoke the functions of the python module by using something like ‘hou.phm().myFunction()’
How are the functions in that python module invoked when you press the Render Wedges button? - Render Wadges button has a tag “takecontrol” set to “always”. What does it mean?
- In the python module I see a lot of ‘node.parm(“myparm”).eval()’, but I can't find anywhere the node object being defined with the classic ‘node = hou.pwd()’. Same for ‘rendernode’. How is that possible?
- Could you create an environment variable with python or you can only do it through hou.hscript()
- How does the wedge actually launch the output driver? I guess it's that ‘rendernode.render()’ in the last lines of the python module, right? Is this ‘render()’ function documented anywhere? I can't happen to find it under the hou.Node help page [www.sidefx.com]
Thanks for any help!
I copy paste the pyhton module of the Wedge Node, so you can have a look at the code I'm talking about.
Cheers
import random def setenvvariable(var, val): hou.hscript("set %s = %s" % (var, val)) hou.hscript("varchange") def createwedge(channame, englishname, min, max, steps): if englishname == "": # Extract the raw channel name # to use as our name if the user # provided none englishname = channame.rpartition("/")[2] result = [] for i in range(steps): if steps > 1: v = ((max - min) / (steps-1)) * i else: v = (max - min) / 2.0 v += min; prefix = "_%s_%f" % (englishname, v) result.append( (channame, prefix, v) ) return result def mergewedge(allwedge, wedge): result = [] for w in wedge: for a in allwedge[:]: a = a[:] a.append(w) result.append(a) return result def getwedgenames(node): wedges, stashedparms, errormsg = getwedges(node) names = [] for wedge in wedges: names.append(_calculatewedgename(node, wedge)) return names def _calculatewedgename(node, wedge_channels): wedge_name = node.parm("prefix").eval() for channel in wedge_channels: channel_prefix = channel[1] wedge_name += channel_prefix return wedge_name def applyspecificwedge(node, wl): wedgestring = _calculatewedgename(node, wl) for wedge in wl: (cname, prefix, val) = wedge parm = node.parm(cname) if parm is not None: # Check if the parm is integer. ptype = parm.parmTemplate().type() if ptype == hou.parmTemplateType.Int: val = int(val) if ptype == hou.parmTemplateType.Menu: val = int(val) if ptype == hou.parmTemplateType.Toggle: val = int(val) parm.set(val) # Set the wedge environment variable setenvvariable("WEDGE", wedgestring) def buildrandom(chanlist, namelist, rangelist): wedge = [] # A sure sign I should have passed a list of tuples... for (chan, englishname, r) in zip(chanlist, namelist, rangelist): (a, b) = r v = random.uniform(a, b) if englishname == "": # Extract the raw channel name # to use as our name if the user # provided none englishname = chan.rpartition("/")[2] prefix = "_%s_%f" % (englishname, v) wedge.append( (chan, prefix, v) ) return wedge def getwedges(node): numparam = node.parm("wedgeparams").eval() stashedparms = [] errormsg = "" if node.parm("wedgemethod").eval() == 0: if node.parm("random").eval() == 0: allwedge = [[]] for p in range(numparam): chan = node.parm("chan%d" % (p+1,)).eval() name = node.parm("name%d" % (p+1,)).eval() if chan != "": parm = node.parm(chan) if parm is None: errormsg += "Cannot find channel %s\n" % (chan, ) continue wedge = createwedge( chan, name, node.parm("range%dx" % (p+1,)).eval(), node.parm("range%dy" % (p+1,)).eval(), node.parm("steps%d" % (p+1,)).eval()) stashedparms.append((chan, parm.eval())) # more an outerproduct than a merge. allwedge = mergewedge(allwedge, wedge) else: allwedge = [] chanlist = [] namelist = [] rangelist = [] for p in range(numparam): chan = node.parm("chan%d" % (p+1,)).eval() name = node.parm("name%d" % (p+1,)).eval() if chan != "": parm = node.parm(chan) if parm is None: errormsg += "Cannot find channel %s\n" % (chan, ) continue chanlist.append(chan) namelist.append(name) rangelist.append( (node.parm("range%dx" % (p+1,)).eval(), node.parm("range%dy" % (p+1,)).eval()) ) stashedparms.append((chan, parm.eval())) random.seed(node.parm("seed").eval()) nsample = node.parm("numrandom").eval() for lvar in range(nsample): wedge = buildrandom(chanlist, namelist, rangelist) allwedge.append(wedge) else: # Must be by take. allwedge = [] rendernode = None if len(node.inputs()) > 0: rendernode = node.inputs()[0] if rendernode: renderpath = rendernode.path() if rendernode is None: renderpath = node.parm("driver").eval() rendernode = node.node(renderpath) basetake = node.parm("roottake").eval() (takelist, e) = hou.hscript("takels -i -q -p %s" % (basetake,)) takelist = takelist.strip() if takelist == "": errormsg += "No takes found as child of \"%s\".\n" % (basetake,) takelist = takelist.split("\n") chan = renderpath + "/take" stashedparms.append((chan, node.parm(chan).eval())) for take in takelist: allwedge.append( [(chan, "_" + take, take)] ) return allwedge, stashedparms, errormsg def applywedge(node): allwedge, stashedparms, errormsg = getwedges(node) rendernode = None if len(node.inputs()) > 0: rendernode = node.inputs()[0] if rendernode: renderpath = rendernode.path() if rendernode is None: renderpath = node.parm("driver").eval() rendernode = node.node(renderpath) if rendernode is None: errormsg += "Cannot find output driver %s\n" % (renderpath,) # Extract specified single wedge wedgenum = 0 if node.parm("wrange").eval() == 1: wedgenum = node.parm("wedgenum").eval() if wedgenum >= len(allwedge): errormsg += "Requested wedge %d greater than total wedges %d.\n" % (wedgenum, len(allwedge)) else: allwedge = [allwedge[wedgenum]] if errormsg != "": if hou.isUIAvailable(): hou.ui.displayMessage("Errors:\n" + errormsg) else: print "Errors: " + errormsg return # Disable background rendering fgparm = None if node.parm("blockbackground").eval() == 1: fgparm = rendernode.parm("soho_foreground") if fgparm is not None: oldfgval = fgparm.eval() fgparm.set(True) # apply individual wedge for wl in allwedge: setenvvariable("WEDGENUM", str(wedgenum)) applyspecificwedge(node, wl) rendernode.render() wedgenum = wedgenum + 1 # Restore background rendering if fgparm is not None: fgparm.set(oldfgval) # Restore our settings to pre-wedge states. for (chan, val) in stashedparms: parm = node.parm(chan) parm.set(val) # Clear out the environment setenvvariable("WEDGE", "")
Edited by Andr - 2019年2月21日 09:17:10
Houdini Indie and Apprentice » One minute silence for our Substance user friends
- Andr
- 900 posts
- Offline
-
- Quick Links