Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global | Nuke: Creator placeholders in workfile template builder #4266

Conversation

jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Dec 23, 2022

Brief description

Adding Creator Placeholder plugin implementation

Description

New placeholders for creators are now available. Templates can be now build included publishable instances.

Additional info

Several global abstractions at parent workfile building classes had to be altered. Creator plugin abstraction can now be implemented also into other hosts.

Need to be tested in:

  • Nuke - new creator feature.
  • Maya - is it working as before and nothing had been broken by this PR?

Testing notes [ Nuke ]:

  1. Test in \OP02_VFX_demo ideally on sh020 because the template is expecting data from this project. Project can be deployed with /tools/unpack_project.ps1 (follow instructions inside of the .ps1 file), here is where you can download it from.
  2. Download following zip and unpack it in project structure as follows.
    image
  3. create preset in your test project settings project_settings/nuke/templated_workfile_build
  4. In case you already had some preset then DO NOT SAVE and test backward compatibility in Nuke by building from template. All should work as it was.
    5.a If you are creating new preset then paste following onto project_settings/nuke/templated_workfile_build and fix the path to your in case it is different.
{
    "profiles": [
        {
            "task_types": [
                "Compositing"
            ],
            "task_names": [],
            "path": "{root[work]}/{project[name]}/templates/comp.nk",
            "keep_placeholder": false
        }
    ]
}

5.b dowload this settings patch then copy context of the file to clipboard. Go to project_settings/nuke/imageio and RMB click at the ImageIO and paste. It will take about 5mins to update and then save the settings.
6. then open Nuke from sh020 and remove all nodes in scene (just not to collide with already created write node)
image
7. template should show in script and no Placeholders should stay in the scene under loaded Read nodes and Render write node should be created at bottom. Here is how it should look
image
9. Try it again but switch the settings placeholder_keep to active.
10. Placeholders should stay in the scene after the template is builded.

Dependencies:

This PR branch is based on #4258 and ideally needs to be merged as second.

@jakubjezek001 jakubjezek001 self-assigned this Dec 23, 2022
@ynbot
Copy link
Contributor

ynbot commented Dec 23, 2022

@jakubjezek001 jakubjezek001 added host: Nuke type: feature Larger, user affecting changes and completely new things labels Dec 23, 2022
@jakubjezek001 jakubjezek001 marked this pull request as draft December 23, 2022 13:45
@jakubjezek001 jakubjezek001 marked this pull request as ready for review December 23, 2022 13:53
@jakubjezek001
Copy link
Member Author

I have the same behavior as Libor

Updated the testing procedure, please follow try it again, it should work file.

Copy link
Collaborator

@jrsndl jrsndl left a comment

Choose a reason for hiding this comment

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

I am not able to test Maya, but I can confirm that creators work in Nuke 12.2 and 13.2, with and without kept placeholders. I've tested render, prerender and still creators.

On a side note, the template nodes leave behind knobs named x_init and y_init when replaced by Nuke nodes. Sometimes more than one pair, and not hidden. Not connected with this PR.

image

@jrsndl jrsndl self-requested a review January 5, 2023 11:18
Copy link
Collaborator

@jrsndl jrsndl left a comment

Choose a reason for hiding this comment

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

Approving this, please note I tested Nuke only

@jakubjezek001
Copy link
Member Author

On a side note, the template nodes leave behind the knobs named x_init and y_init when replaced by Nuke nodes. Sometimes more than one pair, and not hidden. Not connected with this PR.

Yeah, I had noticed it. I believe that is the feature for connecting loaded containers with placeholders trough position matching. Yes, this doesn't need to be added, since placeholders are removed. Will look into it in next PR. Thanks for mentioning ;)

Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

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

I was testing Maya for a while and couple of issues arise along the way.

first the issue not connected to this PR with inability to resolve project key in template path - created a separate issue for it #4282

after fixing the template path there is another issue with the missing attribute '_parent_in_hierarhchy' which looks like a typo should be '_parent_in_hierarchy' most probably

# openpype.lib.profiles_filtering : Looking for matching profile for: task_names: "lighting" | task_types: "Lighting" # 
# openpype.lib.profiles_filtering : Profile selected: {u'path': u'{root[work]}/murphy_22101/templates/template_model.ma', u'task_types': [u'Lighting'], u'task_names': [], u'placeholder_keep': True} # 
# >>> [ Found template at: 'D:\PROJECTS\murphy_22101\templates\template_model.ma' ] 
# File read in  0.012 seconds. # 
# # >>> [ Loading modelMain from testYeti with loader ReferenceLoader
Loader arguments used :  ] 
# openpype.pipeline.load.utils : Running 'ReferenceLoader' on 'testYeti' # 
# SubsetLoader : {} # 
# File read in  0.0098 seconds. # 
# # *** WRN: >>> { <openpype.hosts.maya.api.workfile_template_builder.MayaTemplateBuilder object at 0x0000016FE3B5F518> }: [ Failed to process placeholder |locator1|All_model_assets with plugin MayaPlaceholderLoadPlugin ] 
# ==============================
# 'MayaPlaceholderLoadPlugin' object has no attribute '_parent_in_hierarhchy'
# ==============================
# Traceback (most recent call last):
#   File "D:\REPO\OpenPype\openpype\pipeline\workfile\workfile_template_builder.py", line 586, in populate_scene_placeholders
#     placeholder_plugin.populate_placeholder(placeholder)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 208, in populate_placeholder
#     self.populate_load_placeholder(placeholder)
#   File "D:\REPO\OpenPype\openpype\pipeline\workfile\workfile_template_builder.py", line 1450, in populate_load_placeholder
#     self.load_succeed(placeholder, container)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 243, in load_succeed
#     self._parent_in_hierarhchy(placeholder, container)
AttributeError: 'MayaPlaceholderLoadPlugin' object has no attribute '_parent_in_hierarhchy'

jakubjezek001 and others added 2 commits January 6, 2023 10:38
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
@jakubjezek001
Copy link
Member Author

Testing notes had been updated please repeate step 4. since attribute name had changed and your settings needs to be updated.

Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

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

  • I can confirm resolving the project key in the template path is working correctly now
  • I can confirm '_parent_in_hierarchy' is working correctly now

there is a new error though AttributeError: 'LoadPlaceholderItem' object has no attribute '_scene_identifier'

# pymel.core : Updating pymel with pre-loaded plugins: svgFileTranslator, invertShape, mayaHIK, GamePipeline, curveWarp, tiffFloatReader, poseInterpolator, hairPhysicalShader, cacheEvaluator, ikSpringSolver, ik2Bsolver, AbcExport, retargeterNodes, gameFbxExporter, OpenEXRLoader, lookdevKit, Unfold3D, mayaCharacterization, Type, meshReorder, modelingToolkit, rotateHelper, MayaMuscle, matrixNodes, AbcImport, autoLoader, deformerEvaluator, sceneAssembly, gpuCache, OneClick, shaderFXPlugin, objExport, renderSetup, GPUBuiltInDeformer, ArubaTessellator, quatNodes, fbxmaya
# File read in  0.013 seconds.
# # *** WRN: >>> { <openpype.hosts.maya.api.workfile_template_builder.MayaTemplateBuilder object at 0x00000246283CCF98> }: [ Failed to process placeholder |locator1|All_model_assets with plugin MayaPlaceholderLoadPlugin ] 
# ==============================
# 'LoadPlaceholderItem' object has no attribute '_scene_identifier'
# ==============================
# Traceback (most recent call last):
#   File "D:\REPO\OpenPype\openpype\pipeline\workfile\workfile_template_builder.py", line 586, in populate_scene_placeholders
#     placeholder_plugin.populate_placeholder(placeholder)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 208, in populate_placeholder
#     self.populate_load_placeholder(placeholder)
#   File "D:\REPO\OpenPype\openpype\pipeline\workfile\workfile_template_builder.py", line 1458, in populate_load_placeholder
#     self.cleanup_placeholder(placeholder, failed)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 223, in cleanup_placeholder
#     node = placeholder._scene_identifier
AttributeError: 'LoadPlaceholderItem' object has no attribute '_scene_identifier'

Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

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

the building process from template in Maya works as expected
image

there is just small issue with Maya implementation, will create a separate issue for it

# # *** WRN: >>> { <openpype.hosts.maya.api.workfile_template_builder.MayaTemplateBuilder object at 0x00000222E9AFE9B0> }: [ Failed to process placeholder |All_assets_grp|All_model_assets with plugin MayaPlaceholderLoadPlugin ] 
# ==============================
# No object matches name: |All_assets_grp|All_model_assets
# ==============================
# Traceback (most recent call last):
#   File "D:\REPO\OpenPype\openpype\pipeline\workfile\workfile_template_builder.py", line 585, in populate_scene_placeholders
#     placeholder_plugin.populate_placeholder(placeholder)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 208, in populate_placeholder
#     self.populate_load_placeholder(placeholder)
#   File "D:\REPO\OpenPype\openpype\pipeline\workfile\workfile_template_builder.py", line 1462, in populate_load_placeholder
#     self.load_succeed(placeholder, container)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 243, in load_succeed
#     self._parent_in_hierarchy(placeholder, container)
#   File "D:\REPO\OpenPype\openpype\hosts\maya\api\workfile_template_builder.py", line 277, in _parent_in_hierarchy
#     worldSpace=True
ValueError: No object matches name: |All_assets_grp|All_model_assets

@jakubjezek001
Copy link
Member Author

the building process from template in Maya works as expected
Thanks a lot for this in depth test!

Will create a separate issue for it
Definitelly. I am not Maya poweruser anymore ;)

"multipath": false
},
{
"key": "keep_placeholder",
Copy link
Member

Choose a reason for hiding this comment

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

This should be added only to nuke (the setting is there for maya too but does not affect the result).

Comment on lines +1058 to +1064
name = None
if hasattr("name", self):
name = self.name
if hasattr("_scene_identifier ", self):
name = self._scene_identifier

return "< {} {} >".format(self.__class__.__name__, name)
Copy link
Member

@iLLiCiTiT iLLiCiTiT Jan 6, 2023

Choose a reason for hiding this comment

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

Suggested change
name = None
if hasattr("name", self):
name = self.name
if hasattr("_scene_identifier ", self):
name = self._scene_identifier
return "< {} {} >".format(self.__class__.__name__, name)
return "< {} {} >".format(self.__class__.__name__, self._scene_identifier)

@jakubjezek001 jakubjezek001 merged commit 4f6ff40 into develop Jan 6, 2023
@jakubjezek001 jakubjezek001 deleted the feature/OP-4146_nuke-workfile-template-builder-add-creator-plugins branch January 6, 2023 11:50
@github-actions github-actions bot added this to the next-patch milestone Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Maya host: Nuke type: feature Larger, user affecting changes and completely new things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants