Skip to content

Commit

Permalink
Fixed unused imports and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Leauyy committed Jan 5, 2024
1 parent 611735b commit 849509d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mitsuba-blender/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def execute(self, context):
#reset the exporter
self.reset()
end = time.time()
print(f"Export took {end-start}")
self.converter.export_ctx.log(f"Export took {end-start}")
return {'FINISHED'}


Expand Down
3 changes: 1 addition & 2 deletions mitsuba-blender/io/exporter/export_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def __init__(self):
'shape': 'meshes',
'spectrum': 'spectra'
}
self.texture_id = 0


def data_add(self, mts_dict, name=''):
Expand Down Expand Up @@ -197,7 +196,7 @@ def spectrum(self, value, mode='rgb'):
if any(type(value[i]) != type(value[i+1]) for i in range(len(value)-1)):
raise ValueError("Mixed types in spectrum entry %s" % value)
totitems = len(value)
if (value[0], (float, int)):
if isinstance(value[0], (float, int)):
if totitems == 3 or totitems == 4:
spec = {
'type': 'rgb',
Expand Down
7 changes: 3 additions & 4 deletions mitsuba-blender/io/exporter/geometry.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from .materials import export_material
from .export_context import Files
from mathutils import Matrix
import os
import bpy
from .materials import export_material
from .export_context import Files

def convert_mesh(export_ctx, b_mesh, matrix_world, name, mat_nr):
'''
Expand Down Expand Up @@ -103,7 +102,7 @@ def export_object(deg_instance, export_ctx, is_particle):
# Remove spurious characters such as slashes
name_clean = bpy.path.clean_name(b_object.name_full)
object_id = f"mesh-{name_clean}"
print(f"Exporting object {name_clean}")
export_ctx.log(f"Exporting object {name_clean}")
is_instance_emitter = b_object.parent is not None and b_object.parent.is_instancer
is_instance = deg_instance.is_instance
# Only write to file objects that have never been exported before
Expand Down
3 changes: 0 additions & 3 deletions mitsuba-blender/io/exporter/materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import bpy
from mathutils import Matrix
from .export_context import Files
from .nodes.material_evaluator import traverse
import time
import os.path

Expand Down Expand Up @@ -495,8 +494,6 @@ def b_material_to_dict(export_ctx, b_mat, obj_name):
output_node_id = 'Material Output'
if output_node_id in b_mat.node_tree.nodes:
# Save output node for baking
# output_node = b_mat.node_tree.nodes[output_node_id]
# surface_node = output_node.inputs["Surface"].links[0].from_node

surface_node = get_surface_node(b_mat).links[0].from_node
mat_params = cycles_material_to_dict(export_ctx, surface_node, b_mat, obj_name)
Expand Down

0 comments on commit 849509d

Please sign in to comment.