Skip to content

Commit

Permalink
EMSUSD-1521 modify AE section order
Browse files Browse the repository at this point in the history
- Accumulate all schemas and their attributes before creating any UI for them.
- Re-ordered schemas according to the design.
- Renamed Xformable to Transforms.
- Made all sections be collapsed by default except the prim type section, Light and Light type
- Removed the "Applied Schemas" section.
- Add a unit test and fix some tests that assumed sections would be
  expanded.
- Make all sections (except materials, which has a special logic) be
  re-orderable in the future.
- Update the documentation to reflect the changes.
  • Loading branch information
pierrebai-adsk committed Oct 24, 2024
1 parent a44df39 commit 96fd9a2
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,37 @@ The AE template has two functions to manage supressed attributes: `suppress`
supresses the given attribute. `suppressArrayAttribute` which supresses all
array attribute if the option to display is turned off.

The constructor of the AE template calls `buildUI` to fit each attribute in a
custom control. Afterward it calls the functions `createAppliedSchemasSection`,
`createCustomExtraAttrs` and `createMetadataSection` to create some UI sections
that are always present.

The `buildUI` function goes through each USD schema of the USD prim. If the
schema is one of the "well-known" ones that have a specialized UI section,
then that section gets created. For example, shader, transform and display each
have a specialized UI section.

If the schema is not a special one, then `buildUI` retrieves all attributes of
the schema and calls `createSection` to create the UI section that will contain
those attributes. `createSection` checks if the attribute is not supressed and
calls `addControls` to do the UI creation.

The `addControls` function goes through each custom control and ask each of them
to create the UI for the attributes. Once a custom control accepts to handle the
attribute, it calls `defineCustom` to register the custom control with Maya.
Afterward the attributes are added to the list of already handled attributes.
The AE template can then proceed to the next schema.
The constructor of the AE template calls a series of `find`-ing functions to
fit each attribute in a custom control or other special built-in sections.
Afterward it calls `orderSections` to choose the order in which the sections
will be added to the AE template. It then calls `createSchemasSections` to
create the section UI.

Each `find` function goes through the USD schemas of the USD prim. Some of
the `find` functinare looking for specific schemas. Other are looking for
applied schema or class schemas. A few are not looking at schemas at all
but are grabbing specific kind of attributes. Here are the `find` functions:

- findAppliedSchemas: find the attributes belonging to applied schemas.
- findClassSchemasL find the attributes belonging to the prim class schemas.
- findSpecialSections: find the shader, transforms and display attributes.

The `orderSections` function has a list of section it wishes to place first and
a list of sections it wishes to place last. It orders all the sections that were
found according to those lists. All remaining sections that are not forced to be
in a particular order are placed in between.

The `createSchemasSections` function takes the ordered sections and call the
correct function for each. There is a generic `createSection` to create the UI
for normal sections. There are a few special `create` functions for the special
sections, like shader, material, transforms, metadata, etc.

The `createSection` function checks if the attribute is not supressed and calls
`addControls` to do the UI creation. The `addControls` function goes through each
custom control creator and ask each of them to create the UI for the attributes.
Once a custom control accepts to handle the attribute, it calls `defineCustom`
to register the custom control with Maya. Afterward the attributes are added to
the list of already handled attributes.

## Custom Controls

Expand Down
Loading

0 comments on commit 96fd9a2

Please sign in to comment.