[Bf-python] T40334 Review

Campbell Barton ideasman42 at gmail.com
Thu Jun 12 01:35:58 CEST 2014


Hi,

Blender users the "//" prefix internally to denote relative paths.

Posted full answer regarding relative paths here:

  http://blender.stackexchange.com/questions/12152


To add a fileselector, you can do 2 ways.

- Have a button referencing a string property with:
subtype='FILE_PATH'. This will show a text field in the UI with an
icon to select files on the right.
- Make your own operator which uses the file selector: See
TextEditor->Templates->Python->OperatorFileImport

On Thu, Jun 12, 2014 at 4:03 AM, Oren Titane <orentitane at gmail.com> wrote:
> Hello,
>
> For some reason "os.path.exists()" requires an absolute path to function
> unless I'm mistaking, thus needing relative path to be disabled for now,
> until I find a way to fix it. I would like to know how I could add a file
> selector just like the one in [ properties > texture > image ]
> https://dl.dropboxusercontent.com/u/11171255/Material%20Creator/image_selector.png.
>
> It would fix this same issue.
>
> On 14-06-10 08:31 PM, Campbell Barton wrote:
>>
>> Hi, In general having addons like this in contrib is fine, however its
>> a bit worrying that it requires to disable relative paths user
>> preference?
>>
>> I'd like to see that addressed before accepting,
>> added some other comments to T40334.
>>
>> On Wed, Jun 11, 2014 at 9:16 AM, Titane Oren <orentitane at gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> I would like someone to review my blender game engine add-on, please.
>>> Here is the link to my task: https://developer.blender.org/T40334, and a
>>> link to the unfinished wiki:
>>> http://rikutogame.dnsd.me/bge_material_creator.
>>>
>>> BR, Genome36.



-- 
- Campbell



More information about the Bf-python mailing list