Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized repr update, wireframe and BBox display, proxy transformation and visibility #112

Conversation

huidong-chen
Copy link

@huidong-chen huidong-chen commented Nov 12, 2019

@huidong-chen huidong-chen changed the title Chenh/wireframe bbox reprs and proxy transformation visibility Wireframe and BBox diplay, proxy transformation and visibility, optimized representation update Nov 12, 2019
@huidong-chen huidong-chen changed the title Wireframe and BBox diplay, proxy transformation and visibility, optimized representation update Wireframe and BBox display, proxy transformation and visibility, optimized representation update Nov 12, 2019
@huidong-chen huidong-chen changed the title Wireframe and BBox display, proxy transformation and visibility, optimized representation update Optimized repr update, wireframe and BBox display, proxy transformation and visibility Nov 12, 2019
Copy link

@kxl-adsk kxl-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already reviewed it internally.

@cfmoore007
Copy link

cfmoore007 commented Nov 12, 2019

Thanks for the updates !

Here are my results :

#70 ( hiding proxy shape) still does not work for me.
HidingDoesNotWork

It only seems to work after I do a ogs -reset
ogsReset

However, I can confirm the following work:

  • boundingBox
  • wireframe
  • wireframe on shaded
  • moving the proxy updates in the viewport ( along with associated selections )

@cfmoore007
Copy link

AL Unit test works in UI, but crashes in prompt mode :
`mel: loadPlugin AL_USDMayaTestPlugin
VP2_RENDER_DELEGATE_PROXY is overridden to 'true'. Default is 'false'.
Stack trace:
OGSMayaVertexBuffer::createOGSVertexBuffer(unsigned int, OGS::Devices::AVertexFormat*, bool, OGS::Devices::EResourceUsage)
OGSMayaVertexBuffer::acquire(unsigned int, unsigned int, unsigned int, OGS::Devices::EAccessFlags)
pxrInternal_v0_19__pxrReserved__::HdVP2BBoxGeom::HdVP2BBoxGeom()
maya_usd/0.1.0.bss.7.dev/base_platform-maya2019-dist-up2.1.bss0/USD-19.11.bss.0/plugin/al/plugin/../../../lib/libmayaUsd.so(+0x67b7e) [0x7f1dc2ddeb7e]
/lib64/ld-linux-x86-64.so.2(+0xf8f3) [0x7f1ebcfdd8f3]
/lib64/ld-linux-x86-64.so.2(+0x144ce) [0x7f1ebcfe24ce]
/lib64/ld-linux-x86-64.so.2(+0xf704) [0x7f1ebcfdd704]
/lib64/ld-linux-x86-64.so.2(+0x13abb) [0x7f1ebcfe1abb]
/lib64/libdl.so.2(+0xeeb) [0x7f1ea78dceeb]
/lib64/ld-linux-x86-64.so.2(+0xf704) [0x7f1ebcfdd704]
/lib64/libdl.so.2(+0x14ed) [0x7f1ea78dd4ed]
dlopen
TdynamicLoad::open(char const*, TdynamicLoad::TdynamicLoadMode)
Tplugin::primaryLoad(Tstring const&, Tstring*)
Tplugin::load(Tstring const&, Tstring*)
maya2019-dist-up2.1/lib/libOpenMaya.so(+0x463dd5) [0x7f1e71b2edd5]
maya2019-dist-up2.1/lib/libOpenMaya.so(+0x46480d) [0x7f1e71b2f80d]
maya2019-dist-up2.1/lib/libOpenMaya.so(+0x465446) [0x7f1e71b30446]
maya2019-dist-up2.1/lib/libCommandEngine.so(+0x589d4) [0x7f1ebab9d9d4]
maya2019-dist-up2.1/lib/libCommandEngine.so(+0x82ec1) [0x7f1ebabc7ec1]
maya2019-dist-up2.1/lib/libCommandEngine.so(+0x83091) [0x7f1ebabc8091]
SophiaExecutable::evaluate(void*)
TcommandEngine::executeCommand(Tstring const&, bool, bool, TmelCmdResult*, unsigned int)
Tapplication::start()
maya2019-dist-up2.1/bin/maya.bin() [0x40e236]
maya2019-dist-up2.1/bin/maya.bin() [0x40caa6]
__libc_start_main
maya2019-dist-up2.1/bin/maya.bin() [0x40caf5]

Result: untitled.ma
`

@huidong-chen
Copy link
Author

@cfmoore007 Thanks a lot for such quickly feedback.

For visibility, could you add some repro steps?

For the crash, it is one of the crash I hit and fixed on Windows. Let me see if it is still there on Linux.

@cfmoore007
Copy link

cfmoore007 commented Nov 12, 2019

@HdC-adsk : here you go ...

  1. load attached 3_Spheres.zip example
  2. select proxy shape ( transform or shape )
  3. ctrl-h to hide
  4. ( notice it is not hidden )
  5. ogs -reset
  6. ( notice it's now hidden )

@cfmoore007
Copy link

side note : this also seems to fix the crash - #69

However, it still does not show the duplicate proxyShape's stage. Will log that after this is merged

@huidong-chen
Copy link
Author

I don't think it will fix the crash of duplicating proxy shape. It should have been fixed by some other change from @ppt-adsk. @ppt-adsk , has your fix merged to public dev?

@kxl-adsk
Copy link

Duplicate crash - the complete fix has not been merged in yet.

@huidong-chen
Copy link
Author

@cfmoore007 I can reproduce the hiding issue. It can work if you hit "h" without ctrl, I am investigating the difference between h and Ctrl-h.

For the crash at HdVP2BBoxGeom, is there a repro step for me as well?

@cfmoore007
Copy link

cfmoore007 commented Nov 12, 2019

Hiding :

  • confirmed - 'h' works.

For the crash :

  • load maya in prompt mode
  • loadPlugin AL_USDMayaTestPlugin
  • crash

@huidong-chen
Copy link
Author

@cfmoore007 Thanks for confirm.

I tried this command below and saw no crash.
maya -batch -command "loadPlugin AL_USDMayaTestPlugin"

How do you load maya in prompt mode? It looks like you can do it with two separate steps.

@cfmoore007
Copy link

It crashes here with the command you provided and in maya -prompt ( interactive ) and via -command.
Digging deeper over here ..

@huidong-chen
Copy link
Author

Hi @cfmoore007 ,

I am creating a branch with a potential fix (as I cannot reproduce it I cannot confirm). I will push it later and ask for your help to confirm. Appreciated as always.

@home3d2001
Copy link
Contributor

@cfmoore007 do you see this crash on other platforms e.g ( Windows or MacOSx )? Could be Linux specific.

@huidong-chen
Copy link
Author

@kxl-adsk The new commit is to fix the crash in AL unit test crash in Maya prompt mode and the hiding issue (H works but Ctrl+H didn't).

@@ -364,6 +364,13 @@ void HdVP2Mesh::Sync(
HdDirtyBits* dirtyBits,
const TfToken& reprToken)
{
// We don't create a repr for the selection token because this token serves
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an optimization in Hydra that would skip sync if a Rprim is invisible and has no visibility dirty bit:

https://github.com/PixarAnimationStudios/USD/blob/4b1162957b2ad219e1635c81de8343be490e41fc/pxr/imaging/lib/hd/rprim.cpp#L71

Due to this optimization, if we have a selection update before regular refresh, the scene dirty bit gets cleared in selection update and no sync can be invoked for the hiding proxy. Thus we need the earlier return for the selection update to reserver the scene dirty bits.

_sceneDelegate->SetRootVisibility(isVisible);

// Trigger selection update when a hidden proxy shape gets shown.
if (isVisible) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trigger the selection update when an invisible proxy gets shown. To make this change, I also make the explicit check to see whether there is visibility change (which is checked inside SetRootVisibility() as well).

To make code consistent, I also refactored root transform part, a side benefit of this is the matrix comparison is done by approximation (GfIsClose) rather than equality. This is a TODO item inside SetRootTransform().

FWIW, we shouldn't do similar code change to skip SetTime() call when the time code is equivalent. SetTime() will apply pending edits before its internal time equality check.

// future we should move this code out.
if (TF_VERIFY(sSharedBBoxGeom == nullptr)) {
sSharedBBoxGeom = new HdVP2BBoxGeom();
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't repro the crash in AL unit test crash in Maya prompt mode. The callstack appears to indicate HdVP2BBoxGeom was instantiated before VP2 initialization. Thus I make this change to make sure it is instantiated after VP2 initialization.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AND @cfmoore007 helped to validate the fix before I pushing the commit.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@cfmoore007
Copy link

Just re-tested this PR. Looks like everything came through successfully :

  • unit test passes ( no crash in batch or prompt mode )
  • ctrl-h now properly hides the proxyShape ( toggle 'h' as well )
  • bounding box and wireframe modes also still work and are addressed here.

Thanks for the quick turn-around @HdC-adsk !

@huidong-chen
Copy link
Author

@cfmoore007 Thanks for retesting and feedback as fast as always. Very much appreciated!

@huidong-chen huidong-chen merged commit 247677c into dev Nov 13, 2019
@huidong-chen huidong-chen deleted the chenh/wireframe-bbox-reprs-and-proxy-transformation-visibility branch November 13, 2019 21:25
pmolodo pushed a commit to LumaPictures/maya-usd that referenced this pull request Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants