NVIDIAGameWorks / rtx-remix

Combined repo for the RTX-Remix runtime
https://www.nvidia.com/en-us/geforce/rtx-remix/
MIT License
1.36k stars 69 forks source link

[Toolkit feature]: Imported 3d assets to instantly replace parent by transforms & visibility #378

Open PappaSlask opened 8 months ago

PappaSlask commented 8 months ago

Contact Details (Optional)

No response

What is the context of the feature/improvement?

When replacing a 3d asset, we create a reference for an object (parent) in the scene, and then our new 3d asset (child) gets spawned in the world. We then have to worry about its transforms. The position, rotation and scale, to get the new asset to sit precisely where old one did. We then have to delete (basically hide) the parent mesh. Now we have effectively replaced the original asset

I would love for this to be automated. Or have an option to have it automated upon importing it. To do all these steps for me in an instant.

Please describe the feature/improvement?

As described above

What would be your solution? (optional)

Copy transforms from parent mesh, transfer it to the imported asset, hide the parent mesh. Call it a day.

Version

2024.1.1

nvdamien commented 8 months ago

Hey @PapaSlask ,

Normally, if you open the captured asset (mesh_xxxx.usd) into your DCC (Maya, Blender, Houdini, etc etc), and you do your modeling over it (using the mesh_xxx.usd as a reference), when you will replace it in RTX Remix, you should not have any transforms to change.

When you create your new asset, are you using the captured one as a reference?

PappaSlask commented 7 months ago

Hey @PapaSlask ,

Normally, if you open the captured asset (mesh_xxxx.usd) into your DCC (Maya, Blender, Houdini, etc etc), and you do your modeling over it (using the mesh_xxx.usd as a reference), when you will replace it in RTX Remix, you should not have any transforms to change.

When you create your new asset, are you using the captured one as a reference?

I don't have a reference when making custom 3d assets. I make them from scratch. Then I ingest them and imports them into my scene. When I select an instance in my scene, and click add reference, and points it to my custom 3d asset, it gets spawned somewhere in the vicinity, and NOT in the exact location as the instance I marked for replacement.

When we select an instance from our capture layer, and click add reference, and pick a custom 3d asset. It should copy the parent xforms to spawn in its position, as well as hiding the parent mesh, automatically or by prompt or checkbox, effectively replacing the original vanilla mesh/3d asset.

nvdamien commented 7 months ago

Hi @PappaSlask ,

This is already copying the xform of the parent (actually this is setting the asset as a child 0,0,0). The problem is that you need to use the original captured asset as a reference ("mesh_xxxx").

Imagine a captured asset like this (a sphere): image

As you can see, the translate of this captured asset is 0, 0, 0. But the captured asset is not centered (the vertex are not in the center as you can see).

Now you do your new asset (a cube in this example): image

You can see that, the cube has a translate 0,0,0 also, but not in the same position than the original captured asset (the sphere). As a result, when you will import your new asset, it will not spawn at the same position.

That is why when a new asset is done, the captured asset should be used as a reference: image

You can see here that my new asset (the cube) is over my original asset (sphere). Translate 0,0,0. both (I am in Maya here).

As a result, now when I will import my new asset, it will be automatically at the same position.

PappaSlask commented 7 months ago

Hey @PapaSlask ,

Normally, if you open the captured asset (mesh_xxxx.usd) into your DCC (Maya, Blender, Houdini, etc etc), and you do your modeling over it (using the mesh_xxx.usd as a reference), when you will replace it in RTX Remix, you should not have any transforms to change.

When you create your new asset, are you using the captured one as a reference?

Thanks a lot Damien for the rundown. I think I understand the issue now: The imported custom 3d asset has to be primed with a reference of the asset it's gonna replace PRIOR to importing? So we have to set it using a 3D modeling program like that when we create the custom asset? What if we obtain a 3d asset that wasn't primed like that? Then I still think it would be really useful to have an auto-replace and hide option as originally described by me. Perhaps the imported asset can copy the transforms of the parent mesh upon getting imported? And also send a signal to the parent to hide upon spawning. Or something along those lines. Would be really neat, thank you!

nvdamien commented 7 months ago

Hey @PappaSlask ,

copy the transforms of the parent mesh upon getting imported?

From my previous message, there is no transform to copy. An "asset is in space" using 2 things:

As you can see from my previous message, the transforms are at 0,0,0 for both meshes, but there are not in the center. This is because the modeling (vertexes) are offsetted. This is same feature in Maya as having the asset "frozen": https://www.youtube.com/watch?v=KWSh4m5_Zsw

Meaning that in our case, the original captured asset is "frozen" (xform/transform 0,0,0), but not in the center. From here, there nothing to copy.

What we are working on is a feature to "teleport" your asset anywhere your mouse is ( REMIX-2422 ). This would partially solve your problem. But the real fix is to always use the original captured asset as a reference before to start your modeling.

Let see for your case:

Please show the position in space of both.

nvdamien commented 3 months ago

Hey,

Is the new feature that "fired" the asset at the mouse position help your problem please?

PappaSlask commented 2 months ago

Hey,

Is the new feature that "fired" the asset at the mouse position help your problem please?

I'm not aware of such a feature, can you go inte more details please?

I think this whole thing boils down to a general issue where Remix applies a "visual correction" to all the vanilla meshes, that is - 1.0 on the X axis for size. And if we don't apply this to our custom meshes prior to replacing the vanilla mesh, it'll spawn offset to its parent mesh location. I actually just figured it out the other day.

And unfortunately, this mirrors the capped scene to appear "unmirrored" in Composer, when in reality it just got mirrored. The solution is to manually mirror the capture a third time by adding an -1.0 to X for size transforms. And the "Capture left-handed doesn't help thus issue, it used to do before, but then sometime in the spring of this year that function was removed, gone for a while, then rewritten and placed back in again.

I also have to mirror all my placed custom lights in order for them to appear correctly ingame, alas it will still be mirrored inside Composer and that is counter-productive for development.

nvdamien commented 2 months ago

I'm not aware of such a feature, can you go inte more details please?

Here a video of the feature in the current public build: https://github.com/NVIDIAGameWorks/rtx-remix/assets/128181406/e1d71979-20ba-4b9b-ab77-ec3be152da01

In any case, the best solution here is to always use the original asset as a reference for a new modeling, to be sure to do the new model at the same position than the original one.