Search the Community
Showing results for tags 'hscript'.
-
Hi everyone ! I made an example .hip file below if you need ! I have a vellum patch and I want to drape it. I can select the groups in the old fashion way by selecting the needed groups one by one in the Vellum Drape node. But when it goes to very large pieces of vellum, it can be very laborious. My question is: Is there a way to select to tell the Vellum Drape, "select all the groups between backPatch_seam0 group to backPatch_seam2" ? I can share what I found until now though ! We can write this in the Vellum Drape node: "backPatch_seam[012]" and it selects the groups with the indicated suffixes between "[]". But as you can imagine, it doesn't work if the seams you want to select are numbers like 13 ; 78 ; etc... because this expression understand only the digits in these numbers (13 becomes 1 & 3 ; 78 becomes 7 & 8). Is there a better method to accomplish that ? Here is a .hip file if you want to try: Select A range of groups.hip
-
New Houdini class on Attributes. Enroll now: https://www.houdini.school/courses/hs-118-attributes Teaser: https://vimeo.com/714350608 Attributes are the heart and soul of Houdini. So many beginners and even intermediate users stumble over the importance of knowing the in and outs of Attributes. Understanding this topic is vital to getting the most out of Houdini itself. My goal is to give you a much deeper understanding of Attributes, so I have broken down this class into smaller topics. This way I can take you step by step from the core geometry component foundations, to common workflows, as well as reading & writing attributes from scratch. I'll also take you through examples of actual attribute implementations relating to RBD, FLIP, VELLUM, Crowd sim, and show some Viewport GL attributes. In session 1 you will be shown the core geometry components and how they relate to attributes. You'll also be given some clarity on confusing terminology, plus learn what attribute classes, and types you have available. Also covered will be a full explanation of the Geometry Spreadsheet, plus some tips on how you can sort through all of the data that it presents. I'll run you through what intrinsics are, how they can be accessed, and also explain what attributes are NOT, which is just as important as knowing what they are. In session 2 I will teach you the many different ways that attributes can be created, plus the the ways you can read those attributes back into your node streams. I will also take you through the world of Attributes versus variables, global versus local, and explain the reasoning and history of dollar sign versus the at symbol. In session 3, I'll focus solely on attribute usage in a variety of simulation setups. Showing you some implementation methods for simulation attributes. Houdini comes packed with a lot of native attributes already built in. I've gone ahead and collected together a massive list of well over 8,000 of them for you in PDF form. This course is aimed at getting beginners up and running with Attributes, but I will be taking you into intermediate territory fairly quickly as it's required to get a full understanding of Attributes. There WILL be discussions of VOPs, VEX, HScript, and Python in the second session. Don't worry though, because I will also be showing you many of the native SOP attribute nodes which simplify many common tasks for non-coders. I've packed a lot of information into this class, so even if you are an intermediate user to begin with, there is still plenty of good info for you as well. For more info and to enroll, head over to Houdini.School today.
-
float value = chramp("ramp",fit11(sin(@Time),0,1))*chf("amp"); this is what i would do in vex but i need to use it as a value for a node parameter. Is this possible in hscript? i tried creating a string multiline vex parameter in the parameter interface and write this { float value = chramp("ramp",fit11(sin(@Time),0,1))*chf("amp"); return value; } then reference the result inside the parameter like chf("vex") or chs("vex") ? none of those would work ofcourse but i dont know what else to try Any tips?
-
i remeber there is a way to pass the name of the node to the parm so they can use it. that way later on i can just copy/paste the node multiple times and the strings will update acordingly. example, if the name of my node is call my_node_1 i want the parm to be able to have a string as my_group`my_node_1` so when i copy paste my_node_1 will be my_node_2 and i want that to update the string of the parm, to show reflected my_group`my_node_2` thanks. guys.
-
hello! I am trying to get a python Variable to be brought into Houdini under the "alias and Variables" windows. I was wondering if anyone else has solve this issue and would be able to assist [ cusompaths = test hou.hscript("setenv = $custompaths") hou.hscript("varchange $custompaths") ][/code] thanks josh
-
Hi guys, Just a quick question I hope have a simple answer! I have a dual boot setup and switch back and forth between Win and Linux. Due to files having to point to same location I have a variable in the .env that point to each respective mounting place $NAS. Now, I imported an FBX through the File menu and it pops in as expected, but all the nodes have the full path in them. With the Textport I can do the "opchange" operation to switch the mounting place to the variable - but when I do that it converts the variable to it's value (the original path). My question now is: Can I somehow do the opchange without the Textport converting the variable to it's value and simply make it put the variable there instead of the path? I hope my rambling is not too confusing. Thanks a bunch, Jack
-
Hi all; I seem to be having a strange issue where I create a button on a null that is suppose to be a control system for a paint node; however, the button does not select the paint node. I have tried to use callback scripts by using a function like hou.cd("../path to the node") however I'm not getting any results and the button is not activating I'm not sure what is happening?. I appreciate all help anyone has to offer & I'm going to link the file that is isolating the issue underneath if anyone would like to take a look at it thanks. Kind Regards Rusty.M A simplified HIP file version of the same issue: cd_Button.hipnc
-
How do you opunhide all nodes in a particular category or a bunch of specific nodes using python? I wish to add this in my startup script. a simple hou.hscriptExpression("opunhide Sop point") dosent seem to work. Nor does hou.hscript(). What am i doing wrong?
-
Hi guys, I am trying to automate my alembic imports by using a string replace on my File path. For example: on my alembic File Name parameter I've written the expression - `strreplace($HIP, "home/fx", "fx/waterfountain_v001")`.abc I would like to be able to replace the version number with a wildcard so that it picks up the file regardless of what the version number is, but an (*)asterisk doesn't work. How should that be scripted? Thank you in advance!
-
https://www.sidefx.com/forum/topic/52186/ Oct. 19, 2017 4:14 P.M. Is it not possible to enable the lock view to camera button via python/hscript? experimenting w/python on this in Apprentice 16.5.634 (_old_ PC) and running into issue(s) https://www.sidefx.com/docs/houdini/hom/hou/GeometryViewport.html ... showed me several things which DO seem to work using the following syntax : import hou, toolutils myCam = hou.node('/obj/').createNode('cam', 'myCam') hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().setCamera(myCam) # hou.hscript('viewhome -s *.*.world.persp1') hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().homeAll() hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().saveViewToCamera(myCam) # ... HOWEVER, when I try something similar, I just get an Error on : >>> hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().lockCameraToView() Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'GeometryViewport' object has no attribute 'lockCameraToView' # ... and I have Not found any way to do this using hscript either. Anyone have advice on this?
-
Does anyone know if its possible to make the HScript fit expression work so that the mapping from newmin to newmax is not linear, but rather curve like? Ideally I'm trying to make the progression from newmin to newmax be more S-like than a straight linear relationship. https://www.sidefx.com/docs/houdini/expressions/fit.html
-
Where can i find every available global variable?? specifically i am looking for the number of points, i think its something like $NPT but i would like to have a list of every global variable so that i can search. its really difficult to find it, i only managed to find some about frames etc but nothing more. A link would be much appreciated
-
Hello, I am able to select visible geometry manually, or even make a script to toggle the option to select geometry manually. But I'm wondering if there is a way to automatically select visible geometry only via a script? I have been unable to figure it out but it would be awesome if possible (may not be possible though?). Thanks! Ant
-
Hi, my custom script is very simple : start the vexprofile , cook the snippet that holds my vex , stop the vexprofiler and show me the results. If i copy paste every line into the texport myself the code works. Howerver if I import the .cmd file holding the same three lines it shows me a empty vexprofiler. Doesn't importing .cmd files equal to writing them your self? If not is there something else that has this functionality? Why isn't this working? vexprofile start opcook -F /obj/L_System_v2/L-system/attribvop1/snippet1 vexprofile
- 1 reply
-
- hscript
- vexprofile
-
(and 2 more)
Tagged with:
-
Hi, I'm playing around with limiting transform handles on nulls to act as a rigging control surface. I found on these forums a cool hscript snippet that allows this: clamp(cubic(),min,max). Does anyone know the python equivalent? The python clamp doesn't seem to accept a cubic() as a parameter. Also, does anyone know of another method of allowing for manual transform handle input that feeds into an expression? (HScript or Python). I can't wrap my head around why cubic() works! Cheers Dan
-
Hello, I hope somebody can help me out as I have run into a problem when linking ramps via script that I have been unable to solve for more than a week now. What I would like to achieve is exactly the same effect that using "Copy Parameter" / "Paste Relative References" does when doing this from the user interface. I tried both python and hscript. The problem is that once the ramps are linked, when I add new control points to the parent, the child gets the control points but doesn't get the positions (ramp#pos) and values (ramp#value). In python I simply tried to set one float ramp parm to the other like this: hou.parm("/obj/node_B/ramp_B").set(hou.parm("/obj/node_A/ramp_A")) This seemed like the most simple and straightforward way of doing this but it failed so I reported it to the SideFX guys and they confirmed that python is not feature-complete for linking ramps with the .set() command - first they logged it as Bug #97192 then it was reconsidered to be an RFE with the same ID. After this SideFX suggested to use hscript opmultiparm which I proceeded to do but the ramp linking failed this time too. I am fairly confident using python but not so much with hscript so I am hoping it's my inability to use hscript properly this time rather than another bug - this is what I did: opmultiparm /obj/node_B/ 'ramp_B#pos' '/obj/node_A/ramp_A#pos' 'ramp_B#value' '/obj/node_A/ramp_A#value' 'ramp_B#interp' '/obj/node_A/ramp_A#interp' What I noticed in the "Edit Parameters" interface is if I manually type in the path to link the ramps then it does work the same as "Copy Parameter" / "Paste Relative References" - see below. I wonder if this field is exposed to python or hscript somewhere and maybe I should try to set this? Other than the above I also used both opscript and .asCode() after setting up the ramps links manually to see if it gives me the proper code and even if I run the code I get back from these the ramp linking still fails. Has anybody ever found a reliable solution for linking ramps in script? Anybody got any ideas where to go from here?:) EDIT: I found the solution on the SideFX forum by user jsmack in this post: https://www.sidefx.com/forum/topic/59899
-
Hey guys, How can I change the path in mantra Output file from: P:/projectname/shotname/fx/work/houdini/hip to: V:/projectname/shotname/fx/geo can`t figure out how to run strreplace twice. this doesn`t work: `strreplace($HIP, P:, V:)` `strreplace($HIP, work/houdini/hip, geo)` $HIP is P:/projectname/shotname/fx/work/houdini/hip also + is to add to the path, how can i subtract from the path? Cheers Janis
- 1 reply
-
- expressions
- hscript
-
(and 2 more)
Tagged with:
-
So I'm making a HDA wich has a color sop inside of it, of wich Im using the group field, thats why I need to acces this field at the upper level (the HDA interface). So to to do this, when building the HDA interface I dragged that field directly from the color sop to the HDA interface, (pic1/3)but when I try to use it from the HDA it throws this error (pic2), wich I guess is referencing this code inside the group's script (pic4). I've never messed around with this kind of stuff, how can I solve this?
-
I have a parameter in my node that I want to convert to use python, usually we can right click> expression >change language to python but for some reason is gray out =( and reading documentation I could do parm.setExpression("2+2". language=Something) but I thought using hou.lenguage.Python as argument but wants a value? do we have something like parm.setScriptLenguage? or an easy way to switch all the node to use python, or just that parameter?
-
Hi all, Is there any equivalent to nprimsgroup in python? I use this hscript expression in a switch, inside a for each SOP, to delete any prims connected to the outside group of a voronoi fracture: if( nprimsgroup( 0,"outside" ) !=0, 1, 0 ) Wondered what the python equivalent would be, because the Python SOP I wrote in its place is much slower to evaluate.
-
Hi guys. Quick question.. why is this not working as a position to create a point in an Add node? centroid(`opinputpath(".",0)`,D_X) same for Y and Z Cheers
- 2 replies
-
- opinputpath
- add
-
(and 2 more)
Tagged with:
-
Hello all, So ive been customing the Houdini env variables within the Houdini docs folder. All working correctly with my job and hip file paths set as I wish. I was wondering is it possible to reference a system environment variable within the Houdini env variables script? (So set a environment variable called HOME to a certain path in the systems env variables) (Then call HOME within the Houdini env variables to set JOB or whatever). Any guidance or help appreciated as always Thanks C.
- 2 replies
-
- environment
- variables
-
(and 2 more)
Tagged with:
-
I can set handle position and orientation with omparm hscript command. But is it possible to get position\orientation of handle?
-
I'm in the middle of making an otl for our artists and was wondering if there is a way to switch Houdini's viewport panes between Scene View and Composite View. I haven't found the proper help files for manipulating Houdini's layout through scripting. Thanks Mike