Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


vtrvtr last won the day on October 19 2019

vtrvtr had the most liked content!


Personal Information

  • Name
  • Location

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

vtrvtr's Achievements


Newbie (1/14)



  1. First, it's a very good idea to include your .hip file when you're having trouble. Second, your setup should work. You might be suffering from the oldest bug in Houdini: the viewport not updating. Usually closing the Scene Viewer and opening again fixes it. Here's a hip, just for demo. random_colors_odf.hip
  2. It is possible to have nodeless state. See here: https://www.sidefx.com/docs/houdini/hom/state_nodeless.html The example is a little wrong. Below is an actual working version. You can paste this on a shelf tool. import hou class ScrubState(object): def __init__(self, scene_viewer, state_name): self.state_name = state_name self.scene_viewer = scene_viewer self._base_x = self._base_frame = None def onGenerate(self, kwargs): self.scene_viewer.setPromptMessage( "Drag left/right to scrub along timeline" ) def onExit(self, kwargs): self.scene_viewer.clearPromptMessage() def _scrub_abs(self, x): # Take the absolute position of the mouse pointer (as a percentage # of the total viewer width) and move that far along the current # frame range width, _ = self.scene_viewer.contentSize() pct = x / float(width) start_frame, end_frame = hou.playbar.frameRange() frame = int((end_frame - start_frame) * pct + start_frame) hou.setFrame(frame) def _scrub_rel(self, x): # Use the difference between the mouse pointer's current position # and the previous position to calculate how many frames to move # forward/back if self._base_x is not None: delta = int((x - self._base_x) / 10.0) frame = max(0, self._base_frame + delta) hou.setFrame(frame) else: self._base_x = x self._base_frame = hou.intFrame() def onMouseEvent(self, kwargs): device = kwargs["ui_event"].device() if device.isLeftButton(): x = device.mouseX() if kwargs["mode"] == "abs": self._scrub_abs(x) elif kwargs["mode"] == "rel": self._scrub_rel(x) else: self._base_x = None template = hou.ViewerStateTemplate("scrub", "Scrub", hou.objNodeTypeCategory()) template.bindFactory(ScrubState) menu = hou.ViewerStateMenu("scrub", "Scrub") menu.addRadioStrip("mode", "Mode", "rel") menu.addRadioStripItem("mode", "rel", "Relative") menu.addRadioStripItem("mode", "abs", "Absolute") template.bindMenu(menu) try: hou.ui.registerViewerState(template) except: pass scene_viewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer) scene_viewer.setCurrentState("scrub") As for the other questions, it's not really something that can be explained in a single comment. But the documentation, which as you can see, isn't the best, is there. For example, the mouse event is here https://www.sidefx.com/docs/houdini/hom/hou/UIEventDevice.html
  3. Here's an example of the workflow. Another one is virtually any RBD workflow, transferring transformations from low to high poly geo is very common in that domain. Basically all you need is consistent names, so the same would work if you instead would like to instance geometry from disk. high_res_pieces_odf.hip
  4. Here are some comparisons: Volume source collision: Incorrect Static object collision: Correct Static object collision: As you can see the static object and the volume source are the same, as they should be since they do the same thing. Note that the I didn't have a collisionvel field, which can make the difference depending on the situation. The "incorrect" static is "incorrect" because you're putting a vdb in the sop path parameter, but the solver is recreating this vdb every frame, which is likely not what you want. To fix is you need to put the path the vdb in the Proxy Volume parameter and change the mode to "volume sample". Here is the hip file pyro_col_ODF.hip
  5. If you're asking "is there a button that does this?", then the answer is almost. If you're asking, "can I do this?", then the answer is yes. There's no button, but in the color editor you can load an image and pick colors from it, so you can do a gradient based on the image in a few clicks. If you want to do it in one click, it's relative simple to sample image colors. You can take inspiration (or use it directly) something like this https://github.com/fengsp/color-thief-py
  6. You modify some "value" in some "data", for example the "divsize" value in the "vel" data.
  7. It is, but not most common way to do things. Imagine instead of two things you want to randomize 10, now you have a monstrous network. You can use the Switch SOP and use either python or hscript to randomize the input. As you might imagine, the more inputs you have, the harder this becomes. Example file below. Usually what people do in situations like yours is save the set dressing to disk and just randomizing the loading path. People usually avoid the fully dynamic approach because it's common for fully randomized pieces to simply not fit together well. If you want the fully dynamic approach you might want to create different assets from your attachable geometry. Another approach that might lead to better organization is to use a Object Merge SOP and randomize just the path to the output of whatever network is generating the set dressing. randomize_network_path_odf.hip
  8. What you think about saving camera settings for all items? That way you don't need to worry about exceptions and everything is standardized. The extra data will also be negligible. Of course, that supposes you can know which camera to use before saving the models. If you can't, then you have no choice than doing it manually later.
  9. That doesn't work everywhere. It works in `group` type parameters or the polyextrude node (if you set it up in the UI), for example. It doesn't work in many other parameters. For consistency sake you're better sticking with the `point(...)` syntax or the Python equivalent. That will work in virtually all cases. Oh, yes, you might be confusing it with the new PDG stuff that lets you do `@attribute` if you set it up in TOPs. That also works in most places.
  10. You can try forcing the cook of a node with `node.cook(force=True)`. But usually you would make a button that would let the user randomize whatever on demand. You can also take a look at PDG to make a graph that constructs your assets.
  11. You should use a render manager of some kind, Tractor, Deadline, Hqueue etc. Many of them have functionality like this. The way you're doing it is a bit troublesome. Where are you running this from? If it's from Houdini for obvious reasons it won't work since the program will have crashed. If it's from some other shell, how will you get the correct pid? Also, Python is cool so it will work, but your morphing function definition isn't very usual. Usually you would take care of the OS difference inside the function (or have two different functions).
  12. `chs...` is a hscript syntax. It's better to use full python if you're going to use python. Something like import random controller_node = hou.pwd().parent().node("controller") windows_parm = controller_node.parm("nOfVertWin") windows_parm.set(random.randint(0, 5)) This would randomize between 0 and 5.
  13. Not completely sure I understand, but maybe something like this. pcfind_normals_ODF.hip
  14. This screenshot isn't from frame 0, right? You have to play the simulation for it to cook. If you want to have the values at frame 0, start your simulation at frame -1. If it really isn't doing anything when you simulate. That's very weird. Maybe reinstall Houdini.
  • Create New...