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

Commit

Permalink
maya.create_animation_pointcache Ensure there are `maya_cached_subs…
Browse files Browse the repository at this point in the history
…ets` in `collection_shared_data`

`maya_cached_subsets` might not exist at this time. It is run in
`collect_instances()` in `MayaHiddenCreator` but not here.
  • Loading branch information
Minkiu committed Jan 4, 2024
1 parent cd26a89 commit f2f8345
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions openpype/hosts/maya/plugins/create/create_animation_pointcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ class CreateAnimation(plugin.MayaHiddenCreator):
include_user_defined_attributes = False

def collect_instances(self):
cached_subsets = self.collection_shared_data["maya_cached_subsets"]
try:
cached_subsets = self.collection_shared_data["maya_cached_subsets"]
except KeyError:
self.cache_subsets(self.collection_shared_data)
cached_subsets = self.collection_shared_data["maya_cached_subsets"]

for node in cached_subsets.get(self.identifier, []):
node_data = self.read_instance_node(node)
_ensure_defaults(self, node_data)
Expand Down Expand Up @@ -259,7 +264,12 @@ class CreatePointCache(plugin.MayaCreator):
include_user_defined_attributes = False

def collect_instances(self):
cached_subsets = self.collection_shared_data["maya_cached_subsets"]
try:
cached_subsets = self.collection_shared_data["maya_cached_subsets"]
except KeyError:
self.cache_subsets(self.collection_shared_data)
cached_subsets = self.collection_shared_data["maya_cached_subsets"]

for node in cached_subsets.get(self.identifier, []):
node_data = self.read_instance_node(node)
_ensure_defaults(self, node_data)
Expand Down

0 comments on commit f2f8345

Please sign in to comment.