File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,17 @@ def RunCommand(self):
259
259
260
260
def IsEnabled (self ):
261
261
# Usd.Attribute.Clear operates only on specs with an existing authored default value at the current edit target
262
+ try :
263
+ # USD>=24.11
264
+ spec_getter = Usd .EditTarget .GetAttributeSpecForScenePath
265
+ except AttributeError :
266
+ # USD<24.11
267
+ # Usd.EditTarget.GetSpecForScenePath did not work on earlier usd versions. It was fixed in 24.11.
268
+ def spec_getter (edit_target , path ):
269
+ return edit_target .GetLayer ().GetAttributeAtPath (edit_target .MapToSpecPath (path ))
270
+
262
271
return super ().IsEnabled () and any (
263
- (spec := attr .GetStage ().GetEditTarget (). GetAttributeSpecForScenePath ( attr .GetPath ())) and spec .default
272
+ (spec := spec_getter ( attr .GetStage ().GetEditTarget (), attr .GetPath ())) and spec .default
264
273
for attr in self ._attributes
265
274
)
266
275
You can’t perform that action at this time.
0 commit comments