Inconsistency with vetex movement

Inconsistency with vertex movement.ok i made a script that will find the first and last vert of a cube using the vertex color as marker. as far as i can tell my script should work with out a problem but when running test i find that sometimes it does not move the verts and does nothing and other times it moves part of the mesh. just duplicate the cubes a few more times and combined the mesh play with it a bit u will see what i am talking about. any help would be Appreciated. :slight_smile:

my blend vertSelect_1.0.blend (484 KB)
just move closer to blocks and left click

any thoughts? I’m really stuck on this one :’(

I played with your .blend for a bit but could not really figure out what it was supposed to do.

You will have to post a very clear description of what clicking on the box is supposed to do as well as a clear description of what it is currently doing.

it works the way its supposed to 90 percent of the time. But every once in awhile it will glitch and not move the right vertices or not move any. I’ll post a pic when I get home. at work atm. Oh duplicate the cubes and combines them into one mash. to see the glitch that it does. duplicate like 20 times

this is the glitch that im having. only some of the verts move. im thinking the mesh in blender and the mesh in the bge are different. like 6 verts per face instead of 4.

i tried to work around this by make the first and last vertex blue with a script and then add the cube with ob = sce.addObject(“Cube”,own,0) but when i hit any of the cubes with a ray all the cubes are effected and are moved. i just want to move one.

well, i still dont udnerstand how it should work?! Is it maybe the same result when you duplicate some Cubes, Join them, go to Edit Mode, select everything and use the “remove doubles” tool? Atleast it sounds like that.

You are right the mesh in Blender and the mesh in BGE are complete different.

A KX_MeshProxy consists of a set of polygons (KX_PolyProxy). Each polygon can have 3 (triangle) or 4 (quad) vertices (KX_VertexProxy).
The vertices are not shared by other polygons.

As you want to move a face you need to find the according polygon and move it’s vertices and only it’s vertices.

According to your image you are moving two vertices from one polygon and two vertices from another one.

ill try to describe what im am trying to do.
-i have ran a script to mark the color of the first and last vert of a cube (can be any shape)
-then i used vertex paint mode to mark the same verts manually. (then disabled making script)
-than i duplicated the cube a few times and combined the mesh. (for scene graph improvement)
-i have a ray from the camera hit a face on the combined mesh of cubes and return the face and check if v1,v2,v3,v4 so i can search the mesh for that vert.
-then loop through the mesh from v1 appending vert to a list untel i find a vert that is marked blue(than stop the loop)
-do the same thing but in reverse to get the other vert
-than apply the change to the vert of the list of appended verts like move them to x-10000 y-10000 z-10000(outside of camera frustum culling)
its for making a minecraft setup but not cubes i could use other shapes as long as i mark the beginning and the end properly witch i think is my problem atm.
is there a way to make unique Instances of a obj? i tried adding a 10x10x10 block of cubes with python and as soon as i fire my ray at any of the cubes they all get moved.

Usually you do not work on mesh level to move objects. I understand why you want to do that.

Anyway you can use LibNew to create a copy of a mesh.

Can I trouble u for an example? In having trouble understanding how to use libnew.

I suggest to look at the BGE API. I used this method just once. It is not that hard.

Be aware it does not add anything to an existing mesh. You get a copy of a mesh, which can be used by a replace mesh actuator.

keep getting ‘the name of the path given exists’ i have found very little infomation on this and libNew for that matter.

for i in L:
    ob = sce.addObject("CubeSpawn",own,0)#added in from layer 2
    idx = 0
    New_mesh = bge.logic.LibNew('meshlist' + str(idx),'Mesh',['block']) #block is the mesh name of CubeSpawn 
    print(New_mesh,'new mesh')#prints [block.001] it seems the str(idx) is not working
    idx=idx + 1

any helpful feed back would be Appreciated :slight_smile: