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

Fixes #191 #218

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fixes #191 #218

wants to merge 2 commits into from

Conversation

taiya
Copy link
Collaborator

@taiya taiya commented Apr 6, 2022

No description provided.

@taiya taiya requested a review from Qwlouse April 6, 2022 20:05
@taiya taiya linked an issue Apr 6, 2022 that may be closed by this pull request
@@ -737,3 +747,6 @@ def register_object3d_setters(obj, blender_obj):

obj.observe(AttributeSetter(blender_obj, "rotation_quaternion"), "quaternion")
obj.observe(KeyframeSetter(blender_obj, "rotation_quaternion"), "quaternion", type="keyframe")

# --- Maps Object3D.cast_shadows to bpy.context.object.cycles_visibility.shadow
obj.observe(VisibleShadowsSetter(blender_obj), "cast_shadows")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work without the need for a dedicated VisibleShadowsSetter:

obj.observe(AttributeSetter(blender_obj.cycles_visibility, "shadow"), "cast_shadows")

up = tl.CaselessStrEnum(["X", "Y", "Z", "-X", "-Y", "-Z"], default_value="Y")
front = tl.CaselessStrEnum(["X", "Y", "Z", "-X", "-Y", "-Z"], default_value="-Z")
cast_shadows = tl.Bool(default_value=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PhysicalObject would be a better place for this property, since all cameras and lights also inherit from Object3D, and I am reasonably sure that cast_shadow will either not work on those or not behave as expected.

@Qwlouse Qwlouse self-requested a review April 13, 2022 17:51
Copy link
Collaborator

@Qwlouse Qwlouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest moving the cast_shadow property to PhysicalObject and remove the VisibleShadowsSetter. See comments.
Other than that feel free to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

kb.DirectionalLight does not work with spherical world
2 participants