Export ImageTexture node for an image identified in material node tree #39

Open
Vincent Marchetti wants to merge 7 commits from vmarchetti/io_scene_x3d:image-export into main

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

View File

@ -162,6 +162,29 @@ class X3D_PT_export_include(bpy.types.Panel):
col.enabled = not blender_version_higher_279
col.prop(operator, "use_h3d")
class X3D_PT_export_external_resource(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOL_PROPS'
bl_label = "Images and Movies"
bl_parent_id = "FILE_PT_operator"
@classmethod
def poll(cls, context):
sfile = context.space_data
operator = sfile.active_operator
return operator.bl_idname == "EXPORT_SCENE_OT_x3d"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
sfile = context.space_data
operator = sfile.active_operator
operator.path_mode="COPY"
layout.prop(operator, "path_mode")
class X3D_PT_export_transform(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER'
@ -198,6 +221,8 @@ class X3D_PT_export_transform(bpy.types.Panel):
layout.prop(operator, "axis_up")
class X3D_PT_export_geometry(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOL_PROPS'
@ -419,6 +444,7 @@ classes = (
X3D_PT_export_include,
X3D_PT_export_transform,
X3D_PT_export_geometry,
X3D_PT_export_external_resource,
ImportX3D,
X3D_PT_import_general,
X3D_PT_import_transform,

View File

@ -357,6 +357,7 @@ def export(file,
name_decorations=True,
):
logger.info("export with path_mode: %r" % path_mode)
# -------------------------------------------------------------------------
# Global Setup
# -------------------------------------------------------------------------
@ -1648,8 +1649,12 @@ def export(file,
if use_h3d:
bpy.data.materials.remove(gpu_shader_dummy_mat)
# copy all collected files.
# print(copy_set)
if copy_set:
for c in copy_set:
logger.info("copy_set item %r" % copy_set)
else:
logger.info("no items in copy_set")
bpy_extras.io_utils.path_reference_copy(copy_set)
for svRecord in imageInMaterial.imagesToSave():