Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won


markinglevfx last won the day on June 12

markinglevfx had the most liked content!

Community Reputation

51 Excellent

1 Follower

About markinglevfx

  • Rank

Contact Methods

  • Website URL

Personal Information

  • Name
  • Location
    New York

Recent Profile Visitors

1,703 profile views
  1. Python - Callbacks help

    Thanks Alex. I needed to look at node.addEventCallback further. I was able to have the node color update after any parameter changes, node name changes, or scene frame number changes. ####OnCreated#### import os import hou def nodeColor(node): filepath = node.evalParm("file") if(os.path.exists(filepath)): node.setColor(hou.Color((0.0, 0.8, 0.0))) node.setComment(filepath) node.setGenericFlag(hou.nodeFlag.DisplayComment,True) else: node.setColor(hou.Color((0.8, 0.0, 0.0))) node.setComment("File not found") node.setGenericFlag(hou.nodeFlag.DisplayComment,True) def parmChanged(node, event_type, parm_tuple): nodeColor(node) def nameChanged(node, event_type): nodeColor(node) def frameChanged(event_type, frame): hda = kwargs['node'] nodeColor(hda) hda = kwargs['node'] nodeColor(hda) hda.addEventCallback( (hou.nodeEventType.ParmTupleChanged, ), parmChanged) hda.addEventCallback( (hou.nodeEventType.NameChanged, ), nameChanged) hou.playbar.addEventCallback(frameChanged)
  2. Python - Callbacks help

    Hey Guys, Still quite new to Python, hoping someone can help point me in the right direction on this that I've been grappling with for a while now. I have a simple filecache .hda that I'd like to change color if it can/can't find the cache on disk. I've been able to use hou.ui.addEventLoopCallback() to continuously track and check the file parameter to see if the cache exists, and the color changing now works as expected. Where I'm having trouble is removing the event loop when the .hda is deleted from the node graph. An error pops up because Houdini is still trying to access the deleted node. I've been trying to look for a way to use the OnDeleted event handler, or hou.nodeEventType.BeingDeleted, but no luck yet and I feel out of my depth with my limited python experience. The .hda is attached, and there's a preview of the code below. Any help would be appreciated! custom_filecache.hda ####PythonModule#### import os import hou def nodeColor(kwargs): node = kwargs["node"] def colorCallback(): filepath = node.evalParm("file") if(os.path.exists(filepath)): node.setColor(hou.Color((0.0, 0.8, 0.0))) node.setComment(filepath) node.setGenericFlag(hou.nodeFlag.DisplayComment,True) else: node.setColor(hou.Color((0.8, 0.0, 0.0))) node.setComment("File not found") node.setGenericFlag(hou.nodeFlag.DisplayComment,True) startCallback(colorCallback) #adding this code below crashes Houdini when hda is deleted #node.addEventCallback([hou.nodeEventType.BeingDeleted], endCallback(colorCallback)) def startCallback(callback): hou.ui.addEventLoopCallback(callback) def endCallback(callback): hou.ui.removeEventLoopCallback(callback) ####OnCreated#### kwargs["node"].hdaModule().nodeColor(kwargs)
  3. Smoke Target Force

    You can set the default operation to set always on the sopscalarfield1 node which sources the goal field from sops. At the moment it’s set to set initial, which doesn’t reevaluate the sop geo on each frame. Having it on set always ensures that the sop geo is sourced on every frame/substep. With the above applied you simply add animation to your goal geo in sops and voila!
  4. Redshift Proxy with relative path [SOLVED]

    Makes sense! Should've realized I needed to use @instance instead of @instancefile. With the \$HIP slash no slash, I was trying to get the $HIP to evaluate at render time. So having @instancefile = $HIP/rs_proxy/teapot.0001.rs and not @instancefile = M:/_Work/_Personal/sandbox/rs_proxy_relative/rs_proxy/teapot.0001.rs. But this is the wrong approach, for anyone wondering. Either using @instance, or the instance geo node with a .rs proxy object as its instance object would be the correct way to do local instancing. I also looked at exporting a packed prim to the .rs proxy, but it didn't seem to affect the render times. File attached. Also renders of instancing teapots on 6m points, using point attributes to drive color, orientation etc. rs_proxy_relative_v003.hip
  5. Hey guys, I need to send a large point cloud which instances geo to the cloud to render. The problem I'm having is the instancefile attribute is absolute, and once the project is uploaded to the cloud render environment the path is no longer relevant/correct. Redshift does not seem to expand strings at render time, so $HIP or $JOB do not get evaluated afaik. I've also tried setting the path to a node within the .hip file. For example, this will work: M:/_Work/_Personal/sandbox/rs_proxy_relative/rs_proxy/teapot.0001.rs But this will not: \$HIP/rs_proxy/teapot.0001.rs Nor will this: /obj/teapot_rs/OUT/ I've attached a super simple setup where I get instancing working using an absolute path (it references the output of the RS Proxy Output SOP). Is there any way to get Redshift to to instance from a path that is relative to the project folder, or a node within the .hip file? Or has anyone had experience getting Redshift instances rendering on Gridmarkets? Thanks all! Note: I've also tried using the instance obj node (see v002 hip attachment). BUT the issue I run into with this is it maxes out my GPU's VRAM at render time, whereas using an absolute path with instancefile renders just fine with the ~6m points I need to instance on. rs_proxy_relative_v001.hip rs_proxy_relative_v002.hip
  6. Python - Integer to String

    Bingo. Thanks for the help guys!
  7. Python - Integer to String

    I did have 'str' set as a variable elsewhere in the code. But even after I got rid of it, the error persisted. But I have managed to get it working now. I solved it by making a new Python SOP and using the same code - initially I was copy/pasting lines and seeing where it broke. Weird how I now have two python nodes side by side with the same inputs, the old one errors and the new one is fine.
  8. Python - Integer to String

    In the Python SOP, I've run into a wall trying to get an integer converted to a string. In the larger picture, I'm trying to subtract 1 from a value which is currently part of a string. There are probably neater ways to write these steps, but I'm fairly new to Python so I'm writing it all out to make things easier to follow. I start with a string such as: string = "f27" Then remove the 'f' like so: string = string[1:] Convert it to an integer: integer = int(string) Subtract 1 from the value: integer -= 1 set new string string_new = "f" + str(integer) The last line returns an error on the Python SOP: TypeError: str() object is not callable. This is confusing because these same steps work just fine in the Python shell. Is there an alternative to str(), or am I using it wrong?
  9. Solids from Gases

    Converting your volume to VDB (class: SDF), followed by a VDB smooth and a convert to polys should do the trick pyro_to_poly_v001.hip
  10. Replicating Coins

    I did a little breakdown of the replicating effect in a blog post - check it out if you like! There's a free .hip to download included. https://www.markinglevfx.com/post/replicating-coins-hip-breakdown
  11. Replicating Coins

    A little experiment I like to nickname: 'Life as a VFX Artist'
  12. You can use this code in your switch. Currently you're using the loop iteration in the switch, but the point/loop order changes as new points come in so it's different each frame. By referencing each point's id attribute when selecting the object it instances you can keep them constant throughout. Hope it this makes sense. Adjust the max fit value (currently 1) to account for more instance objects fit01(rand(point("../foreach_begin1/", 0, "id", 0)), 0, 1)
  13. Bake parameters into render or flipbook?

    The vm_image_comment is on the mantra node by default so technically it belongs there. You have to render from the mantra node (not just flipbook) to display the comment.
  14. Pivot at the bottom of an object

    Write this into your pivot translate to get the minimum y position of the input geo: bbox(opinputpath(".", 0), D_YMIN) opinputpath(".", 0) gets the path of the first input of the current node. https://www.sidefx.com/docs/houdini/expressions/opinputpath.html bbox() returns the bounding box info of a node, in this case we want to use "D_YMIN" to get the minimum y position. https://www.sidefx.com/docs/houdini/expressions/bbox.html edit: forgot to add the centroid expressions for the x and z values, see Tomas' reply below
  15. Modify an existing group

    Does this help? Click the arrow next to the base group parameter deselect the edges using ctrl hit enter (in viewport) when done