Skip to content

Commit

Permalink
Merge pull request #71 from wziard/blender-4-fixes
Browse files Browse the repository at this point in the history
Some blender 4 fixes
  • Loading branch information
SBCV authored Jan 18, 2024
2 parents 4555beb + 6f31346 commit 7d66bad
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion photogrammetry_importer/importers/camera_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def add_camera_image_plane(
if add_image_plane_emission:
links.new(
shader_node_tex_image.outputs["Color"],
shader_node_principled_bsdf.inputs["Emission"],
shader_node_principled_bsdf.inputs["Emission Color"],
)

shader_node_tex_image.image = blender_image
Expand Down
4 changes: 2 additions & 2 deletions photogrammetry_importer/importers/mesh_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def import_photogrammetry_mesh(self, mesh_fp, reconstruction_collection):

if os.path.splitext(mesh_fp)[1].lower() == ".obj":
# https://docs.blender.org/api/current/bpy.ops.import_scene.html
bpy.ops.import_scene.obj(
filepath=mesh_fp, axis_forward="Y", axis_up="Z"
bpy.ops.wm.obj_import(
filepath=mesh_fp, forward_axis="NEGATIVE_Y", up_axis="NEGATIVE_Z"
)
elif os.path.splitext(mesh_fp)[1].lower() == ".ply":
# https://docs.blender.org/api/current/bpy.ops.import_mesh.html
Expand Down
4 changes: 2 additions & 2 deletions photogrammetry_importer/importers/mesh_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def add_color_emission_to_material(mesh_obj):

node_tree.links.new(
input_socket,
principled_bsdf_node.inputs["Emission"],
principled_bsdf_node.inputs["Emission Color"],
)


Expand Down Expand Up @@ -55,5 +55,5 @@ def add_mesh_vertex_color_material(
if add_mesh_color_emission:
node_tree.links.new(
attribute_node.outputs["Color"],
principled_bsdf_node.inputs["Emission"],
principled_bsdf_node.inputs["Emission Color"],
)
2 changes: 1 addition & 1 deletion photogrammetry_importer/importers/point_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _add_particle_material(
if add_particle_color_emission:
node_tree.links.new(
particle_color_node.outputs["Color"],
principled_bsdf_node.inputs["Emission"],
principled_bsdf_node.inputs["Emission Color"],
)


Expand Down
2 changes: 1 addition & 1 deletion photogrammetry_importer/opengl/draw_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class _DrawCallBackHandler:
"""Class that allows to handle point drawing callbacks."""

def __init__(self):
self._shader = gpu.shader.from_builtin("3D_FLAT_COLOR")
self._shader = gpu.shader.from_builtin("FLAT_COLOR")

# Handle to the function
self._draw_handler_handle = None
Expand Down

0 comments on commit 7d66bad

Please sign in to comment.