Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Maya: Enable publishing render attrib sets (e.g. V-Ray Displacement) with model #1955

Merged
merged 10 commits into from
Sep 24, 2021

Conversation

davidlatwe
Copy link
Contributor

@davidlatwe davidlatwe commented Aug 23, 2021

This close pypeclub/client#137.

Feature

Enable extracting render attribute sets (e.g. V-Ray Displacement) while publishing model, as model representation's metadata. So optionally, lookdev artist could use them while working on the model as for a suggestion (or bootstrap) from modeler.

Workflow

  1. Say a modeler have this scene ready to publish a model. There are some simple shading and displacement sets applied to those meshes.

    image

  2. Modeler published the model, lookdev artist takeover and start to work. Model has been referenced from Loader.

    image

  3. Lookdev artist go to the Scene Inventory tool, trying to apply render attribute sets which has been published with current loaded model, to see if they could help.

    image

  4. Render attribute sets has been imported, now the lookdev artist can play with them however he/she wants. Even delete or rename those sets, and whether or not to publish look with them.

    image

Implementation

In contrast to previous implementation (90d80dc), this refactored workflow doesn't change the content of current representation nor add new representation.

Well actually there are two new representation types (meta.render.ma and meta.render.json) be extracted on model publishing since the render attribute sets are being treated as look, just that there are no Loader plugin for them so they won't be loadable in Loader action menu.

image

original propose from 90d80dc (outdated info)

⚠️ The following description of this PR is outdated.

What's Changed

A new model family representation was introduced: fried.ma (or fried.mb if project settings maps the file extension to mb).

image

This new representation will not only save extracted un-shaded, clean model, like the regular model representation does, but also objectSet nodes (e.g. V-Ray Displacement) which holds rendering attributes that are related to the published models.

Noticed that if there isn't any render attrib objectSet is affecting the model in workfile, this new representation won't be generated from version publishing.

Fried model ?

The representation name, fried.*, is try to express the model is not being shaded, however it could be bumpy due to the displacement node that being published with it, or other render attributes like subdiv-level which contributed from other rendering related objectSets.

Caveat

  • When assigning looks to fried.* model via look-assigner tool. If the look also has it's own render attrib sets like fried model does, sets from look may supersede the model's.
  • Currently not able to switch into other representation.

Implementation details

Since this feature in essence is like publishing model with it's look but without shading-groups. So to avoid implementing new logic for this feature, the publishing code path is inherited from look family.

Currently only V-Ray is tested, Redshift and Arnold shall be tested in next couple days.

[cuID:yjx9fn]

Comment on lines 361 to 371
render_set_types = [
"VRayDisplacement",
]
render_sets = cmds.ls(look_sets, type=render_set_types)
if render_sets:
history.extend(
cmds.listHistory(render_sets,
future=False,
pruneDagObjects=True)
or []
)
Copy link
Contributor Author

@davidlatwe davidlatwe Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part also fixed an issue that I found when publishing regular look with VRay Displacement node that uses texture file.

The resource of file texture node that connected to the displacement node is not being remapped during look extraction, because the file node was not being collected here. Hence the published displacement node still linking to working texture file.

@davidlatwe davidlatwe added sponsored Client endorsed or requested type: feature Larger, user affecting changes and completely new things host: Maya labels Aug 23, 2021
@mkolar
Copy link
Member

mkolar commented Aug 25, 2021

I'll continue the discussion here to keep in central. I'm wondering if this shouldn't actually be a different family and subset, rather than a representation. We're not exactly exporting the same data, but a fair bit more.

Another option would be to dynamically name the representation with as model{Renderer} which would at least denote what attributes one might expect. Considering this is very tightly locked to particular shading attributes. Ending up with modelArnold, modelVray, modelRedshift sounds quite reasonable to me.

Or simple modelrender

@davidlatwe
Copy link
Contributor Author

davidlatwe commented Aug 25, 2021

edit: this comment is outdated

I'm wondering if this shouldn't actually be a different family and subset, rather than a representation.

🤔 I think that depends on how many subset will be created when publishing from one model instance ?

Here's the bottom line for this feature to be implemented :

  • must have a clean model
  • render sets related resources (e.g. maps for displacement) should be re-path and published
  • the mouse clicking time on loading render model, should be less then loading regular model + look assignment
  • the render model should be able to switch into another representation without a problem (not yet sufficed ATM)

So with above in mind... 🚀

If only one subset, then it should belong to model family's representation level. As current implementation. Because the amount of that additional render data doesn't worth a subset/family to me.

But if more then one subset could be generated, model + look would be my favorite. What I am thinking is, as an alternative, we still publishing clean model, but also publishing look automatically (by adding one additional switch, maybe name it with_look, on to the model creator instance).

And in loading part, where the real beef is, maybe an auto look assignment plugin could be implemented so the artist could load model + look in one shot, in Loader.

Instead of loading whole render(augmented) model from
Loader, *import* those render sets from scene inventory
as model's metadata which allow lookDev artist to
modify it and optionally publish a look from there.
@davidlatwe
Copy link
Contributor Author

Okay, I have refactored and updated the top description for this new implementation. 🚀

@mkolar
Copy link
Member

mkolar commented Sep 16, 2021

@antirotor could you please review this when you find some time?

@davidlatwe
Copy link
Contributor Author

Following set types are also included in latest commit :

  • VRayLightMesh
  • VRayObjectProperties
  • RedshiftObjectId
  • RedshiftMeshParameters

@antirotor
Copy link
Member

I've found somethings wrong, probably even with the original look extractor:

image
image

It seems that once I have my workfile as Maya Binary, it doesn't want to save it as Maya ASCII as we are forcing it by scene_type = "meta.render.ma"

Shouldn't it get its format from project_settings/maya/ext_mapping in settings?

@davidlatwe
Copy link
Contributor Author

@antirotor Ah yes, I have that fixed in previous implementation (9f11165) but reverted and didn't add back.
Will add that fix back in.

@davidlatwe
Copy link
Contributor Author

After da7dda6, original look extractor and the model render set extractor both able to respect studio scene type config.

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfectly! 👍🏻

@mkolar mkolar merged commit bf39741 into ynput:develop Sep 24, 2021
@davidlatwe davidlatwe deleted the feature/maya-publish-augmented-model branch September 24, 2021 13:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Maya sponsored Client endorsed or requested type: feature Larger, user affecting changes and completely new things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants