resolve conflict

This commit is contained in:
Kayla Man 2023-08-07 15:41:47 +08:00
commit a185ebd759
7 changed files with 45 additions and 28 deletions

View file

@ -35,6 +35,7 @@ body:
label: Version
description: What version are you running? Look to OpenPype Tray
options:
- 3.16.3-nightly.4
- 3.16.3-nightly.3
- 3.16.3-nightly.2
- 3.16.3-nightly.1
@ -134,7 +135,6 @@ body:
- 3.14.7-nightly.5
- 3.14.7-nightly.4
- 3.14.7-nightly.3
- 3.14.7-nightly.2
validations:
required: true
- type: dropdown

View file

@ -186,7 +186,10 @@ class MaxCreatorBase(object):
node = rt.Container(name=node)
attrs = rt.Execute(MS_CUSTOM_ATTRIB)
rt.custAttributes.add(node.baseObject, attrs)
modifier = rt.EmptyModifier()
rt.addModifier(node, modifier)
node.modifiers[0].name = "OP Data"
rt.custAttributes.add(node.modifiers[0], attrs)
return node
@ -218,9 +221,9 @@ class MaxCreator(Creator, MaxCreatorBase):
# Setting the property
rt.setProperty(
instance_node.openPypeData, "all_handles", node_list)
instance_node.modifiers[0].openPypeData, "all_handles", node_list)
rt.setProperty(
instance_node.openPypeData, "sel_list", sel_list)
instance_node.modifiers[0].openPypeData, "sel_list", sel_list)
self._add_instance_to_context(instance)
imprint(instance_node.name, instance.data_to_store())
@ -259,8 +262,8 @@ class MaxCreator(Creator, MaxCreatorBase):
instance_node = rt.GetNodeByName(
instance.data.get("instance_node"))
if instance_node:
count = rt.custAttributes.count(instance_node)
rt.custAttributes.delete(instance_node, count)
count = rt.custAttributes.count(instance_node.modifiers[0])
rt.custAttributes.delete(instance_node.modifiers[0], count)
rt.Delete(instance_node)
self._remove_instance_from_context(instance)

View file

@ -17,6 +17,6 @@ class CollectMembers(pyblish.api.InstancePlugin):
container = rt.GetNodeByName(instance.data["instance_node"])
instance.data["members"] = [
member.node for member
in container.openPypeData.all_handles
in container.modifiers[0].openPypeData.all_handles
]
self.log.debug("{}".format(instance.data["members"]))

View file

@ -424,10 +424,13 @@ def add_publish_knob(node):
return node
@deprecated
@deprecated("openpype.hosts.nuke.api.lib.set_node_data")
def set_avalon_knob_data(node, data=None, prefix="avalon:"):
"""[DEPRECATED] Sets data into nodes's avalon knob
This function is still used but soon will be deprecated.
Use `set_node_data` instead.
Arguments:
node (nuke.Node): Nuke node to imprint with data,
data (dict, optional): Data to be imprinted into AvalonTab
@ -487,10 +490,13 @@ def set_avalon_knob_data(node, data=None, prefix="avalon:"):
return node
@deprecated
@deprecated("openpype.hosts.nuke.api.lib.get_node_data")
def get_avalon_knob_data(node, prefix="avalon:", create=True):
"""[DEPRECATED] Gets a data from nodes's avalon knob
This function is still used but soon will be deprecated.
Use `get_node_data` instead.
Arguments:
node (obj): Nuke node to search for data,
prefix (str, optional): filtering prefix
@ -2204,7 +2210,6 @@ Reopening Nuke should synchronize these paths and resolve any discrepancies.
continue
preset_clrsp = input["colorspace"]
log.debug(preset_clrsp)
if preset_clrsp is not None:
current = n["colorspace"].value()
future = str(preset_clrsp)
@ -2686,7 +2691,15 @@ def _launch_workfile_app():
host_tools.show_workfiles(parent=None, on_top=True)
@deprecated("openpype.hosts.nuke.api.lib.start_workfile_template_builder")
def process_workfile_builder():
""" [DEPRECATED] Process workfile builder on nuke start
This function is deprecated and will be removed in future versions.
Use settings for `project_settings/nuke/templated_workfile_build` which are
supported by api `start_workfile_template_builder()`.
"""
# to avoid looping of the callback, remove it!
nuke.removeOnCreate(process_workfile_builder, nodeClass="Root")
@ -2695,11 +2708,6 @@ def process_workfile_builder():
workfile_builder = project_settings["nuke"].get(
"workfile_builder", {})
# get all imortant settings
openlv_on = env_value_to_bool(
env_key="AVALON_OPEN_LAST_WORKFILE",
default=None)
# get settings
createfv_on = workfile_builder.get("create_first_version") or None
builder_on = workfile_builder.get("builder_on_start") or None
@ -2740,20 +2748,15 @@ def process_workfile_builder():
save_file(last_workfile_path)
return
# skip opening of last version if it is not enabled
if not openlv_on or not os.path.exists(last_workfile_path):
return
log.info("Opening last workfile...")
# open workfile
open_file(last_workfile_path)
def start_workfile_template_builder():
from .workfile_template_builder import (
build_workfile_template
)
# remove callback since it would be duplicating the workfile
nuke.removeOnCreate(start_workfile_template_builder, nodeClass="Root")
# to avoid looping of the callback, remove it!
log.info("Starting workfile template builder...")
try:
@ -2761,8 +2764,6 @@ def start_workfile_template_builder():
except TemplateProfileNotFound:
log.warning("Template profile not found. Skipping...")
# remove callback since it would be duplicating the workfile
nuke.removeOnCreate(start_workfile_template_builder, nodeClass="Root")
@deprecated
def recreate_instance(origin_node, avalon_data=None):

View file

@ -34,6 +34,7 @@ from .lib import (
get_main_window,
add_publish_knob,
WorkfileSettings,
# TODO: remove this once workfile builder will be removed
process_workfile_builder,
start_workfile_template_builder,
launch_workfiles_app,
@ -155,11 +156,18 @@ def add_nuke_callbacks():
"""
nuke_settings = get_current_project_settings()["nuke"]
workfile_settings = WorkfileSettings()
# Set context settings.
nuke.addOnCreate(
workfile_settings.set_context_settings, nodeClass="Root")
# adding favorites to file browser
nuke.addOnCreate(workfile_settings.set_favorites, nodeClass="Root")
# template builder callbacks
nuke.addOnCreate(start_workfile_template_builder, nodeClass="Root")
# TODO: remove this callback once workfile builder will be removed
nuke.addOnCreate(process_workfile_builder, nodeClass="Root")
# fix ffmpeg settings on script
@ -169,11 +177,12 @@ def add_nuke_callbacks():
nuke.addOnScriptLoad(check_inventory_versions)
nuke.addOnScriptSave(check_inventory_versions)
# # set apply all workfile settings on script load and save
# set apply all workfile settings on script load and save
nuke.addOnScriptLoad(WorkfileSettings().set_context_settings)
if nuke_settings["nuke-dirmap"]["enabled"]:
log.info("Added Nuke's dirmaping callback ...")
log.info("Added Nuke's dir-mapping callback ...")
# Add dirmap for file paths.
nuke.addFilenameFilter(dirmap_file_name_filter)

View file

@ -284,6 +284,10 @@
"type": "schema_template",
"name": "template_workfile_options"
},
{
"type": "label",
"label": "^ Settings and for <span style=\"color:#FF0000\";><b>Workfile Builder</b></span> is deprecated and will be soon removed. <br> Please use <b>Template Workfile Build Settings</b> instead."
},
{
"type": "schema",
"name": "schema_templated_workfile_build"

View file

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring Pype version."""
__version__ = "3.16.3-nightly.3"
__version__ = "3.16.3-nightly.4"