From ce3dd12371f5bd02eb64488712d8c529ffe62f6b Mon Sep 17 00:00:00 2001 From: Piotr Makal Date: Fri, 6 May 2022 11:36:27 +0200 Subject: USD: add volume/VDB export Add support for volume (OpenVDB) USD export: - Allows to export both static and animated volumes. - Supports volumes that have OpenVDB data from files or are generated in Blender with 'Mesh to Volume' modifier. - For volumes that have generated data in Blender it also exports corresponding .vdb files. Those files are saved in a new folder named "volumes". - Slightly changes the USD export UI panel. "Relative Texture Paths" becomes "Relative Paths" (and has separate UI box) as the functionality will now apply to both textures and volumes. Disabling of this option due to "Materials" checkbox being turned off has been removed. Reviewed By: sybren, makowalski Differential Revision: https://developer.blender.org/D14193 Manifest Task: T95407 --- source/blender/editors/io/io_usd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/io') diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c index e0616a0cec3..97ca9b026ec 100644 --- a/source/blender/editors/io/io_usd.c +++ b/source/blender/editors/io/io_usd.c @@ -118,7 +118,7 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op) const bool generate_preview_surface = RNA_boolean_get(op->ptr, "generate_preview_surface"); const bool export_textures = RNA_boolean_get(op->ptr, "export_textures"); const bool overwrite_textures = RNA_boolean_get(op->ptr, "overwrite_textures"); - const bool relative_texture_paths = RNA_boolean_get(op->ptr, "relative_texture_paths"); + const bool relative_paths = RNA_boolean_get(op->ptr, "relative_paths"); struct USDExportParams params = { export_animation, @@ -133,7 +133,7 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op) generate_preview_surface, export_textures, overwrite_textures, - relative_texture_paths, + relative_paths, }; bool ok = USD_export(C, filename, ¶ms, as_background_job); @@ -181,9 +181,9 @@ static void wm_usd_export_draw(bContext *UNUSED(C), wmOperator *op) const bool export_tex = RNA_boolean_get(ptr, "export_textures"); uiLayoutSetActive(row, export_mtl && preview && export_tex); - row = uiLayoutRow(col, true); - uiItemR(row, ptr, "relative_texture_paths", 0, NULL, ICON_NONE); - uiLayoutSetActive(row, export_mtl && preview); + box = uiLayoutBox(layout); + col = uiLayoutColumnWithHeading(box, true, IFACE_("File References")); + uiItemR(col, ptr, "relative_paths", 0, NULL, ICON_NONE); box = uiLayoutBox(layout); uiItemL(box, IFACE_("Experimental"), ICON_NONE); @@ -282,10 +282,11 @@ void WM_OT_usd_export(struct wmOperatorType *ot) "Allow overwriting existing texture files when exporting textures"); RNA_def_boolean(ot->srna, - "relative_texture_paths", + "relative_paths", true, - "Relative Texture Paths", - "Make texture asset paths relative to the USD file"); + "Relative Paths", + "Use relative paths to reference external files (i.e. textures, volumes) in " + "USD, otherwise use absolute paths"); } /* ====== USD Import ====== */ -- cgit v1.2.3