Skip to content

Ufe selection stops working if USD object set to inactive #6

@pmolodo

Description

@pmolodo

To reproduce, run this code, then note that you can't click on any ufe objects:

# Ufe selection stops working after item set to inactive

import maya.cmds as cmds
import maya.mel as mel
import pymel.core as pm

def safeLoadPlugin(plugin):
    if not cmds.pluginInfo(plugin, q=1, loaded=1):
        cmds.loadPlugin(plugin)
safeLoadPlugin('AL_USDMayaPlugin')
safeLoadPlugin('maya-ufe-cmd-plugin')
safeLoadPlugin('maya-ufe-usd-plugin')

cmds.file(f=1, new=1)
cmds.AL_usdmaya_ProxyShapeImport(file='/path/to/Kitchen_set/Kitchen_set.usd')
persp = pm.PyNode('persp')
persp.translate.set((55, -780, 525))
persp.rotate.set((52, 0, 0))
persp.getShape().centerOfInterest.set(771)
cmds.refresh()

import maya.cmds as cmds; cmds.loadPlugin("mtoh")
activePanel = cmds.playblast(ae=1)
mel.eval('setRendererAndOverrideInModelPanel $gViewport2 mtohRenderOverride_HdStreamRendererPlugin {};'.format(activePanel))

################

import AL.usdmaya
proxy = AL.usdmaya.ProxyShape.getByName('AL_usdmaya_ProxyShape')
stage = proxy.getUsdStage()
tableTopPath = "/Kitchen_set/Props_grp/DiningTable_grp/KitchenTable_1/Geom/Top"
tableTopPrim = stage.GetPrimAtPath(tableTopPath)
assert tableTopPrim.IsValid()

tableTopPrim.SetActive(False)

I suspect any edit to the usd scene would cause this, not just making something inactive, but haven't confirmed that...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions