tyFlow Forum
Tyflow and Usd - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: Feature Requests (https://forum.tyflow.com/forum-4.html)
+--- Thread: Tyflow and Usd (/thread-4334.html)



Tyflow and Usd - bigfish22 - 07-13-2024

Sorry this is a long one, but USD is a big thing, so saying "hey can you support USD" is probably not that useful. So I decided to explain what I could see as useful things for interacting with USD using tyflow


* birth / load particles from usd point instancer object
    Load USD from disk or from a specific USD Stage object in scene
    select the path inside a usd object - /root/grass/
    bring these either as particle transform or particles with shapes already set from the meshes in the usd

    Use Case: Somebody has created a particle sim, or scatter and I need to load that result and apply new forces, add animation to a scatter, or spawn new particles off a existing cache

* Position Nodes:
    Update particle positions nodes to support USD or create USD versions of position nodes:
    Load USD from disk or from a specific USD Stage object in scene
    pick usd geom/or a few usd geom objects for position object/object bind/raycast
    pick basis curves for hair position nodes etc

    Use case: I want to scatter particles on an object inside thats usd file, like a landscape To add a forest/rocks etc into a scene from another artist
    or bind particles to a character animation inside usd.
    use raycast to add snow ontop of a building in a usd file

* Shape Nodes:
    Shape nodes that allow you to pick references from inside a usd file to be the shapes scattered (maintaining these references on export particles)

    Use case: I have a usd File that has a set of objects, and I need to create a particle sim of them moving to layer over that base file of the objects.

* Collision Nodes:
    Ability to load UsdGeom meshes from a usd file to collide particles against/raycast against etc

    Use Case: load something from a usd file to collide against for my sims, character anim/set/etc

* Export Particles:

    (this is probably the most important bit, but the other stuff would be great to truly work with usd, not just export to it)
    Add an option here for usd/usda export
    Option to set the path inside usd "/root/rockExplosion/
    Option to target or create a USD layer, to target the root layer or to create/target an override layer
            Scene.usd--
                      |
                snowFX.usd
    export types:
        usdGeom Point Instancer:
            Sends particles out as point instancer points
            Options to send out the shapes and place under the point instancer /root/rockExplosion/RockA
        UsdGeomBasisCurves:
            export generated curves as basis Curves
            Option to set the path inside usd "/root/CurveSystem/
        UsdGeomMesh:
            export Cloth/blob mesh, skinned actors etc

    Use Case: Sending things back out to usd to layer into over the starting usd or to create a new usd file.
            Usd has compatibility with lots of apps implementing fairly good support for it.
            Houdini/maya/blender/Unreal etc
            Point instances load into unreal as HISM etc, more usefull then just throwing geometry out to be able to send out specific usd types that are handled well in other apps/renderers with good instancing/referencing.

* Edit Stage Node:
    It might be cool instead of just being able to export, but also to be able to target a USD stage object loaded in max,
    and push the changes directly into that, so add a sublayer and push the end result of the tyflow graph into it. Allowing for it to be rendered/tested directly in scene as the end result.
    Usd can be setup/viewed/edited in memory before even saving to disk, so this would be pretty nice to quickly use tyflows workflows to push things around in a UsdStages before saving to disk. and even renderers can read in memory changes to stage objects.

Example I built for taking particles from tyflow and just creating a point instancer of spheres from that:
https://github.com/Bigfish22/MaxScripts/blob/master/Python/TyflowToUsd.py
   

References to look at to understand the common relevant usd types are that I'm talking about:
https://openusd.org/release/api/class_usd_geom_point_instancer.html
https://openusd.org/release/api/class_usd_geom_mesh.html
https://openusd.org/release/api/class_usd_geom_basis_curves.html

https://openusd.org/release/api/class_usd_stage.html   "usd Scene"
https://openusd.org/release/api/class_sdf_layer.html    


Sorry again for the wall of text!


RE: Tyflow and Usd - tyFlow - 07-26-2024

USD still has only very niche application amongst tyFlow users. It's a huge beast to tackle and as it stands I don't think it would be worth the effort involved.

If it experiences wider adoption then I'd consider more integrated support.


RE: Tyflow and Usd - bigfish22 - 08-03-2024

That's fair USD is a big thing.

If anybody besides myself is looking at trying use tyflow and Usd I've added a new script to my github.
   
Simple qt UI that lets you export all the shapes and transforms from frame 0 of the selected tyflow object as a point instancer, and attempts to determine which ones should be instances(should work most of the time). handy if you need to take a scatter from tyflow into unreal or other places

https://github.com/Bigfish22/MaxScripts/blob/master/Python/TyflowUSDCache.py