Jump to content
[[Template core/front/profile/profileHeader is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

DonRomano last won the day on April 28 2021

DonRomano had the most liked content!

Community Reputation

76 Excellent


About DonRomano

  • Rank
  • Birthday 03/06/1998

Personal Information

  • Name
  • Location

Recent Profile Visitors

1,586 profile views
  1. best flipbook tool from Shelf

    Well, I know that there is a menu called MainMenuMPlay.xml where you can append elements (such as python scripts) and execute them in MPlay, that way you could modify what I sent and use a mplay hscript command to save images. I don't have a lot of time today to test, maybe next week ! Cheers,
  2. Use python to check if a parameter exists

    def check_parm_exists(parm_name, node): return node.parm(parm_name) is not None
  3. best flipbook tool from Shelf

    I can give you hints on how to start this : import roptoolutils, os, hou, subprocess # Getting default start and end frame start_frame, end_frame = hou.playbar.frameRange() # Gathering values input from the user button_idx, values = hou.ui.readMultiInput( "Set the flipbook options", ("Start Frame", "End Frame", "Width", "Height", "Convert To Video"), initial_contents=(str(int(start_frame)), str(int(end_frame)), "1920", "1080", "Yes"), title="Flipbook Options", buttons=("OK", "Cancel"), default_choice=0, close_choice=1, ) # If the user clicks ok if button_idx != 1: new_start_frame = int(values[0]) new_end_frame = int(values[1]) new_width = int(values[2]) new_height = int(values[3]) convert_to_video = True if (values[4] == "Yes") else False # Creating an opengl rop ogl_rop = roptoolutils.createRenderNode("opengl") # optional, if a camera node is selected, set the output camera to be the selected one selected_nodes = hou.selectedNodes() if len(selected_nodes) > 0: n = selected_nodes[0] if n.type().name() == "cam": ogl_rop.parm("camera").set(n.path()) # Setting a bunch of parms ogl_rop.parm("trange").set(1) ogl_rop.parm("f1").set(new_start_frame) ogl_rop.parm("f2").set(new_end_frame) ogl_rop.parm("tres").set(1) ogl_rop.parm("res1").set(new_width) ogl_rop.parm("res2").set(new_height) # Creating the output directory, increments if it already exists version = 1 output_dir = "{}/flipbook/{}".format(hou.getenv("HIP"), "{}".format(version).zfill(3)) while os.path.exists(output_dir): version += 1 output_dir = "{}/flipbook/{}".format(hou.getenv("HIP"), "{}".format(version).zfill(3)) os.makedirs(output_dir) # Setting the output path of the images output_path = "{}/flipbook_img.$F.png".format(output_dir) ogl_rop.parm("picture").set(output_path) # Launch the ogl rop render print("Launching opengl render...") ogl_rop.parm("execute").pressButton() # Conversion to video with ffmpeg, assuming ffmpeg is in the PATH if convert_to_video: print("Converting to video using ffmpeg...") subprocess.check_output(["ffmpeg", "-i", output_path.replace("$F", "%d"), "{}/flipbook_video.mp4".format(output_dir)]) else: print("Flipbook cancelled...")
  4. Hey guys, I try to modify a few items in the OPmenu (the menu triggered when right-clicking on nodes). I want to modify the expressions that enable certain items, for example disabling the Type Properties... for specific nodes. Following the documentation, I came up with the following xml file that is in a directory in the HOUDINIPATH <?xml version="1.0" encoding="UTF-8"?> <menuDocument> <menu> <modifyItem id="opmenu.properties"> <context> <expression><![CDATA[ # some example python code to evaluate an expression expression = node.type().name() == "custom_nodetype_name" return expression ]]></expression> </context> </modifyItem> </menu> </menuDocument> And Houdini returns an error when firing the menu, telling it cannot find element "opmenu.properties". I tried with other items I've found in the "internal" OPmenu.xml file, and I keep having the same error. Anyone has any hints on this ?
  5. Point Deformer

    You just need to use a "Add" node with the position in the first input and your attribute in the second input, that you can bring in vops using a "Bind" node and specify the attribute name
  6. Flip Particles dying and volume reducing

    You can try adjusting the particles separation under the particles motion tab, it might help reduce the volume loss a bit (and a tiny amount of viscosity can help too)
  7. There you go for maths and algorithms : - https://www.amazon.com/Introduction-Algorithms-Leiserson-Charles-Clifford/dp/B0839JW93F - https://www.amazon.com/Mathematics-Computer-Graphics-Undergraduate-Science/dp/1447173341 You can have a look at gpu gems from nvidia (edition 1 is there : https://www.nvidia.com/en-us/drivers/gpu-gems-home/), there are out of date but there are some very nice algorithms and techniques you can try to implement in Houdini to practice. Cheers and good luck in your learning path !
  8. The vector() is just a cast, i.e in this case helping the compiler get the right function overload : because rand has multiple overloads as it can return either a float, a vector2..., so it helps the compiler finding which overload I need, here the vector one, and same for the set() function (as it has overloads for vector2, arrays, matrices...). I remap the random vector because the rand() function always return random numbers in the range 0.0,1.0 and you want to have a more random position by having either a positive or negative jitter to add, it's better because if you only add positive random numbers to your position, it will end up going in the same direction. I've made a one liner for the randToAdd but it can be decomposed in that way to help understand what it does : while(lenNpts > 0): vector random = vector(rand(seed)); // create a random vector in the range (0.0f, 1.0f); ex {0.34f, 0.85f, 0.14f} vector min = set(-1.0f); // set a minimum vector; similar to {-1.0f, -1.0f, -1.0f} vector max = set(1.0f); // set a maximum vector; similar to {1.0f, 1.0f, 1.0f} vector randToAdd = fit01(random, min, max); // remap our random vector to the min and max range pTemp = pTemp + randToAdd; // add our new remaped random vector to the position The best I could recommand is learning algorithms and data structures, I have a few books that helped me on this side, but you might find this channel useful : https://www.youtube.com/c/JunichiroHorikawa The language is just a tool (here vex, the same can be done with python, just slower), the most important is the algorithms you use and design, and the more you know the more tools you'll have to solve problems.
  9. I'm not sure that this is the right method to achieve what you want. First, you have an infinite loop (and I believe the vex compiler detects it and erases it from the code, that might be why it does nothing). Second, you never check the nearpoints again, and moreover, nearpoints can return the current point too, so you should be careful with that. Third, your @ptemp will always be in the range (0.0f, 1.0f) because you set it to be a random number, and not your initial position plus some random value on each axis. You might want to write something like this : vector pTemp = v@P; int npts[] = nearpoints(0, pTemp, f@pscale); int lenNpts = len(npts); int seed = 0; while(lenNpts > 0): vector randToAdd = fit01(vector(rand(seed)), vector(set(-1.0f)), vector(set(1.0f))); pTemp = pTemp + randToAdd; npts = nearpoints(0, pTemp, f@pscale); lenNpts = len(npts); seed++; v@P = pTemp; Hope this can help. Cheers,
  10. You can use a vdb surface attribute with the vertex.uv attribute, and advect it along your displacement, and then use an attribute from volume node to pass the displaced uvs to the polygon geometry. Note this won't be very precise depending on your displacement, new surfaces might have been created during the process, so a little attribute blur or a higher volume resolution might help. I've attached a simple example to show how it can be achieved. Cheers, vdbs_displacement_uvs.hipnc
  11. procedural image render in network view?

    This python class might be what you are looking for : https://www.sidefx.com/docs/houdini/hom/hou/GeometryViewportBackground.html There are methods to load an image from cops or disk, reposition it... Cheers,
  12. Hello everyone, I'm using hython to run a bunch of files on remote computers and sometimes the network shuts down for a few seconds, causing the "job" to be suspended undefinitely, the only solution being killing the process. Then in the stdout I have this message appearing : Cannot access the OTL source: //Path/To/Some/file.hda for operator type: somehda “Save & Quit” will save the hip file and quit the session “Discard & Quit” will quit the session without saving the hip file “Retry” will attempt again to refresh the OTL definition from the same file location “Embed” will try to use an alternative definition among already loaded OTLs, and if no suitable definition is found, it will create a hollow, embedded fallback OTL which allows you to continue working with the hip file “Refresh OTLs” will reload OTLs found in the search path and try to use them for the operator definition “Load OTL” will present a file chooser to specify an explicit OTL location where the operator definition can be found 0: “Save & Quit” 1: “Discard & Quit” 2: Retry 3: Embed 4: “Refresh OTLs” 5: “Load OTL” Anyone knows if there is a way to force hython to one option ? It's a bit annoying...
  13. Grains orientation is flipping

    Check this out it should help you : Cheers,
  14. In a wrangle : // Get a random float between 0.0 and 1.0, and add a seed to test and randomize per frame, or however you'd like float randomFloat = rand(@primnum + 8439 + chi("seed")); // Create a ramp (that you'll need to edit to rgb ramp in the interface parameters) and map the random float to it // then output the random color mapped on the ramp to the Cd attribute @Cd = chramp("color_ramp", randomFloat);
  15. Hello everyone, Is it possible to add a callback that runs everytime a node is created ? At my studio we have a library of hda (hundreds of nodes) and I'd like to check if the node comes from the general library, or the project library and simply set a color depending on its definition path. I tried scripts/OnCreated.py with a package and appending the path to the Houdini path but nothing is happening. I also thought appending a few lines of code using nodeDefinition.sections()["OnCreated"].setContents("print('Hello')") but doing this for hundreds of hda's, and everytime one is created, requires a bit more work than what I can do for now. Is there a solution ? I've looked at ui event but I haven't found anything interesting. Cheers,