OpenUSD

Post Reply
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

OpenUSD

Post by clintonman »

OpenUSD_Dev01.jpg

First successful import of the USD kitchen sample file.

Developing this required taking a round about approach. The USD API is 64bit so it can't be used with trueSpace. USD can use Python, but truespace python is way too old to use it. The trick was to create a 64bit activex server that can be called from the 32bit truespace script. After that the python usd tutorials had to be converted to c++ to understand how to use it. Finally, the USD API and ActiveX code was merged together so tS could read in the USD file via script.

There's a lot more to do and this is a good start.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

OpenUSD_Dev02.jpg

Very crashy, but managed to get a screenshot with basic color values before tS crashed again.
Clinton Reese

http://clintons3d.com
User avatar
bitkar
Captain
Posts: 1980
Joined: 16 Mar 2010, 07:14
Type the number ten into the box: 0
Location: Czech Republic
Contact:

Re: OpenUSD

Post by bitkar »

you are a wizard
Michal aka bitkar
tS freak since tS2 (1998) and forever (tS7.61 modeler)
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

bitkar wrote: 07 Apr 2024, 20:51you are a wizard
If being a wizard means doing lots of hard work, then yes, I am a Wizard. :)
Clinton Reese

http://clintons3d.com
User avatar
bitkar
Captain
Posts: 1980
Joined: 16 Mar 2010, 07:14
Type the number ten into the box: 0
Location: Czech Republic
Contact:

Re: OpenUSD

Post by bitkar »

hard working wizard :D
Michal aka bitkar
tS freak since tS2 (1998) and forever (tS7.61 modeler)
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

OpenUSD_Dev03.jpg

This shows texture and uv mapping working along with the texture coordinate shader.
Texture coordinate shader works for scale and move. Top 3 are move and the bottom middle is scale.
Bottom left is rotation and it's a bit off. It should point to the green checkbox.
Bottom right is a combination of rotation and scale. It's also off but by accident almost looks correct.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

OpenUSD_Dev04.jpg

This shows alpha map opacity settings working and normal, metallic and roughness maps. Missing is occlusion maps. I don't have any sample files for that so will be skipping it for a while.
OpenUSD has support for MaterialX so I think reading that will be next. Almost half the sample files I found use it.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

OpenUSD_Dev05.jpg
View from imported camera, lit with imported lights.


This shows light and camera import working and various usd standard materials. MaterialX is still a little bit of a mystery.
I think the next big thing is animation import.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

OpenUSD_Dev06.jpg
MaterialX roughness can be seen in the scratches and the color texture was a cheat.

Had some luck with MaterialX. It gives the paths to texture files in a really weird way. The color above is really meant to go into a "coating color". I changed it to plain color so I could test it. The only real problem with this test is that the center part is supposed to be the same material as the outer part. I also think the dense mesh is an issue with a lot of the MaterialX samples I could find. They are generally scenes with a bunch of dense meshes and I get crashes because tS fills up(I guess). I was able to trim down this sample to just 1 shader ball and avoid the crash.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5438
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OpenUSD

Post by clintonman »

OpenUSD_Dev07.jpg
Alembic file import, twisting cube 4 frames


Transformation animations are working. It has 2 forms. One is it imports the animation data and creates keyframes like normal. In the other it will add a script that will read the animation directly from the USD file. This is driven by time keyframes. So a value of 0 is keyframed at time 0 and a value of say 10 is keyframed at time 10 and this drives the script to read in the transform for the given time.

The image shows a cube that was deformed inside Blender and then exported as an Alembic file. The OpenUSD code is setup to read alembic abc files. It will also work by using time keyframes and reading the vertex positions directly from the ABC file.

Next step is to make it real. Right now I manually copy and setup the scripts to run the animations.
Clinton Reese

http://clintons3d.com
Post Reply