Merge branch 'develop' into bugfix/houdini_creator_settings

This commit is contained in:
Fabia Serra Arrizabalaga 2023-08-09 15:24:47 +02:00
commit 6fe1093084
20 changed files with 43 additions and 138 deletions

View file

@ -196,47 +196,6 @@ def publish(paths, targets, gui):
PypeCommands.publish(list(paths), targets, gui)
@main.command()
@click.argument("path")
@click.option("-h", "--host", help="Host")
@click.option("-u", "--user", help="User email address")
@click.option("-p", "--project", help="Project")
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
def remotepublishfromapp(project, path, host, user=None, targets=None):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
"""
if AYON_SERVER_ENABLED:
raise RuntimeError(
"AYON does not support 'remotepublishfromapp' command."
)
PypeCommands.remotepublishfromapp(
project, path, host, user, targets=targets
)
@main.command()
@click.argument("path")
@click.option("-u", "--user", help="User email address")
@click.option("-p", "--project", help="Project")
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
def remotepublish(project, path, user=None, targets=None):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
"""
if AYON_SERVER_ENABLED:
raise RuntimeError("AYON does not support 'remotepublish' command.")
PypeCommands.remotepublish(project, path, user, targets=targets)
@main.command(context_settings={"ignore_unknown_options": True})
def projectmanager():
if AYON_SERVER_ENABLED:

View file

@ -15,7 +15,7 @@ class CloseAE(pyblish.api.ContextPlugin):
active = True
hosts = ["aftereffects"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
self.log.info("CloseAE")

View file

@ -136,6 +136,7 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData"
temp_arr = #()
for x in all_handles do
(
if x.node == undefined do continue
handle_name = node_to_name x.node
append temp_arr handle_name
)
@ -212,14 +213,19 @@ class MaxCreator(Creator, MaxCreatorBase):
if pre_create_data.get("use_selection"):
node_list = []
sel_list = []
for i in self.selected_nodes:
node_ref = rt.NodeTransformMonitor(node=i)
node_list.append(node_ref)
sel_list.append(str(i))
# Setting the property
rt.setProperty(
instance_node.modifiers[0].openPypeData,
"all_handles", node_list)
rt.setProperty(
instance_node.modifiers[0].openPypeData,
"sel_list", sel_list)
self._add_instance_to_context(instance)
imprint(instance_node.name, instance.data_to_store())

View file

@ -575,8 +575,8 @@ class ReferenceLoader(Loader):
raise LoadError("No namespace specified in "
"Maya ReferenceLoader settings")
elif not custom_naming['group_name']:
raise LoadError("No group name specified in "
"Maya ReferenceLoader settings")
self.log.debug("No custom group_name, no group will be created.")
options["attach_to_root"] = False
formatting_data = {
"asset_name": asset['name'],

View file

@ -9,7 +9,8 @@ from openpype.hosts.maya.api.lib import (
maintained_selection,
get_container_members,
parent_nodes,
create_rig_animation_instance
create_rig_animation_instance,
get_reference_node
)
@ -123,6 +124,10 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
attach_to_root = options.get("attach_to_root", True)
group_name = options["group_name"]
# no group shall be created
if not attach_to_root:
group_name = namespace
path = self.filepath_from_context(context)
with maintained_selection():
cmds.loadPlugin("AbcImport.mll", quiet=True)
@ -148,11 +153,10 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
if current_namespace != ":":
group_name = current_namespace + ":" + group_name
group_name = "|" + group_name
self[:] = new_nodes
if attach_to_root:
group_name = "|" + group_name
roots = cmds.listRelatives(group_name,
children=True,
fullPath=True) or []
@ -205,6 +209,11 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
self._post_process_rig(name, namespace, context, options)
else:
if "translate" in options:
if not attach_to_root and new_nodes:
root_nodes = cmds.ls(new_nodes, assemblies=True,
long=True)
# we assume only a single root is ever loaded
group_name = root_nodes[0]
cmds.setAttr("{}.translate".format(group_name),
*options["translate"])
return new_nodes

View file

@ -17,7 +17,7 @@ class ClosePS(pyblish.api.ContextPlugin):
active = True
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
self.log.info("ClosePS")

View file

@ -6,8 +6,6 @@ from openpype.pipeline.create import get_subset_name
class CollectAutoImage(pyblish.api.ContextPlugin):
"""Creates auto image in non artist based publishes (Webpublisher).
'remotepublish' should be renamed to 'autopublish' or similar in the future
"""
label = "Collect Auto Image"
@ -15,7 +13,7 @@ class CollectAutoImage(pyblish.api.ContextPlugin):
hosts = ["photoshop"]
order = pyblish.api.CollectorOrder + 0.2
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
family = "image"

View file

@ -20,7 +20,7 @@ class CollectAutoReview(pyblish.api.ContextPlugin):
label = "Collect Auto Review"
hosts = ["photoshop"]
order = pyblish.api.CollectorOrder + 0.2
targets = ["remotepublish"]
targets = ["automated"]
publish = True

View file

@ -12,7 +12,7 @@ class CollectAutoWorkfile(pyblish.api.ContextPlugin):
label = "Collect Workfile"
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
family = "workfile"

View file

@ -35,7 +35,7 @@ class CollectBatchData(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder - 0.495
label = "Collect batch data"
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["webpublish"]
def process(self, context):
self.log.info("CollectBatchData")

View file

@ -34,7 +34,7 @@ class CollectColorCodedInstances(pyblish.api.ContextPlugin):
label = "Instances"
order = pyblish.api.CollectorOrder
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
# configurable by Settings
color_code_mapping = []

View file

@ -26,7 +26,7 @@ class CollectPublishedVersion(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder + 0.190
label = "Collect published version"
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
workfile_subset_name = None

View file

@ -3,4 +3,4 @@ Webpublisher
Plugins meant for processing of Webpublisher.
Gets triggered by calling openpype.cli.remotepublish with appropriate arguments.
Gets triggered by calling `openpype_console modules webpublisher publish` with appropriate arguments.

View file

@ -270,7 +270,7 @@ def find_variant_key(application_manager, host):
def get_task_data(batch_dir):
"""Return parsed data from first task manifest.json
Used for `remotepublishfromapp` command where batch contains only
Used for `publishfromapp` command where batch contains only
single task with publishable workfile.
Returns:

View file

@ -34,7 +34,7 @@ def cli_publish(project_name, batch_path, user_email, targets):
Args:
project_name (str): project to publish (only single context is
expected per call of remotepublish
expected per call of 'publish')
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
user_email (string): email address for webpublisher - used to
@ -49,8 +49,8 @@ def cli_publish(project_name, batch_path, user_email, targets):
if not batch_path:
raise RuntimeError("No publish paths specified")
log = Logger.get_logger("remotepublish")
log.info("remotepublish command")
log = Logger.get_logger("Webpublish")
log.info("Webpublish command")
# Register target and host
webpublisher_host = WebpublisherHost()
@ -107,7 +107,7 @@ def cli_publish_from_app(
Args:
project_name (str): project to publish (only single context is
expected per call of remotepublish
expected per call of publish
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
host_name (str): 'photoshop'
@ -117,9 +117,9 @@ def cli_publish_from_app(
(to choose validator for example)
"""
log = Logger.get_logger("RemotePublishFromApp")
log = Logger.get_logger("PublishFromApp")
log.info("remotepublishphotoshop command")
log.info("Webpublish photoshop command")
task_data = get_task_data(batch_path)

View file

@ -216,7 +216,7 @@ class BatchPublishEndpoint(WebpublishApiEndpoint):
"extensions": [".tvpp"],
"command": "publish",
"arguments": {
"targets": ["tvpaint_worker"]
"targets": ["tvpaint_worker", "webpublish"]
},
"add_to_queue": False
},
@ -230,7 +230,7 @@ class BatchPublishEndpoint(WebpublishApiEndpoint):
# Make sure targets are set to None for cases that default
# would change
# - targets argument is not used in 'publishfromapp'
"targets": ["remotepublish"]
"targets": ["automated", "webpublish"]
},
# does publish need to be handled by a queue, eg. only
# single process running concurrently?
@ -247,7 +247,7 @@ class BatchPublishEndpoint(WebpublishApiEndpoint):
"project": content["project_name"],
"user": content["user"],
"targets": ["filespublish"]
"targets": ["filespublish", "webpublish"]
}
add_to_queue = False

View file

@ -45,7 +45,7 @@ def run_webserver(executable, upload_dir, host=None, port=None):
server_manager = webserver_module.create_new_server_manager(port, host)
webserver_url = server_manager.url
# queue for remotepublishfromapp tasks
# queue for publishfromapp tasks
studio_task_queue = collections.deque()
resource = RestApiResource(server_manager,

View file

@ -33,7 +33,7 @@ class CollectUsernameForWebpublish(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder + 0.0015
label = "Collect ftrack username"
hosts = ["webpublisher", "photoshop"]
targets = ["remotepublish", "filespublish", "tvpaint_worker"]
targets = ["webpublish"]
def process(self, context):
self.log.info("{}".format(self.__class__.__name__))

View file

@ -165,74 +165,6 @@ class PypeCommands:
log.info("Publish finished.")
@staticmethod
def remotepublishfromapp(project_name, batch_path, host_name,
user_email, targets=None):
"""Opens installed variant of 'host' and run remote publish there.
Eventually should be yanked out to Webpublisher cli.
Currently implemented and tested for Photoshop where customer
wants to process uploaded .psd file and publish collected layers
from there. Triggered by Webpublisher.
Checks if no other batches are running (status =='in_progress). If
so, it sleeps for SLEEP (this is separate process),
waits for WAIT_FOR seconds altogether.
Requires installed host application on the machine.
Runs publish process as user would, in automatic fashion.
Args:
project_name (str): project to publish (only single context is
expected per call of remotepublish
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
host_name (str): 'photoshop'
user_email (string): email address for webpublisher - used to
find Ftrack user with same email
targets (list): Pyblish targets
(to choose validator for example)
"""
from openpype.hosts.webpublisher.publish_functions import (
cli_publish_from_app
)
cli_publish_from_app(
project_name, batch_path, host_name, user_email, targets
)
@staticmethod
def remotepublish(project, batch_path, user_email, targets=None):
"""Start headless publishing.
Used to publish rendered assets, workfiles etc via Webpublisher.
Eventually should be yanked out to Webpublisher cli.
Publish use json from passed paths argument.
Args:
project (str): project to publish (only single context is expected
per call of remotepublish
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
user_email (string): email address for webpublisher - used to
find Ftrack user with same email
targets (list): Pyblish targets
(to choose validator for example)
Raises:
RuntimeError: When there is no path to process.
"""
from openpype.hosts.webpublisher.publish_functions import (
cli_publish
)
cli_publish(project, batch_path, user_email, targets)
@staticmethod
def extractenvironments(output_json_path, project, asset, task, app,
env_group):

View file

@ -113,7 +113,8 @@ This is useful to fix some specific renderer glitches and advanced hacking of Ma
#### Namespace and Group Name
Here you can create your own custom naming for the reference loader.
The custom naming is split into two parts: namespace and group name. If you don't set the namespace or the group name, an error will occur.
The custom naming is split into two parts: namespace and group name. If you don't set the namespace, an error will occur.
Group name could be set empty, that way no wrapping group will be created for loaded item.
Here's the different variables you can use:
<div class="row markdown">