lighttransport / tinyusdz

Tiny, dependency-free USDZ/USDA/USDC library written in C++14
Other
492 stars 37 forks source link

Finish "vw" vertex weight TinyObjLoader extension support #115

Open PierceLBrooks opened 8 months ago

PierceLBrooks commented 8 months ago

I would be super enthusiastic to see this loose tendril of a feature finalized! My desire is to use this conjunction with https://github.com/meshonline/Surface-Heat-Diffuse-Skinning to marry BVH & OBJ formatted asset files together gracefully with automatically assigned vertex weights for the skeleton bones in a minimal runtime. If there is some particular means of direct sponsorship or perhaps even assistance I could provide myself towards this end to accelerate progress, please let me know.

syoyo commented 8 months ago

What you want is either...

or

In either case, things will happen after finishing this task(ETA is this month(2024/Jan)) ( https://github.com/syoyo/tinyusdz/issues/109 )

PierceLBrooks commented 8 months ago

My apologies, I meant BVH as in the Biovision Hierarchy format for expressing motion capture data, not in the ray-tracing context of that term. So in the first scenario you mentioned, rather than loading a USD model that already has the skeleton onto which the OBJ skin weights would be applied, I would load a BVH asset file and then manually construct the USD scene object with an equivalent skeleton using the TinyUSDZ API before mixing in the mesh/skin information from a usdObj import. Avoiding the involvement of Blender at all is the primary goal. Simply implementing support for loading vertex weight in usdObj is probably sufficient. There is no specific timeline in mind so near the end of the month here is perfectly fine.

syoyo commented 8 months ago

@PierceLBrooks Thank you. Ah, understand: BVH as motion data.

So probably you want to do something like https://github.com/dopomoc/Skinning with TinyUSDZ API and BVH(motion data) file + .obj file(with skin weights)

I guess you'll also want usdBVH(BVH motion load(Convert BVH to USD SkelAnimation)) 😸

PierceLBrooks commented 8 months ago

I have not found that repository before myself, but if its purpose can be achieved solely through C++, then yes, that is the eventual goal. Would something like usdBvh be considered within the scope of TinyUSDZ? It is fine otherwise because manual construction of a scene with only a skeletal animation entity inside seems fairly doable through the existing API afforded by these headers. However, I'd be happy to sponsor/assist in the creation of both features ( i.e. usdBvh and supporting TinyObjLoader's vertex weight extension for usdObj ).

syoyo commented 8 months ago

@PierceLBrooks I'd like to support some de-factor and open file format on top of TinyUSDZ. For example I made a usdFbx placeholder https://github.com/syoyo/tinyusdz/blob/dev/src/usdFbx.cc ) so that people can load industry (de-facto) standard FBX animation/skinning file format on top of TinyUSDZ without writing loader/converter for it(priority is low and not yet implemented though)

So, yes usdBVH will be considered within the scope of TinyUSDZ! BVH motion format is somewhat de-facto & open standard, and it looks there are some demand(including you) to load BVH & obj model in USD workflow.

Sponsoring&assisting usdObj and usdBvh is much appreciated!(At least I need some test/sample BVH/.obj files)

PierceLBrooks commented 8 months ago

In that case, I think I will soon begin working towards a draft implementation of usdBvh myself since that would be an entirely new facility requiring less finesse over existing API functionality expectations among users, and wait for the end of the month to approach to hear about whether prioritization with sponsorship of the usdObj vertex weight extension support has become more realistic schedule-wise. Thank you very much for conferring with me so diligently on this matter! I look forward to the progress ahead.

PierceLBrooks commented 7 months ago

I went ahead and put together a few preliminary test assets using Blender, MakeHuman, plus CMU motion capture data ( http://mocap.cs.cmu.edu/resources.php ). It took a bit of effort but there were at least some fun opportunities to generate some contributions in various projects along the way. The base scene is expressed in GLTF format, but the real meat for further developing both usdBvh and usdObj have had the appropriate extensions appended with the GLTF file's path as a prefix.

untitled.zip

PierceLBrooks commented 7 months ago

@syoyo Just got a converter working for going from GLTF to USDZ ( https://github.com/PierceLBrooks/usd_from_gltf/tree/pierce ), and so here is the equivalent asset as above but in the right format for setting up some unit tests with eventually perhaps :)

untitled.usdz.zip