ynput / OpenPype

OpenPype has been surpassed by AYON and is now read only.
https://ayon.ynput.io
MIT License
286 stars 129 forks source link

Maya Instanced geometry support in ```model``` subset / Validator #3991

Open LiborBatek opened 1 year ago

LiborBatek commented 1 year ago

When trying to publish model family I get validation errors because of non-unique IDs of the geometries which shares its ShapeNode due to instance nature of them using Maya DuplicateSpecial function with geometry type se to Instance

image

Instancing in maya being crucial function and should be supported at least on a model level (look should be applied normally just multiple times I guess because of the same shapeNode and object ID...

[cuID:OP-4240]

BigRoy commented 1 year ago

Instancing in maya being crucial function and should be supported at least on a model level (look should be applied normally just multiple times I guess because of the same shapeNode and object ID...

It's actually an unfortunate downside of the shaders being based on the cbId. In Maya you can have different shaders per instance but the look system won't have it - unless it'd instead be replaced by a system based on the full path (name) of the hierarchies. With USD and materialx having adopted the path based system it makes sense to refactor our system at a point too. This discussion about ID vs Names already exists here.

Anyway, I agree - I feel like instances should be allowed - but maybe at least warning or reporting that you will not be able to assign unique shaders?

tokejepsen commented 1 year ago

Anyway, I agree - I feel like instances should be allowed - but maybe at least warning or reporting that you will not be able to assign unique shaders?

Since the model family does not support instancing (?) anyways, would it be worth duplicating the meshes and assign cbID when extracting? Essentially baking the instancing to unique meshes.

BigRoy commented 1 year ago

Since the model family does not support instancing (?) anyways, would it be worth duplicating the meshes and assign cbID when extracting? Essentially baking the instancing to unique meshes.

I personally wouldn't do that. Potentially that could turn what the artist thinks is a lightweight model due to many instances into a very heavy monster because it'd be baked.

LiborBatek commented 1 year ago

Yeah, we shouldnt convert it to duplicates at all. That beats the purpose of using instances. Typical scenario being model asset with dozens of same geometries acting as instances (for ie piles of dishes in kitchen enviroment). Personally I dont see any problem with not being assing unique shaders to these instances later on when in lookdev. It can be just warning as @BigRoy proposed already.

In general, instances being used in production for years we need em working when publishing models. There are maybe workarounds (MASH etc.) but it is essential and basic function in maya so thats why. Also should not break anything in OP besides aformentioned shader assignment limitation.

BigRoy commented 1 year ago

I've put together a draft in #4622 - let me know if you could test that and how that works out for you @LiborBatek