Skip to content

Commit

Permalink
Fix formatting and make sure the Reflection Probe ends up with the co…
Browse files Browse the repository at this point in the history
…rrect name.
  • Loading branch information
Exairnous committed Jul 23, 2024
1 parent 9c95d6a commit 682ba11
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions addons/io_hubs_addon/components/definitions/reflection_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,14 +752,16 @@ def gather(self, export_settings, object):
"index": gather_texture(self.envMapTexture, export_settings)
}
}

@classmethod
def gather_import(cls, gltf, blender_host, component_name, component_value, import_report, blender_ob=None):
# Reflection Probes import as empties, so add a Light Probe object to host the component and parent it to the empty.
probe_type = 'CUBE' if bpy.app.version < (4, 1, 0) else 'SPHERE'
lightprobe_data = bpy.data.lightprobes.new(blender_host.name, probe_type)
lightprobe_data.influence_type ='BOX'
lightprobe_object = bpy.data.objects.new(blender_host.name, lightprobe_data)
reflecion_probe_name = blender_host.name
blender_host.name = f"{blender_host.name}_node"
lightprobe_data = bpy.data.lightprobes.new(reflecion_probe_name, probe_type)
lightprobe_data.influence_type = 'BOX'
lightprobe_object = bpy.data.objects.new(reflecion_probe_name, lightprobe_data)
lightprobe_object.location = blender_host.location
lightprobe_object.rotation_quaternion = blender_host.rotation_quaternion
lightprobe_object.scale = blender_host.scale
Expand Down

0 comments on commit 682ba11

Please sign in to comment.