Help for new script

is it possible to write a simple script to

1 ) after selecting an object
you save all ( or Most ) the object variables on an ASCII files
Then Start the execution of an indepednant Module outside of Blender

Then from this new program it can read the ASCII files and  can change whatever content of the variables  and resave on the ASCII file

Then  when you come back to the Scritpt file 

you can read the ASCII file and change the values of the variables for the Selected object

It sounds a bit ridiculus but it would be a nice way to get a friendly window
on my PC and not have to deal with the complicated prensentation in Blender

The outside Task can then be written in wahever you wish.

tanks & Salutations

is it possible to write a simple script to

[details snipped]?


I know that Anything is possible ect…

Can someone give me an example of this ?

Is there a list of all the variables that we can find for one object with the name use on the differente menu and in the script?

an dhow to start an external task ( XYZ.EXE )



Untrue. The laws of thermodynamics, limitations in whatever api, language and computer platform you are using, your own motivation, etc.

Is there a list of all the variables that we can find for one object with the name use on the differente menu and in the script?

Look in the Blender Python API documentation for the details about the objects of interest.

an dhow to start an external task ( XYZ.EXE )

Look at the Python documentation. The os.system() call will be useful. Also read about file i/o.


Learn enough about Blender to save and load text files and scripts. Learn how to execute Blender scripts. Look at other scripts like the importers and exporters for examples of what you want to do.

Learn whatever programming language you are going to write the rest of the application in.

What you want do is not complicated. You just need to have some basic knowlege first.

I got fed up reading the doc -
in Python you can ask an object for its methods

  • the getters and setters.

This is often easier/quicker than reading the BPY doc…;

ObProps does this, saving the answer as a dict
that you can write in a variety of ways

There’s also a setter function that take’s the dict
and sets an objects properties.

Good luck -

import Blender
import sys

from Blender import Object,Material

def getFreshText(name):
  x = Blender.Text.Get(name)
  x = Blender.Text.New(name)
 return x

def prettyPrint(dict):
 show = []
 for key,value in dict.items():
  show.append("%s = %s" %(key,value) )
 return "%s

class ObProps:
 '''look for properties that have getters/setters in BPy api'''
 def __init__(self,obj):

  props ={}
  #if obj.getType != "
  getters = [x for x in dir(obj) if x[:3] == 'get']
  for method in getters:
    exec 's = obj.%s()'%method
    props[method[3:]] =  s
    print "props warning : skipping %s"%method = props

 def __repr__(self):
  tmp = [ (repr(a).ljust(15),repr(b).ljust(25)) for a,b in]
  return ''.join(["%s%s
"%x for x in tmp])

 def asSetters(self):
  show = []
  for key,value in
   show.append("obj.set%s(%s)" %(key,value) )
  return "%s

 def asDict(self):
  show = ["{"]
  for key,value in
\'%s\' : %s" %(key,value) )
  if len(show)==1:
   show[-1] = "
  return "".join(show)

def exportIpo(ipo):
 exportDict ={}
 exportDict['Name'] = ipo.getName()

 cvs = {}
 for posCv,cv in enumerate(ipo.getCurves()):
  #dd['Extrapolation'] = cv.getExtrapolation()
  pts = []
  for x in cv.getPoints():
	y = x.getPoints()
  cvs[cv.getName()] = pts
 exportDict['Curves'] = cvs
 return exportDict

def printIpo(dict):
 xx = ["%sIpo = {"%dict['Name'],]
 for name,pts in dict["Curves"].items():
  xx.append('''"%s" :  '''%name)
  ptStr = ["["]
  for a,b in pts:
  ptStr[-1] = "]"
 xx[-1] = "
 return "".join(xx)

def matData(name):
 mat= Blender.Material.Get(name)
 fp = getFreshText(''%name)

def ipoData(name):
 mipo = Blender.Ipo.Get(name)
 fp = getFreshText(''%name)

def partsData(name):
 parts = Blender.Effect.Get(name)[0]
 fp = getFreshText(''%name)

def setFromDict(obj,dict):
 for a,b in dict.items():
   print "WARNING : setFromDict failed to set %s"%a

def dictFromMtex(mtex):
 dict = {}
 for var in dir(mtex):
  if var[:2] !="__" and var not in ["setTex", "tex"]:
	dict[var] = eval("mtex.%s"%var)
 return dict

obj = Blender.Object.GetSelected()[0]

print ObProps(obj).asDict()