Upgrading Blender add-ons from 2.79 to 2.80, part 4

glLineStipple and co are gone, must be replaced by shaders


This popped when working with the bgl module. There is a good shader based alternative however with an example in the docs.

Groups are now collections


which means references to bpy.data.group must be replaced by bpy.data.collection

Setting active object is different


You assign an object to bpy.context.view_layer.objects.active.
In many circumstances the view_layer is now the ultimate arbiter of what we see. This allows for organizing the visibility of objects in a scene but it also offers the link to the active object.

You must use ob.select_set(<bool>) instead of ob.select = <bool>


This is a breaking change change that could have been avoided: if it was necessary to move from a simple assignment to executing some code when the select status changes it would have been possible to use a property instead. Now it is just an annoying change in my opinion

The name of module may not contain a point either


See item on dash being not allowed in an earlier article

INFO_MT_mesh_add menu is now called VIEW3D_MT_mesh_add


Which makes sense because it is part of the VIEW3D area.

use_subsurf_uv no longer available on a subsurf modifier


Too bad, but I guess this wasn used very often anf the new quality settings of the modifier might well server the purpose even better.

no bl_category in Panels


So you cannot decide where your Panel will be located in the Toolbar.

That's what I thought earlier and it is true but only if your region type is TOOLS (visible with Ctrl-T) but you can still have a category if your region type is UI (visible with Ctrl-N)

No comments:

Post a comment