[Bf-python] Request for Plumiferos
Campbell Barton
cbarton at metavr.com
Thu Nov 2 16:42:33 CET 2006
Hi Malefico,
Id realy like linked lib stuff to be transparent to python, one nice
addition would be a way to see if data was apart of a linked lib.
It may be worth adding a library type,
The Outliner currently allows you to get/set paths so it might be nice
if python could also.
Library.GetLinked() - returns a list of library types.
The only attribute youd be able to edit initialy at least...
lib= Library.GetLinked()[0]
print lib.path
lib.path = '//some.blend'
lib.reload() - would be realy nice also.
If nobody else wants to Ill try do this in the next week or so....
* define a new lib type - with get/set path
* add a keyword option for .Get(...) so all the get functions can
optionally get only spesific library or local data.
* add a func to get all loaded libs
* add .lib property to some data types - mesh.lib object.lib -
eventually all library types should be supported.
* add .reload() - probably a lot later on. Im not sure this is
supported with the current system/
dont want to railroad this- maybe others could comment?
- Cam
malefico andauer wrote:
> Thanks for replying Campbell. Yes, if I could choose I
> wouldn't use same names :-) , but I don't have any
> options about it in my case.
>
> This kind of problem would be trivial once we have
> poseable linked groups, so we can pose a character
> imported via link, and don't need to append it. Ton
> told me he is going to work on that soon.
>
> However, there will still be situations in which I
> have to apply a new version of material or texture to
> meshes that have already been imported to scene file.
>
> Anyway, I hope this can be tackled in the near future
> by some kind soul :-).
>
> Regards
>
> malefico
>
> --- Campbell Barton <cbarton at metavr.com> escribió:
>
>
>> Hi Malefico, Iv been using linked libs recently and
>> had similar problems
>>
>> my solution at the moment is to never have double
>> names, so no Cube.001 ;)
>>
>> Long term Id like to impliment a solution.
>>
>> making Mesh.Get() only return local could be error
>> prone, maybe
>> Mesh.Get(lib=None) or alternativly
>> Mesh.Get(lib='//my_blend_lib')
>>
>> A function to get currently linked libs would be
>> usefull also.
>> Library.GetOpenLibs() ? - return a list of strings -
>> like the outliner.
>>
>> that way you could get data from any lib.
>>
>> - Cam
>>
>>
>>
>> malefico andauer wrote:
>>
>>> Hi there,
>>>
>>> My python guru at the studio prompted me with the
>>> following problem, which I'll try to explain:
>>>
>>> He is coding a script to link materials and UV
>>>
>> maps
>>
>>> from library objects to same objects that have
>>>
>> been
>>
>>> imported and animated in different scenes, so we
>>>
>> can
>>
>>> change textures or UV map info in lib file, and
>>>
>> then
>>
>>> update all data in animated scenes by running this
>>> script.
>>>
>>> Problem is if datablocks in lib file and anim file
>>> have exactly the same name (as in this case) we
>>>
>> can
>>
>>> only read data from local (animated) file.
>>>
>>> For instance:
>>>
>>> Blender.Mesh.Get("character_X") returns local
>>> Character X only. The one that was linked and had
>>> exact same name is never returned.
>>>
>>> Blender.Mesh.Get() returns a list of all meshes
>>> (included the ones linked from lib) so after this
>>> calling we have duplicated names (the one in lib
>>>
>> and
>>
>>> the one in anim file) and thus we cannot tell
>>>
>> which is
>>
>>> which. He tried using index of this list to
>>>
>> identify
>>
>>> them, but this is random so we can't be sure.
>>>
>>> So what he suggests is: a new method that return
>>>
>> all
>>
>>> datablocks that are already linked from external
>>> sources so we can tell which are local and which
>>>
>> are
>>
>>> external and also that Blender.Mesh.Get() returns
>>>
>> only
>>
>>> local datablocks, not external.
>>>
>>> Other way around could be that
>>>
>> MeshObject.Library()
>>
>>> returns path of library or "none" besides current
>>> information, so source could be identified
>>>
>> positively.
>>
>>> I hope this is clear enough (I bet it isn't), any
>>>
>> help
>>
>>> either code or hints will be highly appreciated
>>>
>>> Regards and thanks in advance
>>>
>>> malefico.
>>>
>>>
>>> __________________________________________________
>>> Correo Yahoo!
>>> Espacio para todos tus mensajes, antivirus y
>>>
>> antispam ¡gratis!
>>
>>> ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
>>> _______________________________________________
>>> Bf-python mailing list
>>> Bf-python at projects.blender.org
>>>
>>>
> http://projects.blender.org/mailman/listinfo/bf-python
>
>>>
>>>
>> --
>> Campbell J Barton
>>
>> 133 Hope Street
>> Geelong West, Victoria 3218 Australia
>>
>> URL: http://www.metavr.com
>> e-mail: cbarton at metavr.com
>> phone: AU (03) 5229 0241
>>
>> _______________________________________________
>> Bf-python mailing list
>> Bf-python at projects.blender.org
>>
>>
> http://projects.blender.org/mailman/listinfo/bf-python
>
>
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>
>
--
Campbell J Barton
133 Hope Street
Geelong West, Victoria 3218 Australia
URL: http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241
More information about the Bf-python
mailing list