Various Python integration changes #77

Closed
Brecht Van Lommel wants to merge 6 commits from brecht:hydra-python-changes into hydra-render

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 7 additions and 14 deletions
Showing only changes of commit 65ac145081 - Show all commits

View File

@ -64,17 +64,6 @@ class HydraRenderEngine(bpy.types.RenderEngine):
_bpy_hydra.engine_free(self.engine_ptr) _bpy_hydra.engine_free(self.engine_ptr)
@classmethod
def register(cls):
root_folder = "blender.shared" if platform.system() == 'Windows' else "lib"
os.environ['PXR_MTLX_STDLIB_SEARCH_PATHS'] = os.pathsep.join([
str(Path(bpy.app.binary_path).parent / f"{root_folder}/materialx/libraries"),
os.environ.get('PXR_MTLX_STDLIB_SEARCH_PATHS', "")])
@classmethod
def unregister(cls):
pass
def get_sync_settings(self, engine_type): def get_sync_settings(self, engine_type):
""" """
Provide settings for Blender scene delegate. Available settings: Provide settings for Blender scene delegate. Available settings:

View File

@ -38,7 +38,11 @@ materialx_libs_dir = os.path.abspath(os.path.join(shared_lib_dir, "materialx", "
materialx_libs_env = os.getenv("MATERIALX_SEARCH_PATH") materialx_libs_env = os.getenv("MATERIALX_SEARCH_PATH")
if materialx_libs_env is None: if materialx_libs_env is None:
os.environ["MATERIALX_SEARCH_PATH"] = materialx_libs_dir os.environ["MATERIALX_SEARCH_PATH"] = materialx_libs_dir
elif sys.platform == "win32":
os.environ["MATERIALX_SEARCH_PATH"] = materialx_libs_dir + ";" + materialx_libs_env
else: else:
os.environ["MATERIALX_SEARCH_PATH"] = materialx_libs_dir + ":" + materialx_libs_env os.environ["MATERIALX_SEARCH_PATH"] = materialx_libs_env + os.pathsep + materialx_libs_dir
materialx_libs_env = os.getenv("PXR_MTLX_STDLIB_SEARCH_PATHS")
if materialx_libs_env is None:
os.environ["PXR_MTLX_STDLIB_SEARCH_PATHS"] = materialx_libs_dir
else:
os.environ["PXR_MTLX_STDLIB_SEARCH_PATHS"] = materialx_libs_env + os.pathsep + materialx_libs_dir