Refactor code after PR #57 #67

Merged
Bogdan Nagirniak merged 9 commits from hydra-object_data-refactor into hydra-render 2023-07-20 22:34:34 +02:00

Purpose

Some code has to be refactored after #57:

  • Remove unused code
  • Improve structure of ID classes
    This is preparation for instancing curves and volumes.

Technical steps

  1. Improved structure of classes IdData and ObjectData, adjusted child classes.
  2. Changed inheritance: WorldData: LightData.
  3. Added ObjectData::get_or_create_material(), simplified child classes.
  4. Removed unused code.
  5. Improved logging.
  6. Fixed crash with MaterialPreview.
### Purpose Some code has to be refactored after https://projects.blender.org/BogdanNagirniak/blender/pulls/57: - Remove unused code - Improve structure of ID classes This is preparation for instancing curves and volumes. ### Technical steps 1. Improved structure of classes `IdData` and `ObjectData`, adjusted child classes. 2. Changed inheritance: `WorldData: LightData`. 3. Added `ObjectData::get_or_create_material()`, simplified child classes. 4. Removed unused code. 5. Improved logging. 6. Fixed crash with `MaterialPreview`.
Bogdan Nagirniak self-assigned this 2023-07-17 21:22:06 +02:00
Brian Savery (AMD) was assigned by Bogdan Nagirniak 2023-07-17 21:22:06 +02:00
Georgiy Markelov was assigned by Bogdan Nagirniak 2023-07-17 21:22:06 +02:00
Vasyl Pidhirskyi was assigned by Bogdan Nagirniak 2023-07-17 21:22:06 +02:00
Bogdan Nagirniak added 7 commits 2023-07-17 21:22:29 +02:00
Bogdan Nagirniak requested review from Brian Savery (AMD) 2023-07-17 21:22:38 +02:00
Bogdan Nagirniak requested review from Georgiy Markelov 2023-07-17 21:22:39 +02:00
Bogdan Nagirniak requested review from Vasyl Pidhirskyi 2023-07-17 21:22:39 +02:00
Bogdan Nagirniak added 1 commit 2023-07-18 13:41:47 +02:00
Georgiy Markelov requested changes 2023-07-18 15:49:56 +02:00
Georgiy Markelov left a comment
Collaborator

See comment.

See comment.
@ -104,3 +104,3 @@
}
pxr::VtValue VolumeData::get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const
pxr::VtValue VolumeData::get_data(pxr::TfToken const &key) const
Collaborator

Must be get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const since id here is field name.

Also change back prim_id.GetName(); -> id.GetName();

Must be `get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const` since `id` here is field name. Also change back `prim_id.GetName();` -> `id.GetName();`
Author
Owner

No, VolumeData::get_data(pxr::TfToken const &key) should be here. By default

pxr::VtValue ObjectData::get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const
{
  return get_data(key);
}
No, `VolumeData::get_data(pxr::TfToken const &key)` should be here. By default ``` pxr::VtValue ObjectData::get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const { return get_data(key); } ```
Author
Owner

Yes, you are right. Fixed.

Yes, you are right. Fixed.
BogdanNagirniak marked this conversation as resolved
Bogdan Nagirniak added 1 commit 2023-07-18 17:02:55 +02:00
Vasyl Pidhirskyi approved these changes 2023-07-19 15:03:59 +02:00
Vasyl Pidhirskyi left a comment
Collaborator

Approved.

Approved.
Georgiy Markelov approved these changes 2023-07-19 15:30:33 +02:00
Georgiy Markelov left a comment
Collaborator

Works fine.

Works fine.
Brian Savery (AMD) approved these changes 2023-07-20 21:00:42 +02:00
Bogdan Nagirniak merged commit 35ed6dbbda into hydra-render 2023-07-20 22:34:34 +02:00
Sign in to join this conversation.
No Label
No Milestone
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: BogdanNagirniak/blender#67
No description provided.