Page MenuHome

Update sun_position to Blender 2.8
Open, NormalPublic

Description

Hi, I see that @Brendon Murphy (meta-androcto) updated the sun_position add-on in rBAC7b0831a77528. I have been working on updating it as well for a while, and although the map feature is still missing, the rest of the add-on is done, and is much better integrated into Blender’s UI/UX.

Here is a list of some changes:

  • Move preferences to user preferences
  • Convert UI to flow, remove two-column mode
  • Remove activation operator. The add-on is now always on
    • Update is done with prop update functions and a handler instead
  • Disabling options in preferences now have an effect on the scene
  • HDR selection is now an simpler operator. Click in 3D view to select sun position
  • Presets are now actual Blender presets, so the user can add their own
  • Object groups for analemma visualisation is now a collection
  • Cleanup and refactor
    • Remove some manager classes and operators
    • Style (some pep8, snake_case, variable names)

I rebased upon rBAC7b0831a77528, so the patch should apply cleanly. I won’t push this straight away as it’s not a small change.

Details

Type
Patch

Event Timeline

Damien Picard (pioverfour) lowered the priority of this task from Needs Triage by Developer to Normal.Sep 16 2019, 11:33 AM
Damien Picard (pioverfour) created this task.

hi, nice work. we can do this I'll check with you in blender.chat before go ahead. nBurn and I were discussing some issues a couple of days ago in irc, it will be worth a quick discuss before push.

Damien Picard (pioverfour) changed Type from Design to Patch.Sep 17 2019, 11:48 AM

That’s fine with me. Some points which certainly need discussion are:

  • The reimplementation of the HDR and world map modes, which were in my opinion overly complex in the previous version, but maybe they fit others’ use cases. The shader part can definitely be simplified using the new gpu and gpu_extras modules, but I’m not sure about the UI.
    • For the HDR sun selection, I don’t think the user needs to display it permanently, since the purpose is to choose a precise point on the texture and then sync it, so a one-time operation fits better.
    • For the world map, I’m not sure overlaying it on the 3D View or properties panel is right. Maybe displaying it inside an image editor would be better, but I’m not sure yet.
  • The presets: I made a non-standard operator to copy defaults to the user directory, but I’m not sure it’s really useful for everybody (two Boston presets, two Honolulu presets…?).
  • The UTC zone’s behaviour is not clear to me, despite its description in the old wiki.

I have only tested the add-on under Linux, so there might be problems with graphics on other platforms.

Should I open a Diff to further review the code?

I opened a diff at D5825, and restored mirrorball projections for HDRI sun selections.

hi @Damien Picard (pioverfour)

The re implementation of the HDR and world map modes, which were in my opinion overly complex in the previous version, but maybe they fit others’ use cases. The shader part can definitely be simplified using the new gpu and gpu_extras modules, but I’m not sure about the UI.

  • I would not worry about the hrdi/world map just yet.
  • The hdri button can stay for now if it's working.
  • The World map, keep the current code intact, it's ok for now to leave it. There's several options on how to handle it,
    • Implement in old style.
    • Put in some kind of open/close show/hide panel.
    • Possibly there's code for custom editor types now, could even do that and pop it up?

We do need more thinking on that and it's not a priority atm. I think it's best to wait, I've asked newbs to look in a month when he's back from holiday. There's other bgl experts that may be able to help/provide answers yet to be contacted.

  • The presets become a little more important if there's no world map? I think at some later stage they could be improved.

Some history with this fix:
https://github.com/kevancress/sun_position_b28_test was the base for the update.
@nBurn (nBurn) had a look and made some changes, then I made some changes.
Now it's in your hands so to speak. I guess at one stage there were 3 of us working on it...

Your code has had basic look over, it looks ok, much cleaner than what we initially committed. Thanks! If you can could you zip upload the whole file here in this task. I want to look at it as a whole addon and I'll compare all the files, double check some issues I was looking at.
Thanks again.

All right, I’ll give it a rest for the time being, the map can be reimplemented later. The current code for it won’t work at all since it relies on the Display manager class, which I removed. But it was broken for a long time anyway, I had to use Blender 2.75 to see how it behaved.

Thanks for the history, I didn’t know so much work had gone into this already…

Anyway, here is the zipped add-on.

Some fixes for the HDRI point selector, implemented geographic coordinates parser field using a GPL module by Maximilian Högner, to allow users to paste coordinates from an online map.