Jump to content

DonRomano

Members
  • Posts

    230
  • Joined

  • Last visited

  • Days Won

    7

DonRomano last won the day on April 28 2021

DonRomano had the most liked content!

2 Followers

About DonRomano

  • Birthday 03/06/1998

Personal Information

  • Name
    Romain
  • Location
    France

Recent Profile Visitors

1,686 profile views

DonRomano's Achievements

Newbie

Newbie (1/14)

  • Reacting Well Rare
  • First Post Rare
  • Collaborator Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

79

Reputation

  1. I am not sure of what you want to achieve, but here is a hint of how to print the clicked parameter name <?xml version="1.0" encoding="UTF-8"?> <menuDocument> <menu> <subMenu id="parmmenu.print_parm"> <insertBefore /> <label>Print Parm</label> <scriptCode><![CDATA[ parms = kwargs["parms"] for parm in parms: print(parm.name()) ]]> </scriptCode> </subMenu> <separatorItem> <insertAfter>parmmenu.print_parm</insertAfter> </separatorItem> </menu> </menuDocument> The "parms" keyword argument is a tuple containing the clicked parameters that triggered the menu (it is a tuple because in some cases there are multiple parameters for the same parameter on the interface, a translate has tx, ty and tz for exemple). If I understant what you mean by creating a copy of the parameter, you can copy its parm template and add it to the node which the clicked parm belongs to. Cheers,
  2. Yeah I know but I prefer the Od Theme in general, if we could have the code highlighting as before (or even choose different code highlighting themes) it would be perfect !
  3. Would it be possible to make the code highlighting integrated in messages like before (in terms of colors) ? The colors are not very well suited for a clear background (the green and orange especially), it is almost impossible to read (see this post for example if someone can read the code : Otherwise the theme looks very nice !! Cheers, and happy new year to everyone !
  4. They are located in the install directory of houdini, in the /bin sub-directory, you can navigate to it using the cmd like this cd "C:/Program Files/Side Effects Software/Houdini X.Y.Z/bin" hython // or "C:/Program Files/Side Effects Software/Houdini X.Y.Z/bin/hython" Or add the path to your binary directory to the user environment variable PATH and then it will "source" this directory and make the binaries available in any directory from the console. However I do not advise to do this, and instead make a little bat script that launches a console with Houdini binaries (such as hython) available, like this @echo off set PATH="C:/Program Files/Side Effects Software/Houdini X.Y.Z/bin";%PATH% start /d C:/Users/username cmd @echo on And then double click on this script and you're set
  5. 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,
  6. def check_parm_exists(parm_name, node): return node.parm(parm_name) is not None
  7. 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...")
  8. 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 ?
  9. 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
  10. 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)
  11. 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 !
  12. 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.
  13. 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,
  14. 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
  15. 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,
×
×
  • Create New...