[Bf-committers] Calling operators when drawing a panel

Ton Roosendaal ton at blender.org
Sat Feb 5 15:23:24 CET 2011


We've had several people who work on render exporters already  
complain :)
I think the issue is mostly to get a decent method to send notifiers  
(UI updates) and data-updates (depsgraph) in place, as soon as possible.

I'm quite sure this change by Campbell was done to prevent crashing  
and bugreports; but I'm curious to know what his idea is for for a  
timely solution?


Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
Blender Institute   Entrepotdok 57A  1018AD Amsterdam   The Netherlands

On 5 Feb, 2011, at 14:25, Lionel Zamouth - BE wrote:

> Hi,
> I'm writing here following a chat I had with Campbell about recent
> changes that made impossible to call operators from the 'draw' section
> of custom panels. He suggested I submit here my problems with this
> behaviour.
> This technique is used since a previous change where directly writing
> into properties has been forbidden. I understand that bad coding could
> lead to some deadlocks or infinite loops but having the ability for a
> script to react to property changes is quite important and not
> achievable otherwise due to the lack of callbacks (so far I know).
> Here's the situation I'm facing: I've written an unofficial (both from
> Blender and Refractive Software point of view) addon to allow smooth
> export of blender scene/anim to the unbiased render Octane. From the
> user perspective it consists of 3 custom panels, replacing the default
> 'render', 'material' and 'texture' ones. I'm proud to say it has  
> became
> quite popular and allows a nice workflow to happen.
> The need for tracking properties is due to my wish to prevent the user
> accessing or modifying values that can't be taken in account by  
> Octane.
> For instance the custom texture panel forces the type to 'Image',
> coordinates to 'UV' and the Projection to 'Flat', as these are the  
> only
> values that can work with Octane (and are hidden by the custom panel).
> Another example is the main 'render' panel automatically resetting  
> the x
> and y aspect ratio to 1 as Octane only renders square pixels. This  
> last
> one is very important for the camera view in Blender to match final
> result in Octane.
> Doing those operations in the 'draw' section may have some limitations
> but seems to properly make the job (for instance I don't care if a  
> user
> loads an old scene with non proper values, I only expect my script to
> fix these once they're presented to the panel - good enough for me).
> According to Campbell it's seems there's no suitable workaround, so  
> I'm
> asking you don't prevent anymore operators to be called from the  
> 'draw'
> section of panels until callbacks are available (or may be you have a
> working workaround available).
> Cheers,
> Lionel
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list