1
$\begingroup$

Let's say I have a file with a list of locations, rotations and scales:

1.32 3.434 4.4 - location
24.1 32.1 0.0 -rotation
1.2 1.3 0.75 - scale

12 32.4 -32.2 -location of mesh 2
0.0 90.0 32.45 - rotation of mesh 2
0.8 1.0 1.2 - scale of mesh 2

etc.

Is there any addon that will allow me to create copies of a mesh with these transforms.

If there isn't, do you know how could I write it or find someone that will?

Thanks in advance.

$\endgroup$
1
  • $\begingroup$ Are you looking at object level transforms or edit level transforms? You may want to look into matrix transformations. If you are able to get the matrix out of whichever way you are achieving the transformation values, you can then multiply that matrix with the mesh's original matrix to transform your object. $\endgroup$
    – dimitarsp
    Dec 23, 2015 at 14:32

1 Answer 1

3
$\begingroup$

Not sure of an addon like that but you can easily create your own script. The following creates new objects using the same mesh data and positions them with your data.

import bpy

scn = bpy.context.scene
orig_data = bpy.data.objects['Cube'].data

obj_specs = [
        [(1.32, 3.434, 4.4), Euler((24.1, 32.1, 0.0), 'XYZ'), (1.2, 1.3, 0.75)],
        [(12, 32.4, -32.2), Euler((0.0, 90.0, 32.45), 'XYZ'), (0.8, 1.0, 1.2)],
]

for loc,rot,scl in obj_specs:
    new_obj = bpy.data.objects.new("newObj", orig_data)
    new_obj.location = loc
    new_obj.rotation_euler = rot
    new_obj.scale = scl
    scn.objects.link(new_obj)

scn.update()
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .