Suppose There are 1 Base Obj 4 More OBJ with the same vertex counting.
Is thee any way that 1st OBJ vertex positions should be as Basic Shape Key and Rest 4 OBJ’s vertex positions should be treated as 4 Shape Keys.
Is there any way in python to do that?.
“rvk 1 to rvk 2” can do it.
Since “rvk 1 to rvk 2”.py is too complicated to use [you have to go to edit mode in both objects and select all verts], I made a simple script that does just what I need: select two objects in Object mode and use the first one’s shape to make a new Shape key in the second object:
http://blenderartists.org/forum/showthread.php?p=747701
Great
Just Great. FunduCode…
Thanks
HI, you try my http://claudiojd.googlepages.com/copy_all_shapes.py ?
is a development of rvk1torvk2.py but copy all shapes at same time (loop into first obj shapes and copy at second object)
Is there any way in Python that it should select Multiple Objects programatically.
for example there are 5 objects (Mesh) obj1,obj2,obj3,obj4 and obj5
I want all these 5 object to be selected thru python and merge them.
kkrawal: You could use Object module to get all objects
objects = Blender.Object.Get()and then use Object class’ getData() to pick those that are mesh objects. The bad side of this is of course that you may pick mesh objects you do not want. If so, check their names to be suitable or figure out something else.
I hope this gets you started. Use the API! http://www.blender.org/documentation/242PythonDoc/frames.html
Hello,
I am looking for this exact script. I was going to post to see if I could get some assistance in writing it. I have been studing Python, but I have yet to write a serious script and this is something I need. From what I can tell this is what needs to happen.
You would start with two objects. Let’s call them objectA and objectB.
set variable verticiesLength to the number of verticies of objectA -1
set variable x = 0
start a loop that will iterate from 0 to verticiesLength
select objectA
enter “edit mode”
select verts[x]
snap cursor to selection
exit “edit mode”
select objectB
enter “edit mode”
select verts[x]
snap selection to cursor
exit “edit mode”
x = x + 1
end loop
EOF
I think that would do it, but there are plenty of things I would need t figure out before I could get that to work. It might be easier to do something like this.
set variable verticiesLength to the number of verticies of objectA -1
set variable x = 0
start a loop that will iterate from 0 to verticiesLength
getLocX for objectA.verts[x]
setLocX for objectB.verts[x]
getLocY for objectA.verts[x]
setLocY for objectB.verts[x]
getLocZ for objectA.verts[x]
setLocZ for objectB.verts[x]
x = x + 1
end loop
EOF
I think that would be much easier to write, but I wonder if Blender would let the script edit verticies in object mode? Dont know.
I’d be happy to give it a shot if someone could tell me the code to get the coordinates for a verticies and assign it to another. I think I could figure the rest out. Any takers?
Stephen
Could it be you’re looking for this?
http://blenderartists.org/forum/showpost.php?p=748714&postcount=13
That is exactly what I am looking for. I’ve been working with it for a bit here, and I keep receiving this error.
File “copy_paste_verts_.002”, line 3
import Blender
^
SyntaxError: invalid syntax
I’ve been trying it on both OS X and Windows and I have both ojects selected in object mode. For the objects I was just keeping it simple and using two cubes, with the second one modified. Do you have any ideas what I’m doing wrong?
Thanks
Stephen
Figured it out. When I copy and pasted the code it wrapped weird essentially breaking it. Thank you for this wonderful script!
Stephen