[Bf-python] Fileselector [new: + bg mode]

Paolo Colombo info at blender3d.it
Sat Mar 19 18:06:20 CET 2005


Willian Padovani Germano wrote:
> Willian Padovani Germano wrote:
> 
>> Paolo Colombo wrote:
>>
>>> Is there a way to call the filesector from a script running in a 
>>> scriptlink?
>>
>>
>> No, scripts that call the file/image selectors need to have their 
>> global dicts preserved until the selector callback finishes.
>>
>> But I'll work on letting scripts run other scripts (a 
>> Blender.Exec(script) function, probably), so that and other things 
>> should become possible.
> 
> 
> Done. Check the Blender.Run(script) function committed yesterday (forgot 
> to mention it in the cvs commit msg).  It can be used to execute files 
> in the file system or Blender Texts, like the "blender -P script" command.
> 
> So, if you need a file selector in a scriptlink, for example, write a 
> Blender Text to open the file selector:
> #---- Text
> def f(filename):
>  # do something with the filename
> 
> Blender.Window.FileSelector(f)
> #----
> 
> and in your script link call it with Blender.Run(Text).
> 
> The script will run in its own context, with its own global dictionary, 
> as if called with ALT+P.
> 
Tnx well done :-) as always

Paolo



More information about the Bf-python mailing list