forked from blender/blender
Moved check of existing MaterialX addon from bpy_hydra.py to material.cc and log warning only once. #83
Labels
No Label
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: BogdanNagirniak/blender#83
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "hydra-matx-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 frombpy_hydra.export_mtlx()
.Made check and warn only once.
@ -119,0 +122,4 @@
if (!matx_addon_checked) {
gstate = PyGILState_Ensure();
PyObject *mx_module = PyImport_ImportModule("materialx");
Can you add another
if (!matx_addon_checked)
afterPyGILState_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.Tested. Works fine.