snap align to reflection option #35069

Closed
opened 2013-04-24 18:29:32 +02:00 by Philipp Oeser · 26 comments
Member

%%%this is a quick patch primarily aiming at making lighting/setting up reflections a bit easier.
In addition to the existing "snap align to surface normal" it indroduces a new option "snap align to reflection". This enables the user to just point at a position on a mesh and the light/emmitter will be positioned so that the resulting reflections will appear exactly where desired...

quick video showing this (there might be other usecases as well...)
https://vimeo.com/64733829

hope this is useful for others

Greetz
Philipp
%%%

%%%this is a quick patch primarily aiming at making lighting/setting up reflections a bit easier. In addition to the existing "snap align to surface normal" it indroduces a new option "snap align to reflection". This enables the user to just point at a position on a mesh and the light/emmitter will be positioned so that the resulting reflections will appear exactly where desired... quick video showing this (there might be other usecases as well...) https://vimeo.com/64733829 hope this is useful for others Greetz Philipp %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%Hi Phillip,

I encountered fail building blender after apply your patch. This is the log after I used your patch http:*www.pasteall.org/41746 and this is the error log for make error http:*www.pasteall.org/41747%%%

%%%Hi Phillip, I encountered fail building blender after apply your patch. This is the log after I used your patch http:*www.pasteall.org/41746 and this is the error log for make error http:*www.pasteall.org/41747%%%
Author
Member

%%%Hi Aditia!

Maybe something got malformatted (I had some other stuff in the diff I took out by hand...)
I have attached another patch. Does this one apply?

Greetz
Philipp%%%

%%%Hi Aditia! Maybe something got malformatted (I had some other stuff in the diff I took out by hand...) I have attached another patch. Does this one apply? Greetz Philipp%%%

%%%This is quite clever, simple idea but powerful. Some comments:

  • The buttons are bit confusing and take up a lot of space. Maybe it should become a single enum button No Rotation/Snap to Normal/Snap to Reflection.
  • Is there some way we could support this without the empty that fits with the transform system? Would be nice if you could just select a light and do it.
  • Please use tabs instead of spaces for indentation
    %%%
%%%This is quite clever, simple idea but powerful. Some comments: * The buttons are bit confusing and take up a lot of space. Maybe it should become a single enum button No Rotation/Snap to Normal/Snap to Reflection. * Is there some way we could support this without the empty that fits with the transform system? Would be nice if you could just select a light and do it. * Please use tabs instead of spaces for indentation %%%
Author
Member

%%%Hi Brecht, and thanx for your comments!

I will try to address them in the following days (a bit busy atm...) and post and updated patch then.
Not quite sure how it would fit without using an empty (lamp would have to preserve distance to surface, not really something one would consider "snapping" anymore), but will think about it - maybe I can come up with something.%%%

%%%Hi Brecht, and thanx for your comments! I will try to address them in the following days (a bit busy atm...) and post and updated patch then. Not quite sure how it would fit without using an empty (lamp would have to preserve distance to surface, not really something one would consider "snapping" anymore), but will think about it - maybe I can come up with something.%%%
Author
Member

%%%Tiny update (only now have time again) as v02:

  • cleaned up tabs/spaces
  • regarding the buttons: I've noticed that r56706 already reduced the width of enum-based dropdown lists (good!). I have modified the original patch to only show the dropdown if "use_snap_align" is enabled. After thinking a bit about it I find this more consistent with the rest of Blender [e.g. in the same header we can toggle "show_manipulator" and once its there we have other options to choose from]. It just feels strange to have a dropdown defaulting to the equivalent of "do nothing" and having other choices burried in there, no? I also removed the icons in the dropdown (made it confusing as well I think because the same icon was used twice)
  • no progress yet on using lights directly [I will experiment with that next]%%%
%%%Tiny update (only now have time again) as v02: * cleaned up tabs/spaces * regarding the buttons: I've noticed that r56706 already reduced the width of enum-based dropdown lists (good!). I have modified the original patch to only show the dropdown if "use_snap_align" is enabled. After thinking a bit about it I find this more consistent with the rest of Blender [e.g. in the same header we can toggle "show_manipulator" and once its there we have other options to choose from]. It just feels strange to have a dropdown defaulting to the equivalent of "do nothing" and having other choices burried in there, no? I also removed the icons in the dropdown (made it confusing as well I think because the same icon was used twice) * no progress yet on using lights directly [I will experiment with that next]%%%
Author
Member

patch updated to master
(after my migration to git here - I've also set up arcanist, if that helps)
TransformSnapReflection_91f0a38ad69149fb3e6c57e8a8c4ddff34c03f0f.diff

patch updated to master (after my migration to git here - I've also set up arcanist, if that helps) [TransformSnapReflection_91f0a38ad69149fb3e6c57e8a8c4ddff34c03f0f.diff](https://archive.blender.org/developer/F29823/TransformSnapReflection_91f0a38ad69149fb3e6c57e8a8c4ddff34c03f0f.diff)

Added subscriber: @Sergey

Added subscriber: @Sergey

The patch seems really nice to me, but would be cool if it's supported workflow where parenting to an empty is not needed. Any progress with that?

The patch seems really nice to me, but would be cool if it's supported workflow where parenting to an empty is not needed. Any progress with that?
Author
Member

@Sergey: I made it an addon for the time being. It's working a little differently [more like a brush], but no empties needed here. Just select the lamp/emitter and launch the modal op.
If this is interesting for you/others, please give it a go [feedback really appreciated]. Might also be a fun exercise porting this back to C if this functionality is considered for inclusion...

note: addon is alpha/beta and not ready for primetime, but could very well serve as a reference on how to proceed from here
LichtwerkPlaceReflectionTool.py

quickstart:

  • Tool panel is in T-Region
  • select lamp/emitter
  • launch tool (shortcut Shift+Q)
  • move brush over surface, click-drag will position lamp/emmiter accordingly
  • F+mousemove will let you adjust distance from surface
  • F+middlemousescroll will let you adjust emitter strength
  • there are a couple of options (also user-preferences), hope the tooltips are explainatory for now

What do you think?

@Sergey: I made it an addon for the time being. It's working a little differently [more like a brush], but no empties needed here. Just select the lamp/emitter and launch the modal op. If this is interesting for you/others, please give it a go [feedback really appreciated]. Might also be a fun exercise porting this back to C if this functionality is considered for inclusion... note: addon is alpha/beta and not ready for primetime, but could very well serve as a reference on how to proceed from here [LichtwerkPlaceReflectionTool.py](https://archive.blender.org/developer/F150171/LichtwerkPlaceReflectionTool.py) quickstart: - Tool panel is in T-Region - select lamp/emitter - launch tool (shortcut Shift+Q) - move brush over surface, click-drag will position lamp/emmiter accordingly - F+mousemove will let you adjust distance from surface - F+middlemousescroll will let you adjust emitter strength - there are a couple of options (also user-preferences), hope the tooltips are explainatory for now What do you think?

I didn't test the addon yet, but from the description it sounds rather really handy and more clear. Would be nice to have it wrapped around and ended up in official addons repository.

I didn't test the addon yet, but from the description it sounds rather really handy and more clear. Would be nice to have it wrapped around and ended up in official addons repository.

Added subscriber: @zeauro

Added subscriber: @zeauro

I tested the addon.
Display of the widget seems very complete and customizable. It works well.

The need to use middlemousescroll for adjusting strength is not obvious when you are only looking at the header.
It seems to be overcompilcated to hold F and scroll mouse wheel at same time.
Maybe you wanted user to be able to change distance and strength at same time but probably a trick to synchronize sliders would be more easy to use.

IMO, Shift F to change strength is more natural to somebody using sculpt and paint modes.

Strength slider does not work well with Cycles. It does not work if lamp don't have an emission node with a strength slider.
And value of the slider is still between 0 and 1 which does not correspond to ranges used for Cycles Lamps.
So if you want to decrease default point lamp, you quickly goes to negative values for the slider.
Maybe it could change value of color of lamp when it is not using nodes.
Cycles is a complicated case. If the tool becomes a kind of lighting setup mode, it should also take into account emitter size.

About that, color sliders or a call of color picker could also be a cool addition.
Problem is that you have to quit the mode, each time, you want to change a setting not taken into account by the addon.
Even with "Bend towards diffuse shading" slider, you have to quit mode. But it would be great to have it in interactive mode.
It is also a pity to quit to select another lamp that already exists.
IMO, switch through existing lamps could be a good use of mousewheel.

I tested the addon. Display of the widget seems very complete and customizable. It works well. The need to use middlemousescroll for adjusting strength is not obvious when you are only looking at the header. It seems to be overcompilcated to hold F and scroll mouse wheel at same time. Maybe you wanted user to be able to change distance and strength at same time but probably a trick to synchronize sliders would be more easy to use. IMO, Shift F to change strength is more natural to somebody using sculpt and paint modes. Strength slider does not work well with Cycles. It does not work if lamp don't have an emission node with a strength slider. And value of the slider is still between 0 and 1 which does not correspond to ranges used for Cycles Lamps. So if you want to decrease default point lamp, you quickly goes to negative values for the slider. Maybe it could change value of color of lamp when it is not using nodes. Cycles is a complicated case. If the tool becomes a kind of lighting setup mode, it should also take into account emitter size. About that, color sliders or a call of color picker could also be a cool addition. Problem is that you have to quit the mode, each time, you want to change a setting not taken into account by the addon. Even with "Bend towards diffuse shading" slider, you have to quit mode. But it would be great to have it in interactive mode. It is also a pity to quit to select another lamp that already exists. IMO, switch through existing lamps could be a good use of mousewheel.
Author
Member

thanx for checking this out, @zeauro.
And thanx for the suggestions! I'll review this whole thing in depth in about a month from now (busy atm) and your suggestions will help a lot :)

thanx for checking this out, @zeauro. And thanx for the suggestions! I'll review this whole thing in depth in about a month from now (busy atm) and your suggestions will help a lot :)

Added subscriber: @FilipMond

Added subscriber: @FilipMond

That's awesome tool for product visualizations. great work :)
As zeauro said, would be more awesome to see distance adjustments in real. Strength already is, but I feel the same - slider is not corresponding to cycles range. Adjust Color on a fly sounds also great to me.

Another thing is - I wanted to post a bug, because I wasn't able to adjust strength, than I noticed this issue is related to Apples Magic Mouse. Classic (old) mouse wheel works.

Plus one private request - New light (Ctrl+LMB) generates a copy of selected object, would be helpful if copy will be with all setup of source. Like I created mesh light, thin long rectangle with disabled camera rays in object properties. But new generated object was original Plane.

Thank you
Just a quick test that made me happy :)
https://vimeo.com/154171370

That's awesome tool for product visualizations. great work :) As zeauro said, would be more awesome to see distance adjustments in real. Strength already is, but I feel the same - slider is not corresponding to cycles range. Adjust Color on a fly sounds also great to me. Another thing is - I wanted to post a bug, because I wasn't able to adjust strength, than I noticed this issue is related to Apples Magic Mouse. Classic (old) mouse wheel works. Plus one private request - New light (Ctrl+LMB) generates a copy of selected object, would be helpful if copy will be with all setup of source. Like I created mesh light, thin long rectangle with disabled camera rays in object properties. But new generated object was original Plane. Thank you Just a quick test that made me happy :) https://vimeo.com/154171370

Added subscriber: @cedriclepiller

Added subscriber: @cedriclepiller

This is nice,

Maybe :

If nothing selected, add a popup to select a light.

If a light is well placed, clic on F to change the distance and strenght without having to replace the light to apply those settings.
Maybe add a color picker to the F settings too.

Also when working on a pen, we cannot change the strengt, maybe make this in two times like sculpt

F = Distance
Ctrl + F = Strenght

Or you can create a popup with all the usefull settings of the light.

This is nice, Maybe : If nothing selected, add a popup to select a light. If a light is well placed, clic on F to change the distance and strenght without having to replace the light to apply those settings. Maybe add a color picker to the F settings too. Also when working on a pen, we cannot change the strengt, maybe make this in two times like sculpt **F** = Distance **Ctrl + F** = Strenght Or you can create a popup with all the usefull settings of the light.
Author
Member

Thanx again for checking this out (and also for the very helpful feedback -- this will be considered once I find time for the next round of fixes/enhancements)
Cant really promise an exact deadline for this, anyways: seeing that people are actually interested pushes this as a priority for me for sure :)
Will keep you updated here.

Thanx again for checking this out (and also for the very helpful feedback -- this will be considered once I find time for the next round of fixes/enhancements) Cant really promise an exact deadline for this, anyways: seeing that people are actually interested pushes this as a priority for me for sure :) Will keep you updated here.
similar add-on https://github.com/clarkx/Lumiere

Added subscriber: @AntonShushkov

Added subscriber: @AntonShushkov

Patch

Patch

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Dalai Felinto self-assigned this 2019-12-23 18:45:16 +01:00

Hi, thanks for your patch.

We are undergoing a Tracker Curfew where we are automatically closing old patches.

If you think the patch is still relevant please update and re-submit it. For new features make sure there is a clear design from the user level perspective.

Hi, thanks for your patch. We are undergoing a [Tracker Curfew ](https://code.blender.org/?p=3861) where we are automatically closing old patches. If you think the patch is still relevant please update and re-submit it. For new features make sure there is a clear design from the user level perspective.
Author
Member

FYI, third try at this: now working with the Light LookAt gizmo (which seems like a pretty natural choice) and it supports placing shadows, too:
D7971: [WIP] Light LookAt Gizmo Enhancements (place shadows, reflections, ...)

FYI, third try at this: now working with the Light LookAt gizmo (which seems like a pretty natural choice) and it supports placing shadows, too: [D7971: [WIP] Light LookAt Gizmo Enhancements (place shadows, reflections, ...)](https://archive.blender.org/developer/D7971)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#35069
No description provided.