Reimport and Update Mesh

I am not an expert in programming Blender addons and would be happy to receive tips to implement the following:

Keyshot is a rendering software that is often used by industrial designers.
It has an fast and easy to use collaboration with CAD software through plugins.

CAD Software: Modeling —> Keyshot: Visualization:
Edit CAD (Rhino) —> One Click: Update Keyshot Render Scene —> Check Design —> Edit CAD —> One Click: Update Keyshot render scene …

I think Blender can be a free and better alternative to keyshot. What’s missing is just a little “Update Geometrie Plugin”

The Plan:

  • Import geometry via OBJ.
  • Import first Time:
    Does the object name from the OBJ file not existent in the blendfile, everything runs with normal OBJ import.
  • Import second time / update
    If a mesh/object exists with the name from the OBJ,
    the mesh is updated. Material and object are not touched.

How to do the mesh update?
(It is important that the name is kept and that no name.001 is created.)

Way 1:
Just overwrite the mesh data[name].faces / vetices…
But it looks like, it’s not possible?

Way 2:
bpy.ops - something like this ?: Blenderartists Topic

    for v in
        if[1] > 0:
   = True

Way 3:
Rename, delete and create mesh → Create new with correct name?

Which one should I take? Thanks! :slight_smile:

Next steps:
Rhino Plugin → OBJ Export → IPC File → Blender Plugin

1 Like

You should be able to simply import the new mesh, remove the old one, and rename the new one to the original name without actually editing any meshes. If you do end up needing to edit the mesh directly, use BMesh.

Thanks. Bmesh is a wired to me… :slight_smile:
and for now, this way seems to work:

#dataname = Object name

#Deselect and select
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')[dataname].select_set(state=True) =[dataname]

# Remove vertecies to clean mesh blank before add new imported

me =[dataname]

default obj import script follows…


Hey @justWolf, I’m trying to create a very similar workflow to yours, except instead of Rhino, I’m going to be exporting OBJs from MoI, then importing into Blender.
However, I am really struggling with getting OBJ meshes instead of new objects. Would you be willing to share some more info? How much of the default OBJ import script did you use?

Thanks in advance