I don't think that's a one-button thing.
Try this:
import maya.cmds as mc
# Get selected leaf shapes (so we can filter to gpuCaches)
selShapes = mc.ls(sl=1, dag=1, leaf=1, shapes=1, long=True)
# Filter to gpuCache (doesn't work as one-liner above)
gpuCacheShapes = mc.ls(selShapes, long=True, type='gpuCache')
for gpuCacheShape in gpuCacheShapes:
transform = mc.listRelatives(gpuCacheShape, parent=True, fullPath=True)[
0]
filepath = mc.getAttr(gpuCacheShape + '.cacheFileName')
# Import everything from filepath and reparent under the transform
mc.AbcImport(filepath, mode="import", reparent=transform)
# Hide the original gpuCache shape?
mc.setAttr(gpuCacheShape + '.visibility', 0)
#(Or delete it?)
#mc.delete(gpuCacheShape)
On Thursday, October 29, 2015 at 9:34:45 PM UTC+1, AK Eric wrote:
>
> Just exported some high-res scan mesh via the GPU Cache menu, then had a
> modeler import that back into their scene as a GPU cache for modeling
> reference.
>
> They moved it in worldspace, and now want to to 'turn it back into normal
> (editable) mesh' at that new location. I figured this would be a
> no-brainer, but I can't find any menu to do this.
>
> Am I missing something? :)
>
> thanks
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/11527c69-b022-4970-bff0-d12d1b4f2c95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.