Python script for moving and fixing an object


I was wondering if you guys could help me with this: I want to know what are the important functions for writing a script to load (.3ds) an object and move it in terms of a fixed object (say a glasses to a human face). I am a programmer, but I am new to blender and python. Are there any scripts that would do this? Please help me. Thanks.


Doesn’t seem to hard. There is already a script to import .3ds files. You would use that script. Once the file was imported, get the object you want moved and change its coordinates accordingly.

import 3ds_import


obj = Blender.Object.get("Cube")

# Calculate where it should be moved to...

obj.LocX = ?
obj.LocY = ?
obj.LocZ = ?

i did notice there is a problem when doing the import 3ds_import, it says there is an error because the module name starts with a number, i just copied the file and named it something different.

Thanks for replying. I am also linking an object from another .blend file, but the script I found doesn’t hold the parent/child relation of the object (the object is composed of multiple objects). What can I do? Thanks in advance.

Not really for sure, you would probably have to link all of the objects to your current file to keep the relationships.