3
$\begingroup$

How can I select all creased edges with specific weight at once, can be with python

import bpy

obj = bpy.context.object
me = obj.data

bpy.ops.object.mode_set(mode='OBJECT')

for e in me.edges:
    if e.crease > 0.5:
        e.select = True
        print (e.crease)

bpy.ops.object.mode_set(mode='EDIT')

This script works fine till 3.6, but not 4.0.

4.0 say, "mesh edge does not have 'crease' in line if e.crease > 0.5:".

Is something changed?

$\endgroup$

1 Answer 1

3
$\begingroup$

There was a change in the handling of Bevel weight and Creases in 4.0

I faced the same issue today and here is the solution in my case, but not sure how it would work for your specific problem: Displaying and changing selected edges Mean Crease in python

Perhaps in your case simply add the line crease = bm.edges.layers.float.get('crease_edge', None) if bpy.app.version >= (4,0,0) else bm.edges.layers.crease.active

You can find more info on the changes for Python in 4.0: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .