Special Batch Processing (help)

Hi,

i select a object and i want to do this with a python-script:

  1. rotate object (X) 90° and scale (XYZ) to 0,1

  2. object mode -> object -> clear/apply -> applay scale/rotation

  3. object mode -> object -> transform -> center cursor
    this reset the coordinates to 0

  4. edit mode -> select all vertices -> P-Key -> All Loose Parts
    this should split a mesh into many parts

  5. make new created meshes to childs of my previous selected object

is this possible?

  1. yes
    http://members.optusnet.com.au/cjbarton/BPY_API/Object.Object-class.html#RotX
    http://members.optusnet.com.au/cjbarton/BPY_API/Object.Object-class.html#setSize

  2. I guess you could transform the mesh by
    http://members.optusnet.com.au/cjbarton/BPY_API/NMesh.NMesh-class.html#transform

  3. are you looking for this? http://members.optusnet.com.au/cjbarton/BPY_API/Object.Object-class.html#setDeltaLocation

  4. not sure if there is a method for that, but you can scan through mesh vertexes, remove them from the object and copy them to the new one.

  5. http://members.optusnet.com.au/cjbarton/BPY_API/Object.Object-class.html#makeParent

  1. OK

2+3) OK (i think i can do it with transform)
ps: deltalocation is something different

    • no plan how to do it… <<<<<<<<<<<<
  1. i think OK

transforming data by its matrix will make make its look right when location and rotation are 0,0,0 and size is 1,1,1

Separate by loose parts is the only thing you cant access from py.

Youd have to write one in python, if you want theres a functon that does most of the work in BPyMesh, (CVS) used from blenders quake map exporter. returns lists of faces in their groups.

use mesh.copy() and remove all face groups but one for each group.

use mesh.copy() and remove all face groups but one for each group.

but how to do this?

mesh_copy = mesh.copy()

Only works for Mesh, not NMesh,
blender 2.44 has data.copy() for most datatypes.

ok … and now? how can i remove group (?)