Redo broken for transform.edge_crease(), and doesn't do anything if called from Python script
Closed, ArchivedPublic

Description

Tested in: 2.70.5 (06a05e4)

  • Default Cube
  • Editmode
  • select an edge
  • start Edge Crease modal operation (Shift+E).
  • Set it to e.g. 0.7 and confirm.
  • Redo panel shows "Edge Crease 1.0", which is obviously wrong.
  • If you slide the value property, the edge crease indicator (red lines) disappear in 3D View, even if set to 1.0 again in Redo panel.

In addition, it doesn't work if called with python. It seems like execute() is broken / not supported, which would explain both problems:

Default Cube, Editmode, run below script:

import bpy


def main(context):
    for ob in context.scene.objects:
        print(ob)


class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        
        bpy.ops.transform.edge_crease(value=1)
                
        return {'FINISHED'}


def register():
    bpy.utils.register_class(SimpleOperator)


def unregister():
    bpy.utils.unregister_class(SimpleOperator)


if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.simple_operator()

Details

Type
Bug
codemanx created this task.Jun 2 2014, 7:07 PM
codemanx updated the task description. (Show Details)
codemanx raised the priority of this task from to Needs Triage.
codemanx added projects: BF Blender, Python.
codemanx set Type to Bug.
codemanx added a subscriber: codemanx.
Sergey Sharybin (sergey) closed this task as Archived.Jun 3 2014, 6:58 AM
Sergey Sharybin (sergey) claimed this task.

it's usually a bad practice to call operator from another one. Especially calling modal operator from non-modal one. You need to modify crease by using context.object.data.edges[X].crease = 1 or so.

@Campbell Barton (campbellbarton), summoning you here just in case you've got different opinion about calling operators from operators.

But for now wouldn't consider this is a bug.

codemanx renamed this task from transform.edge_crease() doesn't do anything if called from Python script to Redo broken for transform.edge_crease(), and doesn't do anything if called from Python script.Jun 3 2014, 4:46 PM
codemanx updated the task description. (Show Details)
codemanx reopened this task as Open.
codemanx added a project: Mesh Modeling.

Re-opened, because it's not only a problem if called from another operator, but rather any call to it (Python console / Text editor) does nothing, and Redo support is broken as well.

Sergey Sharybin (sergey) closed this task as Archived.Jun 3 2014, 6:08 PM

It's still not a bug, just some design stupidness of the transform system. Committed some tweaks at rBc918f24 so now it's a bit more convenient to use redo panel for crease/bevel.

It's still loads of cases when transform redo fails and they better be tackled all at once with some transform area revisit.

It's probably something else what picky users might consider to be improved here, but really -- that's all not a bugs and to be handled outside of the bug tracker.