Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(15)  |  Derive(0)  |  Import(1)

src/p/y/PyPRP-HEAD/PyPRP/prp_Functions.py   PyPRP(Download)
            me.transform(mat)
            me.update()
            mat = Blender.Mathutils.Matrix([1.0,0.0,0.0,0.0],[0.0,1.0,0.0,0.0],[0.0,0.0,1.0,0.0],[0.0,0.0,0.0,1.0])
            o.setMatrix(mat)
            bb = o.getBoundBox()
            cu = [bb[0][n]+(bb[-2][n]-bb[0][n])/2.0 for n in [0,1,2]]
            mat = o.getMatrix()
            mat = Blender.Mathutils.Matrix(mat[0][:],mat[1][:],mat[2][:],[-cu[0],-cu[1],-cu[2],1.0])
            me.transform(mat)
            me.update()
            mat = Blender.Mathutils.Matrix(mat[0][:],mat[1][:],mat[2][:],[cu[0],cu[1],cu[2],1.0])
            o.setMatrix(mat)
 
        if o.getType() == 'Mesh': #Applies all scales and rotations (imitates CTRL+A behaviour)
            me = o.getData()
            mat = Mathutils.Matrix(o.matrix[0][:],o.matrix[1][:],o.matrix[2][:],[.0,.0,.0,1.0])
            me.transform(mat)
            me.update()
def getMatrix(object):
    try:
        m=Blender.Mathutils.Matrix(object.getMatrix())
    except TypeError:
        i=object.getMatrix()

src/p/y/PyPRP-HEAD/PyPRP/prp_LogicClasses.py   PyPRP(Download)
        # combine the matrices!
 
        IdentityMtx3d = Blender.Mathutils.Matrix([1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,0])
        btmMtx = btmRotMtx + btmTrlMtx - IdentityMtx3d
        topMtx = topTrlMtx + topRotMtx - IdentityMtx3d

src/p/y/PyPRP-HEAD/PyPRP/prp_GeomClasses.py   PyPRP(Download)
 
        try:
            self.vmatrix = Blender.Mathutils.Matrix(a,b,c)
        except NameError:
            pass
        d=[self.matrix[3][0],self.matrix[3][1],self.matrix[3][2],self.matrix[3][3]]
        try:
            self.vmatrix=Blender.Mathutils.Matrix(a,b,c,d)
        except NameError:
            pass

src/p/y/PyPRP-HEAD/PyPRP/prp_ObjClasses.py   PyPRP(Download)
    def set_matrices(self,localtoworld,localtoparent=None):
        l2w = Blender.Mathutils.Matrix(localtoworld)
        w2l = Blender.Mathutils.Matrix(localtoworld)
        w2l.invert()
 
        if(localtoparent):
            l2p = Blender.Mathutils.Matrix(localtoparent)
            p2l = Blender.Mathutils.Matrix(localtoparent)
            p2l.invert()
        else:
            l2p = Blender.Mathutils.Matrix(l2w)
            p2l = Blender.Mathutils.Matrix(w2l)
 

src/b/l/blender2cal3d-HEAD/blender2cal3d.py   blender2cal3d(Download)
from Blender.Armature import *
from Blender.Registry import *
from Blender.Mathutils import Matrix
 
# HACK -- it seems that some Blender versions don't define sys.argv,