Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPxSubSceneOverride not initialized when created and moved under dag instances

0 REPLIES 0
Reply
Message 1 of 1
maxime.robinot
152 Views, 0 Replies

MPxSubSceneOverride not initialized when created and moved under dag instances

Hello,

 

I found a bug in Maya2020.

Using the following code to create a dag instanced gpuCache node, it doesn't no appear in the viewport.

import maya.cmds as cmds
import maya.mel as mel
main_inst = cmds.createNode('transform', name='main_inst')
pkg = cmds.createNode('transform', name='pkg', p=main_inst)
cmds.select(main_inst)
mel.eval('instance;')
node = cmds.createNode('gpuCache')
cmds.setAttr(node + ".cacheFileName", pathToAnAbc, type="string")
parent = cmds.listRelatives(node, parent=True)[0]
cmds.parent(parent, 'pkg', relative=True)

Adding cmds.refresh() between the createNode() and parent() resolve the issue, but doing it after does not. So when loading a heavy scene, this is not a solution to call refresh() every time.

 

I was working on the maya-usd plugin, the pxrUsdProxyShape, and it has the same issue. Adding prints in the code, I could see that the constructor of the MPxSubSceneOverride implementation is not called. I guess the same happens for the gpuCache.

 

Any idea on how to force the initialization of the MPxSubSceneOverride implementation afterward ?

 

Thanks!

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums