object.getData() != object.getData (?)

Every time i call “getData()” the data itself have a diferent value, why is that?
Ex: NMVert object at 0x016B78388 , NMVert object at 0x016B7AD8

How do you compare if a vert is already picked with 2 diferent getData()?

Thank you very much!

Python is object orientated in any way. Everything (data, functions, exceptions,…) is represented in objects. Each of these objects has its own identity, value and type.

When you grab something twice it is stored twice and in another location in memory.

The following example grabs an objects datablock from any selected object. This is done a second time and the id of each datablock is displayed. As you will see it’s different.
I dunno if this is all correct, but it sounds good to me.

For the rest, I have no good solution. Perhapes you try to make a list of vertices you already picked to compare with.

import Blender 
from Blender import *

print

ob = Object.GetSelected()[0]    # get the first of all selected objects

ob_data = ob.getData()    
print ob_data

ob_data2 = ob.getData()    
print ob_data2

print id(ob_data)
print id(ob_data2)

So, i make the question in a diferent way, what identifies a vertice as that especific vertice, even if we “Hash” or Xsort" the Mesh? Nothing?

what do you need to test?
if 2 objects are the same then their data wil lbe the same.
if you want see of 2 objects use the same data do this.


def object_data_cmp(ob1, ob2):
    if ob1==ob2: # same  object must have the same data
        return True
    
    # of objects are the same type and there datanames are the same then there data is the same. this saves a lot of work by not using .getData() directly.
    if ob1.getType() == ob2.getType() and ob1.getData(name_only=1) == ob2.getData(name_only=1):
    
    return False # data and or type differ.
        return True

basicaly

if ob1.getType() == ob2.getType() and ob1.getData(name_only=1) == ob2.getData(name_only=1):

I’m writing the error handler code for the Trim/extend script.

Basically, there’s a button to catch a face and a button to catch the edges to trim/extend. The data for both buttons can came from the same Mesh, but i want to check if there’s any vertice selected with the Edges that belongs to the Face.

Why don’t you make a hard copy of the first selected face’s data ?

Understood, cambo!:slight_smile: