[Bf-python] Library.Open() - relative paths

Campbell Barton cbarton at metavr.com
Sun Oct 15 16:57:47 CEST 2006


Library.Open("//somblend.blend") now  wont raise and error, and will be 
saved as relative.

Campbell Barton wrote:
> Martin Poirier wrote:
>> --- Campbell Barton <cbarton at metavr.com> wrote:
>>
>>  
>>> Hi,
>>> Malefico needs to get python to open up relative
>>> blend's
>>> say Library.Open('//foo.blend')
>>>
>>> Currently this isnt supported because Library.c's M_Library_Open 
>>> func calls  readblenentry.c's  BLO_blendhandle_from_file
>>> that calls
>>> readfile.c's blo_openblenderfile
>>>
>>> and
>>> blo_openblenderfile dosnt support relative paths.
>>>
>>> Im a bit buisy right now to fix this so Id
>>> appreciate it if one of the other  c/python'ers  could solve this one.
>>> - Cam
>>>     
>>
>> Tell him to use the os.path module to "unrelativize"
>> the paths.
>>
>> Martin
>>   
> I dont think thats what he needs. - making a path unrelative with 
> Blender.sys.expandpath() would work but they want blender to have the 
> data linked to a relative path. so I assume people can load it on 
> there own workstation and have the blend referenced relatively.
> basically blender needs to accept and store relative paths from 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