Equivalent to Ctrl-A for mesh

i was given this but it is for Nmehs only

import Blender
import BPyNMesh
obj = Blender.Object.Get(“MyObject”)
BPyNMesh.ApplySizeAndRotation(obj)

is there an equivalent for Mesh object
and how do you write it ?

Thanks

You could open up the BPyNMesh file and see if you can tell what the difference is from the NMesh and Mesh. I dont know how hard it would be to convert it over to a Mesh object.

well i cannot find any reference in the index to this command !

so that’ why i’m asking if any body knows how to do this one for a mesh

but the thing is that Nmesh is deprecated so not very usefull anyway!

Thanks

sz = (1.0,2.5,3.23)
rt = (0.5,0.1,0)
ob.size = sz
ob.rot = rt

That’s it! :slight_smile:

i need an equivalent to Ctrl-a

i’v already set the values for the object

but when i go into the n-Transform panel i dont have the right values
to check if it’s located at the right place

so i need this equivalent to Nmesh apply roation… command

there must be a way to reset the value for this N transform panel ?

also if i read the values
i don’t get the new updated valaues only the old value

List vertex for Plane

for v in redMesh.verts:
vert = redMesh.verts[jj]

sommet=redMesh.verts[(v[0], v[1], v[2])]

v1 =redMesh.verts[jj].co
print ’ v1 co t=’,v1

sommet=redMesh.verts([v1.x, v1.y, v1.z])

print ’ sommet=’,sommet

print’ v1 =’,v1
x2=0
y2=0
print ‘vert (’,jj,’) =’,vert

sommet.append([v1.x,v1.y,v1.z])
print ’ sommet=’,sommet
jj+=1

so the object needs to be CTrl-A to get the right values
or an equivalent to it so i can read the updated values

Thanks

if you are in Object mode just use

    Window.EditMode(1)
    Window.EditMode(0)

In Edit mode - use the opposite :wink:

This will “show” the changes made…

waht do you mean to use the opposite?

form

Window.EditMode(1) to Window.EditMode(0) ?

i tried it but refused to do it error

what is the module to be loaded for this new functions?

Thanks

Here this works for me:

from Blender import *
import bpy

def Do_something():
    editmode = Window.EditMode()
    sce = Scene.GetCurrent()
    ob = Object.Get("Cube")
    sz = (1.0,2.5,3.25)
    rt = (0.5,0.1,0)
    ob.size = sz
    ob.rot = rt
    if editmode:
        Window.EditMode(0)
        Window.EditMode(1)
    else:
        Window.EditMode(1)
        Window.EditMode(0)
    print
    print "OK........"
    print

Do_something()

… and this is what I mean :wink:

ok this might be usefull if i go into edit mode in blender and then select some vertex

i think !

but this does not resolve the problem in my script
there i’m not in edit mode !

so is there another way to do Ctrl-a to that object
so that when i read the data in the mesh i get the real vertex values not the old values before the modfication?

Thanks

It works also in Object mode :wink:

1
first i cannot get to print the vertex don’t know
need the name of the mesh i guess?

2
now i check out the N - transform panel after exec the little program
and it did not change the values in it ?

so why is it not working here ?

3 - i added this to print the values of vertex
the values are still the same than the original cube!
[]

me = B.Object.Get(‘Cube’)
print ob # the object
print ob.name # object name
print ‘location’, ob.loc # object location

mesh =me.getData(mesh=True)

for v in mesh.verts:
print ‘v =’,v

[]

and that’s where the problem is it should be the modified values and it’s not!

Thanks

you could try this : http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_pythonresizerot.htm#Imiter_ctr_-a