Skip to content

Commit 7d66bad

Browse files
authored
Merge pull request #71 from wziard/blender-4-fixes
Some blender 4 fixes
2 parents 4555beb + 6f31346 commit 7d66bad

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

photogrammetry_importer/importers/camera_utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def add_camera_image_plane(
522522
if add_image_plane_emission:
523523
links.new(
524524
shader_node_tex_image.outputs["Color"],
525-
shader_node_principled_bsdf.inputs["Emission"],
525+
shader_node_principled_bsdf.inputs["Emission Color"],
526526
)
527527

528528
shader_node_tex_image.image = blender_image

photogrammetry_importer/importers/mesh_importer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def import_photogrammetry_mesh(self, mesh_fp, reconstruction_collection):
4242

4343
if os.path.splitext(mesh_fp)[1].lower() == ".obj":
4444
# https://docs.blender.org/api/current/bpy.ops.import_scene.html
45-
bpy.ops.import_scene.obj(
46-
filepath=mesh_fp, axis_forward="Y", axis_up="Z"
45+
bpy.ops.wm.obj_import(
46+
filepath=mesh_fp, forward_axis="NEGATIVE_Y", up_axis="NEGATIVE_Z"
4747
)
4848
elif os.path.splitext(mesh_fp)[1].lower() == ".ply":
4949
# https://docs.blender.org/api/current/bpy.ops.import_mesh.html

photogrammetry_importer/importers/mesh_utility.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def add_color_emission_to_material(mesh_obj):
1313

1414
node_tree.links.new(
1515
input_socket,
16-
principled_bsdf_node.inputs["Emission"],
16+
principled_bsdf_node.inputs["Emission Color"],
1717
)
1818

1919

@@ -55,5 +55,5 @@ def add_mesh_vertex_color_material(
5555
if add_mesh_color_emission:
5656
node_tree.links.new(
5757
attribute_node.outputs["Color"],
58-
principled_bsdf_node.inputs["Emission"],
58+
principled_bsdf_node.inputs["Emission Color"],
5959
)

photogrammetry_importer/importers/point_utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def _add_particle_material(
179179
if add_particle_color_emission:
180180
node_tree.links.new(
181181
particle_color_node.outputs["Color"],
182-
principled_bsdf_node.inputs["Emission"],
182+
principled_bsdf_node.inputs["Emission Color"],
183183
)
184184

185185

photogrammetry_importer/opengl/draw_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class _DrawCallBackHandler:
9898
"""Class that allows to handle point drawing callbacks."""
9999

100100
def __init__(self):
101-
self._shader = gpu.shader.from_builtin("3D_FLAT_COLOR")
101+
self._shader = gpu.shader.from_builtin("FLAT_COLOR")
102102

103103
# Handle to the function
104104
self._draw_handler_handle = None

0 commit comments

Comments
 (0)