Moved check of existing MaterialX addon from bpy_hydra.py to material.cc and log warning only once. #83

Merged
Bogdan Nagirniak merged 3 commits from hydra-matx-check into hydra-render 2023-08-02 07:45:13 +02:00

Purpose

There are lot of warn logging when MaterialX addon doesn't exist. Moreover we don't plan to release it.

Technical steps

Added check of existing MaterialX addon to MaterialData::export_mtlx(), removed its checking from bpy_hydra.export_mtlx().
Made check and warn only once.

### Purpose There are lot of warn logging when [MaterialX addon](https://projects.blender.org/BogdanNagirniak/blender-addons/src/branch/materialx-addon) doesn't exist. Moreover we don't plan to release it. ### Technical steps Added check of existing MaterialX addon to `MaterialData::export_mtlx()`, removed its checking from `bpy_hydra.export_mtlx()`. Made check and warn only once.
Bogdan Nagirniak added 1 commit 2023-08-01 16:06:43 +02:00
Bogdan Nagirniak requested review from Brecht Van Lommel 2023-08-01 16:07:39 +02:00
Bogdan Nagirniak requested review from Brian Savery (AMD) 2023-08-01 16:07:39 +02:00
Bogdan Nagirniak requested review from Georgiy Markelov 2023-08-01 16:07:40 +02:00
Bogdan Nagirniak requested review from Vasyl Pidhirskyi 2023-08-01 16:07:40 +02:00
Brecht Van Lommel requested changes 2023-08-01 16:23:35 +02:00
@ -119,0 +122,4 @@
if (!matx_addon_checked) {
gstate = PyGILState_Ensure();
PyObject *mx_module = PyImport_ImportModule("materialx");
Collaborator

Can you add another if (!matx_addon_checked) after PyGILState_Ensure() to make this into a double checked lock? Not that it's likely to be a problem, but it's good practice anyway to make this fully correct.

Can you add another `if (!matx_addon_checked)` after `PyGILState_Ensure()` to make this into a double checked lock? Not that it's likely to be a problem, but it's good practice anyway to make this fully correct.
Georgiy Markelov approved these changes 2023-08-01 17:44:13 +02:00
Georgiy Markelov left a comment
Collaborator

Tested. Works fine.

Tested. Works fine.
Brian Savery (AMD) approved these changes 2023-08-01 20:14:38 +02:00
Bogdan Nagirniak added 2 commits 2023-08-02 02:22:26 +02:00
Bogdan Nagirniak requested review from Brecht Van Lommel 2023-08-02 02:23:00 +02:00
Brecht Van Lommel approved these changes 2023-08-02 03:31:37 +02:00
Bogdan Nagirniak merged commit 9a4656fe0e into hydra-render 2023-08-02 07:45:13 +02:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
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#83
No description provided.