Force Visibility attr?

   1797   4   2
User Avatar
Member
235 posts
Joined: Oct. 2014
Offline
USDs options for visibility are "Inherited" and "Invisible"... Is there a way to force a prim to just be "visible"?
- Tim Crowson
Technical/CG Supervisor
User Avatar
Staff
451 posts
Joined: June 2020
Offline
Yes and no

I'll start with "no". USD treats invisibility as a pruning operation, so if /root/world/truckis flagged as invisible, then it won't even look at anything under it (i.e., /root/world/truck/geo/alwaysShowMePrettyPleasemight as well not even exist). So as far as attributes go, it really is only "invisible" or "inherit".

But now "yes". Let's say you have this:
/root
/world
/truck - INVISIBLE
/ geo1
/ geo2
/ geo3 - WANT TO MAKE THIS VISIBLE

The invisibility can be shuffled downwards like this:
/root
/world
/truck
/ geo1 - INVISIBLE
/ geo2 - INVISIBLE
/ geo3

This functionality is provided in UsdGeomImageable::MakeVisible()(https://graphics.pixar.com/usd/docs/api/class_usd_geom_imageable.html#af47f609f24c8023ddacc6d216eaef0f3)

I don't currently have strong opinions on if/how this could/should be exposed to users (other than I do think it's a bit strange as a new user that you can't flag a primitive as visible), but you can definitely run this via a Python LOP.
User Avatar
Member
235 posts
Joined: Oct. 2014
Offline
Thanks, Rob. I'll check that out.

In my case I'm dealing with the possibility that an upstream department may be animating visiblity (e.g. as animated vis in an alembic file for instance, whose animation gets layered onto the object in the stage), and for whatever reason we may need to override this downstream.

In my case, it's more like I have this:

/root
  /world
    /truck - INVISIBLE, AS INHERITED FROM THE ANIM THAT IS LAYERED ONTO IT (AND I WANT TO OVERRIDE THIS TO FORCE VIS)
      / geo1
      / geo2
      / geo3

I'll take a look at UsdGeomImageable::MakeVisible(). That sounds simple enough.
Edited by Tim Crowson - April 9, 2021 11:53:45
- Tim Crowson
Technical/CG Supervisor
User Avatar
Staff
451 posts
Joined: June 2020
Offline
Let's make sure there's no misunderstanding about "inherited" in this context. It doesn't relate to layering but, rather, scene hierarchy. So as long as /root/worldisn't invisible, then you just need to ensure the strongest visibility opinion on /root/world/truckis set to "inherited" and not "invisible".
User Avatar
Member
235 posts
Joined: Oct. 2014
Offline
Yeah that was my understanding, I am just not sure about the opinion strength of the anim being layered in, and since I may not have control over that strength, I was wondering if there was way to override it.
- Tim Crowson
Technical/CG Supervisor
  • Quick Links