[Bf-python] Re: Request for adding a proposed new feature
Ken Hughes
khughes at pacific.edu
Tue Dec 19 23:52:55 CET 2006
Campbell Barton wrote:
> How about we allow
>
> scn.objects = []
>
> Other possibilities are...
>
> scn.objects.remove([ob1, ob2...])
I was thinking more about making complete deletion optional per object
(or group of objects):
#remove from scene, but don't delete when user count = 0
scn.objects.remove([ob1, ob2...])
#remove from scene, delete objects with user count = 0
scn.objects.remove([ob1, ob2...],delete=True)
Maybe some scripters don't want to delete the object when they become
zero (the current behavior).
The reason I suggest adding it here and not in the Object module is the
nastiness we added earlier where Object.Get() and Object.New() become
users of the object. It makes deleting the object a bit of a pain when
you're also a user of it. Can fakeUser take care of that old problem
now so we don't have to mess with the user count?
> Ken Hughes wrote:
>> The more the merrier... so I'm cc'ing Campbell:
>>
>> This is not hard to do, but should be done in a way which doesn't
>> break backward compatibility. I think this would be something to
>> consider adding to the Scene.objects sequence type, maybe with an
>> optional parameter to specify completely deleting the object.
>>
>> Might be a good idea to run this through the BPy mailing list since we
>> should decide ASAP before the CVS freeze.
>>
>> Ken
>>
>> Tom M wrote:
>>> I think this is already doable, ccing ken because i think he added it.
>>>
>>> For edit rights i need your wiki user name.
>>>
>>> LetterRip
>>>
>>> On 12/19/06, Eric-Olivier Le Bigot <Eric.Le.Bigot at spectro.jussieu.fr>
>>> wrote:
>>>> Hello,
>>>>
>>>> I'd like to propose a feature for the Python API, and I would like
>>>> to know
>>>> whether I can get modification rights on
>>>> http://mediawiki.blender.org/index.php/BlenderDev/DesignIssues in
>>>> order to
>>>> add this feature to the list.
>>>>
>>>> In fact, as far as I understand, it is not currently possible to
>>>> remove an
>>>> object in the same way as the deletion in the 3D window does. Many
>>>> people on
>>>> Blender Artists have run into this problem, which is particularily
>>>> acute for
>>>> me.
>>>>
>>>> I need to run a script that create 1000s of objects after emptying the
>>>> current scene; the problem is that this "emptying" is only done with
>>>> unlinks:
>>>> even though the first run is very fast, subsequent runs are
>>>> extremely slow
>>>> (maybe because of memory issues, or because the objects created
>>>> during the
>>>> second run have names that clash with those of the unlinked objects?).
>>>>
>>>> It would be very useful for me if the deletion command "x" of the 3D
>>>> window
>>>> could have a Blender Python equivalent (as the "x" command does
>>>> remove the
>>>> objects from memory, if this is possible).
>>>>
>>>> Best wishes,
>>>>
>>>> EOL
>>>>
>>>> --
>>>> Dr Eric-Olivier LE BIGOT (EOL) CNRS Associate
>>>> Researcher
>>>> ~~~o~o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o~o~~~
>>>>
>>>> Kastler Brossel Laboratory (LKB)
>>>> Université P. & M. Curie and Ecole Normale Supérieure, Case 74
>>>> 4 place Jussieu 75252 Paris CEDEX 05
>>>> France
>>>> ~~~o~o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o~o~~~
>>>>
>>>> office : (+33) 1 44 27 73 67 fax: (+33) 1 44 27
>>>> 38 45
>>>> ECR room: (+33) 1 44 27 47 12 x-ray room: (+33) 1 44 27
>>>> 63 00
>>>> home: (+33) 1 73 74 61 87
>>>> http://dirac.spectro.jussieu.fr/index_en.html
>>>>
>>>
>>
>>
>
>
More information about the Bf-python
mailing list