Referencing Object

let’s say you have a script link on framechange. Is there a way to indirectly reference the object using something like the python (self) keyword. Or must I hard code the reference.

i.e ob = Blender.Get(“Sphere”)

inderect reference

i.e. for v in self.Mesh.verts:
v.co = Func()

We’ll looking over the example script http://blenderartists.org/forum/showthread.php?t=150040 I discovered the answer to my question.

if bylink:

ob = link

I ended up writing a function like this in Blendgraph:


def fetchIfObject (passedObjectName):
 # NOTE: Returns the object even if it is unlinked to the scene.
 try:
  tempObj = Blender.Object.Get(passedObjectName)
  return tempObj
 except:
  return None

If you know the name of an object you can simply fetch it. Then use code like this to see if it is valid.


ob = fetchIfObject (passedObjectName)
if ob != None:
    # More code here to process object.