-
Notifications
You must be signed in to change notification settings - Fork 1
add get publish families function #163
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
Open
moonyuet
wants to merge
24
commits into
enhancement/YN-0726--Custom-Frame-Range-Support-for-Local-Rendering
Choose a base branch
from
enhancement/implement_get_published_families_for_3dsmax
base: enhancement/YN-0726--Custom-Frame-Range-Support-for-Local-Rendering
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−46
Open
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
29e2c73
add get publish families function
moonyuet 38c340f
add custom.frame.range as families
moonyuet 263af34
Update client/ayon_max/api/plugin.py
moonyuet ced533e
Update client/ayon_max/api/plugin.py
moonyuet a268268
fix syntax error
moonyuet 41e0b0e
remove the duplicated code
moonyuet b826969
Update client/ayon_max/api/plugin.py
moonyuet dc60d89
Update client/ayon_max/api/plugin.py
moonyuet 0a79936
not to storing the publish_families during updating instances but ins…
moonyuet 7e7402f
pop the families data during the imprint data
moonyuet cc9af7c
pop the families data before the imprint data
moonyuet ef92bf8
Update client/ayon_max/api/plugin.py
moonyuet 91f641e
clean up
moonyuet 57eb83f
implement the imprint instance node
moonyuet 8c89f14
remove unused import
moonyuet 699f17a
return empty list for get_pre_create_attr_defs()
moonyuet d4a13eb
Update client/ayon_max/api/plugin.py
moonyuet 199abdb
Update client/ayon_max/api/plugin.py
moonyuet 34b6642
clean up the line
moonyuet 3ee228c
clean up the line
moonyuet c9d2b0f
add instance_data['families'] for general MaxCreator
moonyuet 4b98064
Update client/ayon_max/api/plugin.py
moonyuet 3430a3b
do not pop instance_node
moonyuet 12d4206
wrong camera argument for local rendering
moonyuet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ | |
| except ImportError: | ||
| rt = None | ||
|
|
||
|
|
||
| from ayon_core.lib import BoolDef | ||
| from ayon_core.pipeline import ( | ||
| CreatedInstance, | ||
|
|
@@ -357,6 +356,7 @@ def create(self, product_name, instance_data, pre_create_data): | |
|
|
||
| instance_node = self.create_instance_node(product_name) | ||
| instance_data["instance_node"] = instance_node.name | ||
| instance_data["families"] = self.get_published_families() | ||
| product_type = instance_data.get("productType") | ||
| if not product_type: | ||
| product_type = self.product_base_type | ||
|
|
@@ -385,16 +385,18 @@ def create(self, product_name, instance_data, pre_create_data): | |
| "sel_list", sel_list) | ||
|
|
||
| self._add_instance_to_context(instance) | ||
| imprint(instance_node.name, instance.data_to_store()) | ||
| self.imprint_instance_node(instance_node.name, instance.data_to_store()) | ||
|
Comment on lines
388
to
+389
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does indeed seem to be lacking. The publish families is lacking to be applied around line 358? |
||
|
|
||
| return instance | ||
|
|
||
| def collect_instances(self): | ||
| self.cache_instance_data(self.collection_shared_data) | ||
| for instance in self.collection_shared_data["max_cached_instances"].get(self.identifier, []): # noqa | ||
| created_instance = CreatedInstance.from_existing( | ||
| read(rt.GetNodeByName(instance)), self | ||
| ) | ||
| data = read(rt.GetNodeByName(instance)) | ||
| families = self.get_published_families() | ||
| if families: | ||
|
BigRoy marked this conversation as resolved.
|
||
| data["families"] = families | ||
| created_instance = CreatedInstance.from_existing(data, self) | ||
| self._add_instance_to_context(created_instance) | ||
|
|
||
| def update_instances(self, update_list): | ||
|
|
@@ -416,10 +418,7 @@ def update_instances(self, update_list): | |
| created_inst["instance_node"] = instance_node | ||
| node.name = instance_node | ||
|
|
||
| imprint( | ||
| instance_node, | ||
| created_inst.data_to_store(), | ||
| ) | ||
| self.imprint_instance_node(instance_node, created_inst.data_to_store()) | ||
|
|
||
| def remove_instances(self, instances): | ||
| """Remove specified instance from the scene. | ||
|
|
@@ -444,9 +443,16 @@ def get_pre_create_attr_defs(self): | |
| ] | ||
|
|
||
|
|
||
| class MaxCacheCreator(Creator, MaxTyFlowDataCreatorBase): | ||
| skip_discovery = True | ||
| settings_category = "max" | ||
| def get_published_families(self) -> list[str]: | ||
| return [] | ||
|
|
||
| def imprint_instance_node(self, node, data): | ||
| data.pop("instance_node", None) | ||
| data.pop("families", None) | ||
| return imprint(node, data) | ||
|
BigRoy marked this conversation as resolved.
|
||
|
|
||
|
|
||
| class MaxCacheCreator(MaxCreator, MaxTyFlowDataCreatorBase): | ||
|
|
||
| def create(self, product_name, instance_data, pre_create_data): | ||
| tyflow_op_nodes = get_tyflow_export_operators() | ||
|
|
@@ -455,6 +461,7 @@ def create(self, product_name, instance_data, pre_create_data): | |
| " found in tyCache Editor.") | ||
| instance_node = self.create_instance_node(product_name) | ||
| instance_data["instance_node"] = instance_node.name | ||
| instance_data["families"] = self.get_published_families() | ||
| product_type = instance_data.get("productType") | ||
| if not product_type: | ||
| product_type = self.product_base_type | ||
|
|
@@ -471,42 +478,10 @@ def create(self, product_name, instance_data, pre_create_data): | |
| instance_node.modifiers[0].AYONTyCacheData, | ||
| "tyc_handles", node_list) | ||
| self._add_instance_to_context(instance) | ||
| imprint(instance_node.name, instance.data_to_store()) | ||
| self.imprint_instance_node(instance_node.name, instance.data_to_store()) | ||
|
|
||
| return instance | ||
|
|
||
| def collect_instances(self): | ||
| self.cache_instance_data(self.collection_shared_data) | ||
| for instance in self.collection_shared_data["max_cached_instances"].get(self.identifier, []): # noqa | ||
| created_instance = CreatedInstance.from_existing( | ||
| read(rt.GetNodeByName(instance)), self | ||
| ) | ||
| self._add_instance_to_context(created_instance) | ||
|
|
||
| def update_instances(self, update_list): | ||
| for created_inst, changes in update_list: | ||
| instance_node = created_inst.get("instance_node") | ||
| new_values = { | ||
| key: changes[key].new_value | ||
| for key in changes.changed_keys | ||
| } | ||
| product_name = new_values.get("productName", "") | ||
| if product_name and instance_node != product_name: | ||
| node = rt.getNodeByName(instance_node) | ||
| new_product_name = new_values["productName"] | ||
| if rt.getNodeByName(new_product_name): | ||
| raise CreatorError( | ||
| "The product '{}' already exists.".format( | ||
| new_product_name)) | ||
| instance_node = new_product_name | ||
| created_inst["instance_node"] = instance_node | ||
| node.name = instance_node | ||
|
|
||
| imprint( | ||
| instance_node, | ||
| created_inst.data_to_store(), | ||
| ) | ||
|
|
||
| def remove_instances(self, instances): | ||
| """Remove specified instance from the scene. | ||
|
|
||
|
|
@@ -524,3 +499,6 @@ def remove_instances(self, instances): | |
| rt.Delete(instance_node) | ||
|
|
||
| self._remove_instance_from_context(instance) | ||
|
|
||
| def get_pre_create_attr_defs(self): | ||
| return [] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.