[Bf-python] Blender Launching an external image editor.

Campbell Barton cbarton at metavr.com
Thu Jul 22 02:59:58 CEST 2004


Hi, this is a script that launchs the gimp on linux, to edit.
Its nice because you dont have to ferrit around to open a uv texture map.

I was wondering if this is somthing people would like to get working 
with Win32/Gimp/Photoshop.

Also, it would be cool if image relaod in the image window was Alt+R, 
just like the text window.
- Cam


#!BPY

"""
Name: 'Edit in external editor'
Blender: 232
Group: 'UV'
Tooltip: 'Edit image in external editor'
"""

def stripFileFromPath(file):
  while file[-1] != '/':
    file = file[0:-1]
  return file

import Blender, os
from Blender import Object, NMesh
selection = Object.GetSelected()
if len(selection) == 0:
  print 'ERROR: Trying to edit image with no object selected'
else:
  object = Object.GetSelected()[0]
  if object.getType() != 'Mesh':
    print 'ERROR: Not a mesh'
  else:
    mesh = object.getData()
    image = mesh.getSelectedFaces()[0].image
    if image == None:
      print 'ERROR: Active face has no image selected'
    else:
      imageFileName = image.getFilename()
     
      # Account for the file name containing //
      if imageFileName[0:2] == '//':
        filename = Blender.Get('filename')
        filename = stripFileFromPath(filename)
        imageFileName = filename + imageFileName[2:]
     
      os.system('gimp-remote ' + '"' + imageFileName + '"')
 








Gilbert, Joseph wrote:

> This is a module that I think we need. Great. J
>
>  
>
> -----Original Message-----
> *From:* bf-python-admin at blender.org 
> [mailto:bf-python-admin at blender.org] *On Behalf Of *ChrisKeith at aol.com
> *Sent:* Wednesday, July 21, 2004 12:05 AM
> *To:* bf-python at blender.org
> *Subject:* [Bf-python] Questions about Python sound interface
>
>  
>
>  
>
> Hello all -
>
>  
>
> I'm working on a Python interface to the sound objects:
>
>
> http://home.pacbell.net/c_keith/projects/blender/misc/py_sound_interface.html
>
>  
>
> I am not familiar with the uses of sound in Blender, so I welcome
>
> suggestions and comments.
>
>  
>
> best regards,
>
> Chris Keith
>
> chriskeith(a)aol(d)com
>
>  
>


-- 
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