[Bf-python] Bf-python Digest, Vol 133, Issue 7

James Crowther jamesharrycrowther at gmail.com
Fri Jun 24 12:33:13 CEST 2016


Many thanks Bastien!
    It makes total sense! I've been using it today and it is sooo helpful
to know this. Is this documented somewhere? I'd like to read more about it.
Interesting, seems to only work with relative paths? Is that correct? If so
is this based on a user pref setting or just how it is?

Kind Regards


On Fri, Jun 24, 2016 at 8:00 PM, <bf-python-request at blender.org> wrote:

> Send Bf-python mailing list submissions to
>         bf-python at blender.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.blender.org/mailman/listinfo/bf-python
> or, via email, send a message with subject or body 'help' to
>         bf-python-request at blender.org
>
> You can reach the person managing the list at
>         bf-python-owner at blender.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Bf-python digest..."
>
>
> Today's Topics:
>
>    1. duplicate name entries in D.objects (James Crowther)
>    2. Re: duplicate name entries in D.objects (Bastien Montagne)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 24 Jun 2016 10:47:30 +1000
> From: James Crowther <jamesharrycrowther at gmail.com>
> Subject: [Bf-python] duplicate name entries in D.objects
> To: bf-python at blender.org
> Message-ID:
>         <
> CAJOwpNumH1_K2Ypdgi5rTY023dbpC3P_rEMf2NAELimWJFpHLQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi, just trying to understand why there are sometimes more than one entry
> in D.objects with the same name? This behaviour was a little unexpected for
> me since I had assumed that these collection types behaved similarly to
> python dictionaries since they resemble them closely in that they have a
> name, value pattern.
> However, in a python dictionary it is not valid to have two entries with
> the same name. This is certainly not the case for D.objects which clearly
> can support more than one entry with the same name.
>
> I have experimented with renaming objects from the properties panel. Lets
> say there is an object named 'Cube', if I add another object and rename it
> to 'Cube', the object that had originally held the name 'Cube' is renamed
> to 'Cube.001'
>
> So I was surprised to find that in D.objects, there are duplicates and
> would like to understand why this happens, how to reproduce this behaviour
> and whether this is useful behaviour or a byproduct of some other feature?
>
> Kind Regards
>
> James
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.blender.org/pipermail/bf-python/attachments/20160624/b31c9fca/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Fri, 24 Jun 2016 09:59:31 +0200
> From: Bastien Montagne <montagne29 at wanadoo.fr>
> Subject: Re: [Bf-python] duplicate name entries in D.objects
> To: bf-python at blender.org
> Message-ID: <63814405-a438-1831-194b-73a2918d33c0 at wanadoo.fr>
> Content-Type: text/plain; charset="utf-8"
>
> Hi James,
>
> Name uniqueness of IDs (by types) is only ensured inside a given .blend
> file. It means that if you link datablocks from libraries, you can
> easily end up with several ones of the same type and the same name.
>
> To access those, you must use the tuple (ID_name, lib_path) (lib_path
> being None for current .blend data) - same to uniquely identify them in
> a dict e.g.:
>
> bpy.data.objects["Cube", "/my/path/to/library.blend"]
>
> Cheers,
> Bastien
>
> Le 24/06/2016 ? 02:47, James Crowther a ?crit :
> > Hi, just trying to understand why there are sometimes more than one
> > entry in D.objects with the same name? This behaviour was a little
> > unexpected for me since I had assumed that these collection types
> > behaved similarly to python dictionaries since they resemble them
> > closely in that they have a name, value pattern.
> > However, in a python dictionary it is not valid to have two entries
> > with the same name. This is certainly not the case for D.objects which
> > clearly can support more than one entry with the same name.
> >
> > I have experimented with renaming objects from the properties panel.
> > Lets say there is an object named 'Cube', if I add another object and
> > rename it to 'Cube', the object that had originally held the name
> > 'Cube' is renamed to 'Cube.001'
> >
> > So I was surprised to find that in D.objects, there are duplicates and
> > would like to understand why this happens, how to reproduce this
> > behaviour and whether this is useful behaviour or a byproduct of some
> > other feature?
> >
> > Kind Regards
> >
> > James
> >
> >
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at blender.org
> > https://lists.blender.org/mailman/listinfo/bf-python
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.blender.org/pipermail/bf-python/attachments/20160624/e52e264b/attachment-0001.htm
>
> ------------------------------
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> https://lists.blender.org/mailman/listinfo/bf-python
>
>
> End of Bf-python Digest, Vol 133, Issue 7
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20160624/867a1eba/attachment.html>


More information about the Bf-python mailing list