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

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubjezek001 committed Jan 6, 2023
1 parent d6004c2 commit c071140
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
25 changes: 15 additions & 10 deletions openpype/pipeline/workfile/workfile_template_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
load_with_repre_context,
)
from openpype.pipeline.create import (
get_legacy_creator_by_name,
discover_legacy_creator_plugins
)

Expand Down Expand Up @@ -439,7 +438,7 @@ def build_template(
template_path = template_preset["path"]

if keep_placeholders is None:
keep_placeholders = template_preset["placeholder_keep"]
keep_placeholders = template_preset["keep_placeholder"]

self.import_template(template_path)
self.populate_scene_placeholders(
Expand Down Expand Up @@ -673,10 +672,10 @@ def get_template_preset(self):
path = profile["path"]

# switch to remove placeholders after they are used
placeholder_keep = profile.get("placeholder_keep")
keep_placeholder = profile.get("keep_placeholder")
# backward compatibility, since default is True
if placeholder_keep is None:
placeholder_keep = True
if keep_placeholder is None:
keep_placeholder = True

if not path:
raise TemplateLoadFailed((
Expand Down Expand Up @@ -707,7 +706,7 @@ def get_template_preset(self):
self.log.info("Found template at: '{}'".format(path))
return {
"path": path,
"placeholder_keep": placeholder_keep
"keep_placeholder": keep_placeholder
}

solved_path = None
Expand Down Expand Up @@ -736,7 +735,7 @@ def get_template_preset(self):

return {
"path": solved_path,
"placeholder_keep": placeholder_keep
"keep_placeholder": keep_placeholder
}


Expand Down Expand Up @@ -991,7 +990,7 @@ class PlaceholderItem(object):

def __init__(self, scene_identifier, data, plugin):
self._log = None
self.name = scene_identifier
self._scene_identifier = scene_identifier
self._data = data
self._plugin = plugin

Expand Down Expand Up @@ -1056,7 +1055,13 @@ def log(self):
return self._log

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

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

@property
def order(self):
Expand All @@ -1069,7 +1074,7 @@ def order(self):

@property
def scene_identifier(self):
return self.name
return self._scene_identifier

@property
def finished(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"multipath": false
},
{
"key": "placeholder_keep",
"key": "keep_placeholder",
"label": "Keep placeholders",
"type": "boolean",
"default": true
Expand Down

0 comments on commit c071140

Please sign in to comment.