Hi,
I'm trying to create a little VOP asset where I wanna put a bunch of VOPs, just like I'd do with a simple VOP subnet, but since its the same bunch of nodes I very often put together in every VOPsops of mine I thought I'd enclose them into a digital Asset.
the problem is that I seem not to be able to promote the parameters once I create a HDA from such subnet, is that supposed to happen?
anyone that can shed some light is very welcome! thanks
H12.1
Found 348 posts.
Search results Show results as topic list.
Technical Discussion » VOP sop HDAs
- VisualCortexLab
- 509 posts
- Offline
Technical Discussion » python script for DA menu items
- VisualCortexLab
- 509 posts
- Offline
of course!! makes perfectly sense.
thanks a lot
(head banging against my desk)
here's the corrected code for reference:
import os
projects = “/mypath/to/projects”
menuitem =
dirlist = os.listdir(projects)
for d in dirlist:
if not d.startswith(“.”):
if os.path.isdir(os.path.join(projects,d)):
menuitem.append(d)
menuitem.append(d)
menuitem.sort()
return menuitem
thanks a lot
(head banging against my desk)
here's the corrected code for reference:
import os
projects = “/mypath/to/projects”
menuitem =
dirlist = os.listdir(projects)
for d in dirlist:
if not d.startswith(“.”):
if os.path.isdir(os.path.join(projects,d)):
menuitem.append(d)
menuitem.append(d)
menuitem.sort()
return menuitem
Technical Discussion » python script for DA menu items
- VisualCortexLab
- 509 posts
- Offline
hi there,
I'm trying to create an asset for my scene which should retrieve directories names as a drop down menu, so in the DigitalAsset parameter options I chose “use menu” and then wrote the following in the menu script tab:
import os
projects = “/mypathto/projects”
menuitem =
dirlist = os.listdir(projects)
dirlist.sort()
for d in dirlist:
if not d.startswith(“.”):
if os.path.isdir(d):
menuitem.append(d)
return menuitem
but this code fails giving me the following error:
Error running Python menu script:
Python menu scripts must return an even number of strings.
this code works in a normal python shell returning me a list of items, the directories I'm expecting.
I tried to debug it line by line and if I instead write the following script:
import os
projects = “/mypathto/projects”
menuitem =
dirlist = os.listdir(projects)
dirlist.sort()
for d in dirlist:
menuitem.append(d)
return menuitem
I do have the dropdown giving me options, but they're not indexed properly. for example I select “directory1” from the menu but simply printing the variable name gives me “directory2”.. or another unrelated directory anyway… and of course I'm not filtering the list anyway as it returns the hidden dir (“.”) and files too, which I don't want.
anyone can help me on this?
thanks!
I'm trying to create an asset for my scene which should retrieve directories names as a drop down menu, so in the DigitalAsset parameter options I chose “use menu” and then wrote the following in the menu script tab:
import os
projects = “/mypathto/projects”
menuitem =
dirlist = os.listdir(projects)
dirlist.sort()
for d in dirlist:
if not d.startswith(“.”):
if os.path.isdir(d):
menuitem.append(d)
return menuitem
but this code fails giving me the following error:
Error running Python menu script:
Python menu scripts must return an even number of strings.
this code works in a normal python shell returning me a list of items, the directories I'm expecting.
I tried to debug it line by line and if I instead write the following script:
import os
projects = “/mypathto/projects”
menuitem =
dirlist = os.listdir(projects)
dirlist.sort()
for d in dirlist:
menuitem.append(d)
return menuitem
I do have the dropdown giving me options, but they're not indexed properly. for example I select “directory1” from the menu but simply printing the variable name gives me “directory2”.. or another unrelated directory anyway… and of course I'm not filtering the list anyway as it returns the hidden dir (“.”) and files too, which I don't want.
anyone can help me on this?
thanks!
Technical Discussion » Bullet solver and fieldForce
- VisualCortexLab
- 509 posts
- Offline
Hey Peter!
Thanks!
hmm yeah I guess I need to review my whole setup. I thought I could make it work with the field force but I might give it a go with the whole glue system I guess.
the example you posted is pretty much what I'm after, thanks for sharing!
Thanks!
hmm yeah I guess I need to review my whole setup. I thought I could make it work with the field force but I might give it a go with the whole glue system I guess.
the example you posted is pretty much what I'm after, thanks for sharing!
Technical Discussion » Bullet solver and fieldForce
- VisualCortexLab
- 509 posts
- Offline
Hi,
I'm trying to create an explosion where a “bomb detonate” inside a building causing all the windows to shatter and explode outward.
everything works fine when using the RigidBody Solver but when I use the Bullet solver it seems I can't get the window to hold together before the detonation frame occurs. the window shards explode immediately and then when the fieldforce get activated (using activation's expression) they get “pushed”, but at that stage they're already all over the place.
any hints of what I might be doing wrong?
thanks!
I'm trying to create an explosion where a “bomb detonate” inside a building causing all the windows to shatter and explode outward.
everything works fine when using the RigidBody Solver but when I use the Bullet solver it seems I can't get the window to hold together before the detonation frame occurs. the window shards explode immediately and then when the fieldforce get activated (using activation's expression) they get “pushed”, but at that stage they're already all over the place.
any hints of what I might be doing wrong?
thanks!
Technical Discussion » RBD state and glue per OBJ
- VisualCortexLab
- 509 posts
- Offline
heya, I'm trying to set internal glue strength on my shattered object and I'm having difficulties.
scenario: frame 10 and only at frame 10 I have a fieldforce that “kicks” my shattered window.
if I don't use the RBD state my window gets shattered as normal, entirely.
what I want is having the border of my glass to stick with the window, and I thought about using the RBD state and set a “glue” attrib in SOP.
I'm using the
prim(“$DOPNET:$OBJID/Geometry”, 0, “glue”, 0)
expression in my RBD state DOP … but when I use such node I have a weird behavior: at frame 10 the window get shattered and objects move, but then at frame 11 they all go back to their initial position.
I also get a “bad reference” warning, so I'm guessing the expression is wrong.
I can try and provide a sample scene if needed.
any help is really appreciated!
thankie.
scenario: frame 10 and only at frame 10 I have a fieldforce that “kicks” my shattered window.
if I don't use the RBD state my window gets shattered as normal, entirely.
what I want is having the border of my glass to stick with the window, and I thought about using the RBD state and set a “glue” attrib in SOP.
I'm using the
prim(“$DOPNET:$OBJID/Geometry”, 0, “glue”, 0)
expression in my RBD state DOP … but when I use such node I have a weird behavior: at frame 10 the window get shattered and objects move, but then at frame 11 they all go back to their initial position.
I also get a “bad reference” warning, so I'm guessing the expression is wrong.
I can try and provide a sample scene if needed.
any help is really appreciated!
thankie.
Technical Discussion » Intersection between geometry objects
- VisualCortexLab
- 509 posts
- Offline
Jeff posted a pretty nice tutorial a while ago that might help you:
http://www.sidefx.com/index.php?option=com_content&task=view&id=1815&Itemid=216 [sidefx.com]
hope that helps.
http://www.sidefx.com/index.php?option=com_content&task=view&id=1815&Itemid=216 [sidefx.com]
hope that helps.
Technical Discussion » Accidentally Cooking with the Houdini Object Module
- VisualCortexLab
- 509 posts
- Offline
what I do is having a bash (or which ever shell you use, assuming you're under Linux/Osx) script/alias that runs houdini with the “-n” flag.
that will always load a Houdini session in Manual update mode without any cooking.
that will always load a Houdini session in Manual update mode without any cooking.
Technical Discussion » Ridiculous GUI issue
- VisualCortexLab
- 509 posts
- Offline
Houdini Lounge » Facilities using Mantra
- VisualCortexLab
- 509 posts
- Offline
carlov
http://www.axisanimation.com/ [axisanimation.com]
Check out the work we're doing for Halo 4
All rendered in Mantra
wow!
Houdini Learning Materials » Incorrect scene files in "M07 - Mantra Render Engines&q
- VisualCortexLab
- 509 posts
- Offline
it seems like the video also has problems? cut at 39:50 whilst Ari is still talking, weird or is just me?
Houdini Lounge » Docs 12.1 down?
- VisualCortexLab
- 509 posts
- Offline
..actually it seems all versions of the docs are down … except for Hqueue… any news from sesi?
Technical Discussion » Python Question
- VisualCortexLab
- 509 posts
- 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.
Technical Discussion » get current viewport name
- VisualCortexLab
- 509 posts
- Offline
sum][one
toolutils.sceneViewer().pwd()
seems to give me a result closer to what I'd need …
but I'm still open to suggestions
thankie!
scrap that. it does give me some output, but somehow is not related to what's in the network I'm using .. changing context of such pane doesn't change the output of that code..
i'm stuck again
Technical Discussion » get current viewport name
- VisualCortexLab
- 509 posts
- Offline
toolutils.sceneViewer().pwd()
seems to give me a result closer to what I'd need …
but I'm still open to suggestions
thankie!
Technical Discussion » get current viewport name
- VisualCortexLab
- 509 posts
- Offline
heya,
I'm working on a simple script here that would be a shelf tool.
I'm trying to figure out what type of node I'm supposed to grab from, let's say, the $HOUDINI_TEMP_DIR copied buffer.
I tried different approaches, all of which sort of failed eventually and now I'm into this one, getting the active pane and go from there.
problem is that if I create a shelf tool with the following code:
import toolutils
activepane = toolutils.activePane(kwargs)
name = activepane.name()
print name
If I have the script window opened I always get
<hou.Pane 5>
when if I close it (and have no floating panes) I get
panetab1
… no matter where my mouse has clicked last.. what am I doing wrong?
how can I get the network pane of the last mouse click?
(or what could be another approach)
Thanks!
I'm working on a simple script here that would be a shelf tool.
I'm trying to figure out what type of node I'm supposed to grab from, let's say, the $HOUDINI_TEMP_DIR copied buffer.
I tried different approaches, all of which sort of failed eventually and now I'm into this one, getting the active pane and go from there.
problem is that if I create a shelf tool with the following code:
import toolutils
activepane = toolutils.activePane(kwargs)
name = activepane.name()
print name
If I have the script window opened I always get
<hou.Pane 5>
when if I close it (and have no floating panes) I get
panetab1
… no matter where my mouse has clicked last.. what am I doing wrong?
how can I get the network pane of the last mouse click?
(or what could be another approach)
Thanks!
Technical Discussion » python script on Created
- VisualCortexLab
- 509 posts
- Offline
graham
No. The parent has to create the node as a child, so pwd() will return it. You get the newly created node using kwargs
node = kwargs
node.setColor(hou.Color((1,0,0)))
ahh that's it! thanks a lot! exactly what I needed
I remember reading about that kwargs but I guess I need to investigate further more on that one.
thanks!
Technical Discussion » python script on Created
- VisualCortexLab
- 509 posts
- Offline
yep, houdini creates such sections when I select any of those..
and yeah sorry.. correct names are “OnLoaded” or “OnCreated” .. and set to python.
it seems I've found the problem.
in fact the code is working.. but its coloring “its parent” ..
if I run the following code:
node = hou.pwd()
color = hou.Color()
color.setRGB((0.4,0.2,0.6))
node.setColor(color)
in a SOP hda->OnCreated script, the containing OBJ will get such color.
isn't hou.pwd() supposed to be the SOPhda itself?
thanks!
and yeah sorry.. correct names are “OnLoaded” or “OnCreated” .. and set to python.
it seems I've found the problem.
in fact the code is working.. but its coloring “its parent” ..
if I run the following code:
node = hou.pwd()
color = hou.Color()
color.setRGB((0.4,0.2,0.6))
node.setColor(color)
in a SOP hda->OnCreated script, the containing OBJ will get such color.
isn't hou.pwd() supposed to be the SOPhda itself?
thanks!
Technical Discussion » python script on Created
- VisualCortexLab
- 509 posts
- Offline
I'm using the HDA type properties->scripts->event handler page to write code into, not an external py file.
Technical Discussion » python script on Created
- VisualCortexLab
- 509 posts
- Offline
Hi all,
I'm having trouble finding a way to make my HDA to run some code when I create a new instance of the tool..
I tried the onLoaded and onCreated but it seems they get ignored.
I also tried the tools/script … but it didn't work either.
I'm trying to change the asset's color in this case and I'd like to do it using python.
thanks in advance!
I'm having trouble finding a way to make my HDA to run some code when I create a new instance of the tool..
I tried the onLoaded and onCreated but it seems they get ignored.
I also tried the tools/script … but it didn't work either.
I'm trying to change the asset's color in this case and I'd like to do it using python.
thanks in advance!
-
- Quick Links