@@ -258,7 +258,6 @@ def process(self, instance):
258
258
# Parse export options
259
259
options = self .default_options
260
260
options = self .parse_overrides (instance , options )
261
- self .log .debug ("Export options: {0}" .format (options ))
262
261
263
262
# Perform extraction
264
263
self .log .debug ("Performing extraction ..." )
@@ -343,6 +342,23 @@ def parse_attr_str(attr_str):
343
342
)
344
343
del options [key ]
345
344
345
+ # Fix default prim bug in Maya USD 0.30.0 where prefixed `|` remains
346
+ # See: https://github.com/Autodesk/maya-usd/issues/3991
347
+ if (
348
+ options .get ("exportRoots" ) # only if roots are defined
349
+ and "defaultPrim" not in options # ignore if already set
350
+ and "rootPrim" not in options # ignore if root is created
351
+ and maya_usd_version == (0 , 30 , 0 ) # only for Maya USD 0.30.0
352
+ ):
353
+ # Define the default prim name as it will end up in the USD file
354
+ # from the first export root node
355
+ first_root = options ["exportRoots" ][0 ]
356
+ default_prim = first_root .rsplit ("|" , 1 )[- 1 ]
357
+ if options ["stripNamespaces" ]:
358
+ default_prim = default_prim .rsplit (":" , 1 )[- 1 ]
359
+ options ["defaultPrim" ] = default_prim
360
+
361
+ self .log .debug ("Export options: {0}" .format (options ))
346
362
self .log .debug ('Exporting USD: {} / {}' .format (file_path , members ))
347
363
with maintained_time ():
348
364
with maintained_selection ():
0 commit comments