Page MenuHome

bpy.ops.object.editmode_toggle() work in python console but dont work in addon
Closed, ArchivedPublic

Description

Does not work in plugin

bpy.ops.mesh.primitive_plane_add()
oldmode = bpy.context.mode
bpy.ops.object.mode_set( mode = 'EDIT' )
bpy.ops.unwrap( method = 'ANGLE_BASED', margin=0.001 )
bpy.ops.object.mode_set(mode=olodmode)

does not work also
bpy.ops.mesh.primitive_plane_add()
bpy.ops.object.editmode_toggle()
bpy.ops.unwrap( method = 'ANGLE_BASED', margin=0.001 )
bpy.ops.object.editmode_toggle()

In both cases operator used on OBJECT mode but after executing blender still in 'EDIT' mode.

And BUG 2: There is no normal documentation for addons developers. With samples.

Event Timeline

Oksana (FelSm) raised the priority of this task from to 90.
Oksana (FelSm) updated the task description. (Show Details)
Oksana (FelSm) added a project: BF Blender.
Oksana (FelSm) edited a custom field.
Oksana (FelSm) added a subscriber: Oksana (FelSm).

Was trying also

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

Not work anyway.
Guys, its a huge bug of blender - no normal documentation for developers.

It just seemed wrong.
Try this.

bpy.ops.mesh.primitive_plane_add()
oldmode = bpy.context.mode
bpy.ops.object.mode_set( mode = 'EDIT' )
bpy.ops.uv.unwrap( method = 'ANGLE_BASED', margin=0.001 )
bpy.ops.object.mode_set(mode=oldmode)
Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.Mar 28 2016, 4:09 PM
Bastien Montagne (mont29) claimed this task.

This is not a valid bug report at all!

Please follow our submission template and guidelines and make a complete, valid bug report, with required info, precise description of the issue, precise steps to reproduce it, small and simple .blend and/or other files to do so if needed, etc. Videos end/or links to external sites etc. are not acceptable as bug report (they can be provided as additional information only).

Please seek user support on user forums like blenderartists.org or blender.stackexchange.com.