[Bf-committers] Python RNA Type Registration

Toni Alatalo antont at kyperjokki.fi
Wed Mar 3 10:43:37 CET 2010


Campbell Barton kirjoitti:
> Also looked at the gimp but this doesnt to register/unregister, its
> more like what we used to have.
> Id not be surprised if we're the only application doing this kind of
> integration.
>   

We are doing it in the RealXtend Naali app, which uses Ogre for the 3d 
scene and Qt for UI, for the same thing that Blender 2.5 seemed to do 
with F8 (is just F11 in Naali now :) .. to be able to reload py written 
tools without shutting down the whole app.

But in Naali we don't have a very nice API or impl for this either. It 
now works so that the reload command first triggers an on_exit event, 
which all the py written tools that want to support reloading can handle 
to unregister themselves, and then the pymodule loader uses reload() to 
refresh the tool codes and instanciates them again so that they 
re-register to the UI and have the new code running. Works and is 
useful, but not that nice. The unregistering from the UI for the modules 
that show in the Qt UI is necessary for the reloading to work, otherwise 
there stays a reference to the old py code somewhere in the UI internals 
and the code doesn't update. I tried first to use Py_Finalize (which I 
guess Blender perhaps uses?) but failed so far, dunno if should just 
clean the namespaces somehow otherwise or what.

So am curious to see nice solutions for this, but don't know of any yet.

~Toni

>> --- On Mon, 3/1/10, Dalai Felinto <dfelinto at gmail.com> wrote:
>>
>>     
>>> From: Dalai Felinto <dfelinto at gmail.com>
>>>
>>> Same for "Live Edit" . Maybe this is not highly needed, but
>>> it'll be nice if
>>> we can maintain it.
>>>       
>> Agreed. I don't think it would be very hard, I can think of 3 or 4 ways to do it nicely.
>>
>> The problem now is more with internal registration and dangling references than the registration process on the python side itself.
>>
>>
>>
>> Anyone else wants to chip in with opinions, please do so. I'd like to hear especially from people who've used the 2.5 API (for UI, Import/Export, Render Engine, ...).
>>
>> Martin
>>
>>
>>      __________________________________________________________________
>> Get the name you've always wanted @ymail.com or @rocketmail.com! Go to http://ca.promos.yahoo.com/jacko/
>> _______________________________________________
>> 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