LumaPictures / maya-to-hydra

This repo is no longer updated. Please see https://github.com/Autodesk/maya-usd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sometimes unable to go back to "Viewport 2" renderer

pmolodo opened this issue · comments

Sometimes when I pick "Viewport 2.0" from the dropdown, nothing happens. Not sure of the exact cause of this, but I have a sequence which seems to reproduce it reliably for me. Note that I have to do it EXACTLY as laid out below - ie, using manual mouse clicks when indicated - or else I do not get the bug.

(I fear that the reason this works may be some sort of timing issue... and that most of these actions don't really do anything to cause the bug, but just take about the right amount of time? Perhaps something to do with the callback on a timer that deletes un-used hdmaya registered renderers?)

These replication notes are mostly for my own use - however, for completeness, the "Lily_rig_selectable_v0003.ma" scene I reference is based off of "Lily" rig, from Artella, available here:
https://artella.lpages.co/artella-lily-snout-giveaway/

I believe the only change I made was turning off draw overrides for the meshes, to make them click-selectable.

Anyway, to replicate the problem, I do this:

  • Launch maya
  • Run in script editor:
import maya.cmds as cmds

cmds.file("/Volumes/sv-dev01/devRepo/paulm/usd_samples/mtoh_ufe_demo/Lily_and_Snout/Lily/Lily_rig_selectable_v0003.ma", f=1, open=1)

import maya.cmds as cmds; cmds.loadPlugin("mtoh")
activePanel = cmds.playblast(ae=1)
mel.eval('setRendererAndOverrideInModelPanel $gViewport2 mtohRenderOverride_HdStreamRendererPlugin {};'.format(activePanel))
  • click-select GEO_GRP in the outliner

  • Go to File, Export Selection
    set these options (ones not listed are empty / off / None):

    • Shading Mode: mtoh
    • Materials Scope Name: Looks
    • Export DisplayColor primVar: ON
    • Export UVs: ON
    • Export ColorSets: ON
    • Export Visibility: ON
    • Strip Namespaces: ON
    • Render Layer Mode: Use Default layer
    • Compatibility Profile: Standard
    • Merge Transform and Shape Nodes: ON
    • Export Instances: ON
    • Default Mesh Scheme: CatmullClark SDiv

    export somewhere (I did "~/Desktop/test.usda")

  • click-select head

  • In viewport, click "Renderer" menu, change back to "Viewport 2.0"

  • Nothing happens - it stays on "GL (Hydra)"!

Just had this happen again when I disconnected a connection to a shader that was being translated (a phong, in this case... connection disconnected was to ambientColor, which isn't translated, but I don't think the callbacks are that fine-tuned.)