Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rotation and scene envmap warnings to reflection probes. #158

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions addons/io_hubs_addon/components/definitions/reflection_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,18 @@ class ReflectionProbe(HubsComponent):
)

def draw(self, context, layout, panel):
if not context.scene.hubs_component_environment_settings.envMapTexture:
row = layout.row()
row.alert = True
row.label(text="No scene environment map found. Please add an environment map to the environment settings scene component for reflection probes to work in Hubs.",
icon='ERROR')

if any(context.active_object.matrix_world.to_euler()):
row = layout.row()
row.alert = True
row.label(text="Rotation detected! The reflection probe must have no rotation applied to it.",
icon='ERROR')

row = layout.row()
row.label(text="Resolution settings, as well as the option to bake all reflection probes at once, can be accessed from the scene settings.",
icon='INFO')
Expand Down Expand Up @@ -345,6 +357,13 @@ def draw_global(cls, context, layout, panel):
col = row.box().column()
row = col.row()
row.label(text="Reflection Probes Resolution:")

if not context.scene.hubs_component_environment_settings.envMapTexture:
row = col.row()
row.alert = True
row.label(text="No scene environment map found. Please add an environment map to the environment settings scene component for reflection probes to work in Hubs.",
icon='ERROR')

row = col.row()
row.prop(context.scene.hubs_scene_reflection_probe_properties,
"resolution", text="")
Expand Down