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

Conversation

mre7a
Copy link
Contributor

@mre7a mre7a commented Apr 6, 2023

Changelog Description

When building a template with Maya template builder, we import the template and also the references inside the template file. This causes some problems:

  • We cannot use the references to version assets imported by the template.
  • When we import the file, the internal reference files are also imported. As a side effect, Maya complains about a reference that no longer exists.

// Error: file: /xxx/maya/2023.3/linux/scripts/AETemplates/AEtransformRelated.mel line 58: Reference node 'turntable_mayaSceneMain_01_RN' is not associated with a reference file.

Testing notes:

  1. Create a template containing some references.
  2. Build the workfile with template builder from openpype menu

@ynbot ynbot added size/XS Denotes a PR changes 0-99 lines, ignoring general files host: Maya labels Apr 6, 2023
@LiborBatek
Copy link
Member

I think there shouldnt be any referenced files in Template File but only placeholders created via Template Creator.

So I guess its not valid request. @antirotor @iLLiCiTiT can you confirm its like I said?

@ClementHector
Copy link
Contributor

@LiborBatek The purpose of the template file is to contain any type of data including placeholders. During the build phase the placeholders will be replaced by the data corresponding to the context.
We can say that it is a legitimate request.

@LiborBatek
Copy link
Member

LiborBatek commented Apr 13, 2023

@LiborBatek The purpose of the template file is to contain any type of data including placeholders. During the build phase the placeholders will be replaced by the data corresponding to the context. We can say that it is a legitimate request.

My point is that template file should only/exclusively contain just placeholders....not any live reffed data. Thats my point :)

Also thats why I was asking devs whats their pov.

As I see it if there should be present something in the template file again and again ...why not create an asset for it and use placeholder for it instead and not normal maya referencing like "hardlink". Then all is build correctly and managable via Scene Inventory as any other assets loaded in.

@ClementHector
Copy link
Contributor

I understand your point of view but when we started developing this feature, the goal was not to have only placeholders. I invite you to consult the description of the first tickets and thoughts that led to the development of this feature.
https://github.com/ynput/OpenPype/discussions/2013
#2202
#3544
In your case it does nothing more than the Build Workfile

@ClementHector
Copy link
Contributor

ClementHector commented Apr 13, 2023

If the template cannot integrate other things then for nuke we no longer have nodes that are connected to what is replaced by the placeholder.
And for maya, we can no longer put a placeholder that is replaced in a hierarchy.
And another point, maybe the reference didn't publish because it doesn't correspond to any asset, for example a lighting studio for asset reviews.

@OlivierOsotimehin
Copy link

I agree that the best way is to have proper loaded asset through Opype and not a "simple" reference.
And that's a pull request that will be coming (able to load an asset from other project (library project), with the template builder).

Being able to reference an arbitrary scene enable us to quickly prototype template elements, test them through the pipeline without having to publish again, again and again a turntable remplate or a camera, etc we are building / finetuning

@LiborBatek
Copy link
Member

LiborBatek commented Apr 17, 2023

@mre7a I did try to test this but I have failed to replicate the conditions. Could you elaborate more on it, describe your workflow/ testing steps exactly step by step?

for ie I dont really understand these steps you wrote:

"When building a template with Maya template builder, we import the template and also the references inside the template file."

If I am correct theres no any "import" step normally invovled when using template file. Neither when creating the template itself nor when using that template file to create new workfile via OP>Template Builder>Build Workfile from Template

The only thing clear to me is whenever something got imported it obviously loose versioning via Scene Inventory.

Thanks.

@mre7a
Copy link
Contributor Author

mre7a commented Apr 17, 2023

@LiborBatek Sorry if I wasn't clear.
Our template file contains not only placeholders (as expected), but also live references, and our problem is that the live references are imported into the scene and are no longer referenced.
When building a template, the Maya template builder builds the template and also imports the references inside the template file. I use the word "import" because the link to the referenced file is broken and the references inside the model are completely integrated into the current scene.
The template:
template_builder

The build scene:
template_builder_2

@LiborBatek
Copy link
Member

LiborBatek commented Apr 17, 2023

When building a template, the Maya template builder builds the template and also imports the references inside the template file.

If I can reformat yout sentence it basically means this:

After using Create workfile from template file action, current maya work file no longer contains maya references formerly present within the Template file.

Btw thanks for the scrngrabs (these are very helpful! for debugging your issue).

Also looking on your template setup (pic 1) you do use some sort of asset so it could be created via placeholders not standard maya reference. All should be working then.

Does it have any special reason to create Template file like you do? Some benefits or any shortcommings when other method with placeholders?

@mre7a
Copy link
Contributor Author

mre7a commented Apr 17, 2023

@LiborBatek Thanks a lot for reformatting my sentences. 😄
As @OlivierOsotimehin explained, I think the main reason here is that we can not use assets from other projects to build a template.
Also

Being able to reference an arbitrary scene enable us to quickly prototype template elements, test them through the pipeline without having to publish again, again and again a turntable remplate or a camera, etc we are building / finetuning.

@mkolar mkolar added the type: enhancement Enhancements to existing functionality label Apr 19, 2023
@mre7a mre7a force-pushed the 342-fix-studio-openpype-reference-is-broken-imported-when-scene-is-build-from-template branch from d67d965 to 1c6af19 Compare April 20, 2023 10:34
@iLLiCiTiT iLLiCiTiT removed their assignment Apr 25, 2023
@ClementHector ClementHector force-pushed the 342-fix-studio-openpype-reference-is-broken-imported-when-scene-is-build-from-template branch from 1c6af19 to d67d965 Compare April 26, 2023 15:52
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

After creating the workfile by template file it keeps the contained maya reference files in the scene as references.

image

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

There is one weird issue tho...I got each placeholder loaded 2x times with assets!

image

besides layout which is loaded just one time...

This issue is not present in the latest develop tho.
@mre7a Could you try to merge develop into this PR?

@mre7a mre7a force-pushed the 342-fix-studio-openpype-reference-is-broken-imported-when-scene-is-build-from-template branch from d67d965 to 5ba82ae Compare April 27, 2023 13:43
@mre7a mre7a requested a review from LiborBatek April 27, 2023 14:17
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Now all works as expected, references being preserved from Template file and
all assets correctly loaded...
image

Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Tested in Maya 2023.

Just 1 small code cosmetic request.

@mre7a mre7a requested a review from tokejepsen May 3, 2023 10:03
@mre7a mre7a force-pushed the 342-fix-studio-openpype-reference-is-broken-imported-when-scene-is-build-from-template branch from 5ba82ae to 8eeb3ed Compare May 3, 2023 10:06
@mre7a mre7a force-pushed the 342-fix-studio-openpype-reference-is-broken-imported-when-scene-is-build-from-template branch from 8eeb3ed to 17d39cc Compare May 3, 2023 15:13
@antirotor antirotor dismissed tokejepsen’s stale review May 10, 2023 12:42

can't use long names for that

@antirotor antirotor merged commit 041914e into ynput:develop May 10, 2023
@ynbot ynbot added this to the next-patch milestone May 10, 2023
@BenSouchet BenSouchet deleted the 342-fix-studio-openpype-reference-is-broken-imported-when-scene-is-build-from-template branch March 1, 2024 10:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community contribution host: Maya size/XS Denotes a PR changes 0-99 lines, ignoring general files type: enhancement Enhancements to existing functionality
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

10 participants