Photographer - Camera Exposure, White Balance, Autofocus, Physical Lights, Bokeh, Render Queue

Hmm, I can see it here at the bottom of the Camera panel with a build from today.
image
image

Hi there! I’ve been trying your addon and is awesome! Thank you!
I think the autofocus is not picking instanced collections. It works with unique and instanced single objects though.
I just bought the scenecity addon and it works with lots of instanced collections. When I take a walk in it with AF continous it stays at the default 100 units distance.

Thanks for reporting the issue, I know that the viewport raycast doesn’t work with every type of objects (extruded curves for instance), I’ll check if it’s possible to make it work with instanced collections though.

3 Likes

Issue is fixed in the new version. Using scene.ray_cast instead of bmesh raycast.

2.0.2:

  • Autofocus ray-cast change, it works with instanced collections now.
  • AF-C won’t be as expensive as it sends rays less often.
  • Hiding AF-C and AF-S header buttons if not looking through camera
6 Likes

Works perfectly in the same scene I described before. You’re awesome!

1 Like

Hey. I played a lot with the AF.
Very nice.
A good little tweek could be using new
app timers.

https://docs.blender.org/api/blender2.8/bpy.app.timers.html#run-a-function-every-x-seconds

You could make it a var… like
1 time per second, 10 times per second…

I also tried to tween the resulting value with an QuadricOut.
e.g by giving the value 1 time per second it simulates an nice focus motor behaviour.

Thanks for the great addon.

2 Likes

Thanks for your suggestion, I was looking at using slow parent to make the AF smooth but they removed it in 2.8. I will give that one a try!

The only one i missed is a nice tweening implementation in python.
see behaviour at end of this video

This is the manual one.
Click… Raycast… tween focus distance

For AF
CenterScreen Raycast defined through App timer…
Raycast… tween focus distance

Tweening the distance. Click on Elastic here

I used this in an Unity implementation.
Its the nicest effect for DOF.

In the video above i think they used Power4 for tweening the focus distance.

So setting apptimer on 1times per second and tweening the focus distance from old to new focus distance value
should do the job.
Power4 tweening. Fast in… slow converging to new f distance
Elastic tweening. Very fast in … crazy zoom effect… then converging slow to new fdistance

I found an tween python port here with the needed Power4 and Elastic tweens.

But i don t now if there is already some implementation in blender python api available or an easier way.

Okay thanks. The time interval is already done, I just need to do the interpolation, should probably be doable with mathutils.
I’m not sure how to update of the value in realtime though.

Mhmmm. Probably this could work.

We have
old focus distance pos.
we get
new focus distance Pos. per app timer every second

then
generating
this interpolation with keyframes from old to new pos?

Generating an fcurve keyframe interpol could make tween described before also available.

I must check at home if this could run in parrallel with the rest.

Could that be the solution for smooth interploating from oldfocusdistance to newfocusdistance?

PerAppTimer who reacts on event in another thread.

When Raycast is done another function lerps old fdistance to new fdistance like this in x seconds. when finished do next racast

// Precise method which guarantees v = v1 when t = 1.
float lerp(float v0, float v1, float t) {
return (1-t)v0 + tv1;
}

based on this

Use a Timer to react to events in another thread
You should never modify Blender data at arbitrary points in time in separate threads. However you can use a queue to collect all the actions that should be executed when Blender is in the right state again. Pythons queue.Queue can be used here, because it implements the required locking semantics.

import bpy
import queue

execution_queue = queue.Queue()

This function can savely be called in another thread.

The function will be executed when the timer runs the next time.

def run_in_main_thread(function):
execution_queue.put(function)

def execute_queued_functions():
while not execution_queue.empty():
function = execution_queue.get()
function()
return 1.0

bpy.app.timers.register(execute_queued_functions)

from
https://docs.blender.org/api/blender2.8/bpy.app.timers.html

we should simply ask Jaques Lucke
He did the Animation Nodes and worked on the
bpy.apptimer
https://developer.blender.org/D3990

Thanks for sharing all these,. I’m quite busy at the moment so I won’t promise it will come anytime soon, but I’ll look into it.

Hi! Firstly Kudos for a great addon, for me its a must have! I wanted to ask if there are plans on updating the addon considering the latest changes in Blender 2.8 since i am getting an error and assuming that is the purpose. If i am wrong and its an isolated case i can send the console output via DM.

Thanks!

Hey ivobran,

Thanks for reporting the issue, I don’t update 2.8 every day so I wouldn’t have noticed the API changes right away.

This is fixed in the new 2.0.3 version:

  • New Continuous Autofocus setting to set the update interval
  • Focus Distance in the header is now available with AF-C
  • Updated to work with new Depth of Field API
  • Using new app.timer for cleaner code. Should be less expensive that way.
  • Depth of Field using Radius value seems to have been removed from the UI, so now Affect Depth of Field will simply turn on or off the Depth of Field. Aperture is the way to go.

I am now adding the add-on on Gumroad: https://gumroad.com/products/FWQf/

This will be easier for the users to be notified when a new version is available.
My work situation has changed as well, so if you like the add-on and want to see it supported, feel free to donate!

3 Likes

Just donated to help with development.

Out of curiosity, will this work on Octane besides Eevee and Cycles? Meaning will it override the integrated Octane camera settings or is there a possibility to use this instead. Since there is only an Octane version for 2.7 and the 2.8 is still in development i assume it will be much different and you cannot give me an answer about Blender 2.8 Octane version but theoretically speaking is it possible?

Thanks ivobran!
I really doubt Octane uses the same python commands as cycles and eevee, so it won’t work out of the box. But it definitely should have the same render features so it shouldn’t be impossible to port, if they have a documented API and a demo available. I will have a quick look at it.

Edit: I had a look at it, it should be super easy. Give me a couple of days. I’m struggling to get the OctaneServer to work on my machine but I’ll try on someone else’s.

2 Likes

I noticed an error with the white balance picker because of the API change, I will release a fix tomorrow, along with a couple of new Autofocus features.

I will wait for Octane 4 to be released for Blender 2.8, unless I get some requests to support it for Blender 2.79.

1 Like

New update available on Gumroad:

2.0.4:

  • Supports latest Blender 2.8 builds after the API lock. Please make sure to update your Blender 2.8 as it won’t work with older builds.
  • Fixed White Balance Picker that was broken
  • Added Autofocus Animate
  • Added AF-Track to add a tracker on the surface of an object
11 Likes

Congratulations. Nice new functions.