Send To Blender || Houdini and Python Tutorial

Поділитися
Вставка
  • Опубліковано 6 лип 2024
  • In this tutorial, you will learn how to use Python scripting in Houdini to launch Blender and open a geometry file. By using the subprocess module in Python, we can execute external commands and interact with other software from within Houdini. This technique can be useful for integrating different software tools in a pipeline, or for automating repetitive tasks.
    In this tutorial, we will cover the following steps:
    Setting up a Houdini scene with a geometry file that we want to open in Blender.
    Writing a Python script that uses the subprocess module to launch Blender and open the geometry file.
    Adding the Python script to a Houdini shelf tool for easy access.
    Testing the script by launching Blender and verifying that the geometry file is loaded.
    By the end of this tutorial, you will have a basic understanding of how to use Python in Houdini to interact with external software and automate tasks. You will also have a useful tool for editing geometry files in Blender and integrating it into your Houdini workflow.
    Note: This tutorial assumes a basic knowledge of Houdini and Python scripting. It also assumes that Blender is installed on your computer and accessible from the command line.
    Project files (with more features) siver.gumroad.com/l/pihcq
    Timestamps
    00:00 Intro
    00:15 Overview
    00:38 Scene setup
    01:37 Make Shelf tool
    02:36 USD exporter
    04:04 Export using Python
    06:50 Launching Blender
    09:25 Blender Python Import USD
    11:42 Make a Blender py script
    12:25 Launch Blender with script
    13:35 Remove Objects in Blender scene
    15:54 Trying out the tool

КОМЕНТАРІ • 27

  • @mannjofq9170
    @mannjofq9170 Рік тому +5

    thank you for this video. I wanted to add a bit so you dont have to go to the stage and add those nodes just work straight from /obj context.
    So this adds the two nodes in the stage context and connects them add the parameters press the button and destroys the nodes.
    stage = hou.node("/stage")
    importnode = stage.createNode("sceneimport::2.0", "sceneimportall")
    importnode.parm("objects").set("*")
    importnode.parm("materials").set("*")
    usdrop = stage.createNode("usd_rop", "usd_rop")
    stage.layoutChildren()
    usdrop.setInput(0,importnode)
    usdrop.parm("lopoutput").set("D:/Tools/Temp_Scene.usd")
    usdrop.parm("execute").pressButton()
    usdrop.destroy()
    importnode.destroy()
    you can add this between the import subprocess and the blenderpath.
    only change the output usdropparm to your destination

  • @adamkomarowski5690
    @adamkomarowski5690 Рік тому

    Really cool, thanks for your work!

  • @RMAFIRE
    @RMAFIRE Рік тому

    Very creative !!💥⚡

  • @animadorazo
    @animadorazo Рік тому

    great video!

  • @OMGitsXupi
    @OMGitsXupi Рік тому

    awesome, something like this should be pushed to the limits to create the best possible workflow between Houdini and Blender

  • @marcofontan7416
    @marcofontan7416 Рік тому

    Awesome thank you very much.
    It would be great if after editing the mesh in blender another python script exports everything back to Houdini and updates the sop node tree.
    Sort of part two of this tutorial :)

    • @simonhoudini5074
      @simonhoudini5074  Рік тому +1

      There maybe a part 2 if there is enough interest of people

  • @saebr
    @saebr Рік тому

    Thanks a lot Simon,
    What are the limitations?
    For example, can we export heavy rbd simulations with smoke or pyro?
    Thanks again

    • @simonhoudini5074
      @simonhoudini5074  Рік тому +1

      In this case it is all based on USD file, a heavy/larger file will take longer to load in Blender. When it comes to sending simulation you might want to use other file types like vdb.

  • @rusman000
    @rusman000 2 дні тому

    does this work for the latest houdini

  • @Jofoyo
    @Jofoyo 11 місяців тому +1

    Hi Simon, hoping you see this comment, can you possibly make a video or guide covering file structure, organization and asset management? It's a reoccurring problem for me and I have troubles wrapping my head around it all.

    • @simonhoudini5074
      @simonhoudini5074  10 місяців тому +1

      Hey, sounds like a good idea. I will try to find some time for the next video. SideFX provides some basic docs but a video will be better.

  • @imakegreateggs
    @imakegreateggs 10 місяців тому

    Is there a way to import particles sims with attributes into blender from houdini?

  • @awesomedata8973
    @awesomedata8973 Рік тому +1

    Thanks for the tutorial, Simon! -- I wish you'd have shown the other way around though!
    -- i.e. How do I create / edit / sculpt this file in Blender and then import that into Houdini as USD (i.e. to generate UVs, etc., since that'd be my preferred workflow).

    • @simonhoudini5074
      @simonhoudini5074  Рік тому +5

      If there is enough interest there could be a part 2 with the other way around. It would be somewhat similar in code.

    • @dmitrylevitsky6643
      @dmitrylevitsky6643 Рік тому +1

      @@simonhoudini5074 yes there is interest, lots of it) thanks for the tut by the way!

    • @awesomedata8973
      @awesomedata8973 Рік тому +1

      @@simonhoudini5074 I definitely would enjoy the reverse workflow. Blender is getting a little more Houdini-like these days, and some things are just straight-up easier / more fun to do in Blender than in Houdini, so that's why I think this is worth the effort.
      Thank you for considering this! -- I would love to see a building editor that uses Houdini for the tedious stuff, and Blender for the "blocking-out" of the building since it is a lot nicer and more fun to use for that sort of thing!

    • @hoodboyslim
      @hoodboyslim Рік тому +1

      Yeah

  • @StaviArt
    @StaviArt Рік тому

    Hello there! If I buy a tool from your gumroud, shoug I follow this tutorial or there is a ready tool?

    • @simonhoudini5074
      @simonhoudini5074  Рік тому +1

      The Gumroad version provides the tool files. It also has a few more features and videos explaining that

  • @Cazaq
    @Cazaq Рік тому +1

    Now that Blender has .USD support, that might be a better way of going about it.

  • @arturobandini8164
    @arturobandini8164 Рік тому

    Hi! I found a few problematic things with the gumroad plugin.
    When you export one object from blender, all are sent. It would be much more convenient to send only selected objects.
    Also the camera and lights from the blender is not exporting to Houdini.

    • @simonhoudini5074
      @simonhoudini5074  Рік тому

      Export selected can be done by tweaking the export function like this: bpy.ops.export_scene.fbx(filepath=obj_path, use_selection=True)
      This (use_selection=True) enables export selected only. The Camera and lights are a bit more tricky, the Houdini sop imported is limited to geometry only. So would be more of obj level, I need to look at the API to see what is possible. I can later look into adding some updates. Hope this helped

    • @simonhoudini5074
      @simonhoudini5074  Рік тому

      Did add an update v2.1, this will be exporting selected and better support for light and camera in Houdini

  • @amigarulez
    @amigarulez Рік тому +5

    Insta dislike, since blender is mentioned.