<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi James,</p>
<p>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.</p>
<p>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.:</p>
<p>bpy.data.objects["Cube", "/my/path/to/library.blend"]</p>
<p>Cheers,<br>
Bastien<br>
</p>
<div class="moz-cite-prefix">Le 24/06/2016 à 02:47, James Crowther a
écrit :<br>
</div>
<blockquote
cite="mid:CAJOwpNumH1_K2Ypdgi5rTY023dbpC3P_rEMf2NAELimWJFpHLQ@mail.gmail.com"
type="cite">
<div dir="ltr">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.
<div>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. </div>
<div><br>
</div>
<div>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'</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>Kind Regards<br>
<br>
James</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Bf-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-python@blender.org">Bf-python@blender.org</a>
<a class="moz-txt-link-freetext" href="https://lists.blender.org/mailman/listinfo/bf-python">https://lists.blender.org/mailman/listinfo/bf-python</a>
</pre>
</blockquote>
<br>
</body>
</html>