Python call bmesh.ops.weld_verts allways raise an error #41971

Closed
opened 2014-09-27 09:26:22 +02:00 by Christophe Chabanois · 7 comments

System Information
Linux3.16.0-gentoo x86_64 Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz GenuineIntel GNU/Linux

Blender Version
Broken: 2.71

Short description of error

The python call to bmesh.ops.weld_verts allways raise the following error:
NotImplementedError: weld_verts: keyword "targetmap" type 10 not working yet!
even using bmesh.ops.find_doubles which returns the targetmap needed by the function.

Exact steps for others to reproduce the error

Code to run to reproduce error :

import bpy
import bmesh

bm = bmesh.new()

# creates a new cube with size 1
bmesh.ops.create_cube(bm)

# try to merge some verts
verts_to_merge = bm.verts[0:4]
verts_to_keep = bm.verts[0:2]
ret = bmesh.ops.find_doubles(bm, verts=verts_to_merge, keep_verts=verts_to_keep, dist=2.0)

- ret= {'targetmap': {<BMVert(0x725a130), index=2>: <BMVert(0x725a0c0), index=0>, <BMVert(0x725a168), index=3>: <BMVert(0x725a0c0), index=0>}}
- Raise : 'NotImplementedError: weld_verts: keyword "targetmap" type 10 not working yet!'
bmesh.ops.weld_verts(bm, targetmap=ret['targetmap'])

me = bpy.data.meshes.new("Mesh")
bm.to_mesh(me)
bm.free()

scene = bpy.context.scene
obj = bpy.data.objects.new("Object", me)
scene.objects.link(obj)

scene.objects.active = obj
obj.select = True

Further investigation

I think the error is in /blender/source/blender/python/bmesh/bmesh_py_ops_call.c
In method bpy_slot_from_py, the type 10 (BMO_OP_SLOT_MAPPING) exists, but due to a missing break keyword (line 509 I think), we fall in the default code which prints the message and returns -1

**System Information** Linux3.16.0-gentoo x86_64 Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz GenuineIntel GNU/Linux **Blender Version** Broken: 2.71 **Short description of error** The python call to bmesh.ops.weld_verts allways raise the following error: *NotImplementedError: weld_verts: keyword "targetmap" type 10 not working yet!* even using bmesh.ops.find_doubles which returns the targetmap needed by the function. **Exact steps for others to reproduce the error** Code to run to reproduce error : ``` import bpy import bmesh bm = bmesh.new() # creates a new cube with size 1 bmesh.ops.create_cube(bm) # try to merge some verts verts_to_merge = bm.verts[0:4] verts_to_keep = bm.verts[0:2] ret = bmesh.ops.find_doubles(bm, verts=verts_to_merge, keep_verts=verts_to_keep, dist=2.0) - ret= {'targetmap': {<BMVert(0x725a130), index=2>: <BMVert(0x725a0c0), index=0>, <BMVert(0x725a168), index=3>: <BMVert(0x725a0c0), index=0>}} - Raise : 'NotImplementedError: weld_verts: keyword "targetmap" type 10 not working yet!' bmesh.ops.weld_verts(bm, targetmap=ret['targetmap']) me = bpy.data.meshes.new("Mesh") bm.to_mesh(me) bm.free() scene = bpy.context.scene obj = bpy.data.objects.new("Object", me) scene.objects.link(obj) scene.objects.active = obj obj.select = True ``` **Further investigation** I think the error is in `/blender/source/blender/python/bmesh/bmesh_py_ops_call.c` In method `bpy_slot_from_py`, the type 10 (`BMO_OP_SLOT_MAPPING`) exists, but due to a missing break keyword (line 509 I think), we fall in the default code which prints the message and returns -1

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @Khrisbie

Added subscriber: @Khrisbie
Campbell Barton self-assigned this 2014-09-27 11:28:05 +02:00

This issue was referenced by 497d06d64d

This issue was referenced by 497d06d64d3009e61fb6e25dd0d5ecfde279f9cc

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 497d06d64d.

Closed by commit 497d06d64d.

Thanks !
In fact, several bmesh operators were unusable because of this, I think extension developers will be happy :-)

Thanks ! In fact, several bmesh operators were unusable because of this, I think extension developers will be happy :-)

This issue was referenced by 91fbdfa6a5

This issue was referenced by 91fbdfa6a504f7f0eb7dbf612c2265c10e64f562
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#41971
No description provided.