Fix #106641: missing Annotation widgets #112688
|
@ -417,7 +417,13 @@ class AnnotationDataPanel:
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
if context.space_data.type not in {'VIEW_3D', 'TOPBAR', 'SEQUENCE_EDITOR'}:
|
if context.space_data.type not in {
|
||||||
|
|||||||
|
'VIEW_3D',
|
||||||
|
'TOPBAR',
|
||||||
|
'SEQUENCE_EDITOR',
|
||||||
|
'IMAGE_EDITOR',
|
||||||
|
'NODE_EDITOR',
|
||||||
|
'PROPERTIES'}:
|
||||||
self.layout.prop(context.space_data, "show_annotation", text="")
|
self.layout.prop(context.space_data, "show_annotation", text="")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
|
|
|
@ -171,8 +171,8 @@ class _defs_annotate:
|
||||||
|
|
||||||
gpl = context.active_annotation_layer
|
gpl = context.active_annotation_layer
|
||||||
if gpl is not None:
|
if gpl is not None:
|
||||||
layout.label(text="Annotation:")
|
if context.space_data.type in {'VIEW_3D', 'SEQUENCE_EDITOR', 'IMAGE_EDITOR', 'NODE_EDITOR'}:
|
||||||
if context.space_data.type in {'VIEW_3D', 'SEQUENCE_EDITOR'}:
|
layout.label(text="Annotation:")
|
||||||
if region_type == 'TOOL_HEADER':
|
if region_type == 'TOOL_HEADER':
|
||||||
sub = layout.split(align=True, factor=0.5)
|
sub = layout.split(align=True, factor=0.5)
|
||||||
sub.ui_units_x = 6.5
|
sub.ui_units_x = 6.5
|
||||||
|
@ -184,7 +184,15 @@ class _defs_annotate:
|
||||||
panel="TOPBAR_PT_annotation_layers",
|
panel="TOPBAR_PT_annotation_layers",
|
||||||
text=text,
|
text=text,
|
||||||
)
|
)
|
||||||
|
elif context.space_data.type == 'PROPERTIES':
|
||||||
|
row = layout.row(align=True)
|
||||||
|
row.prop(gpl, "color", text="Annotation")
|
||||||
|
row.popover(
|
||||||
|
panel="TOPBAR_PT_annotation_layers",
|
||||||
MilanDavidovic marked this conversation as resolved
Outdated
Pratik Borhade
commented
why not to use why not to use `TOPBAR_PT_annotation_layers` here?
Milan Davidović
commented
If I remember correctly, Should I change it to If I remember correctly, `TOPBAR_PT_annotation_layers` didn't work for Tools tab in Properties when I was first fixing this. That's why I added `PROPERTIES_PT_annotation_layers`, the only difference being `bl_region_type = 'WINDOW`' instead of `'HEADER'`. But now it works with `TOPBAR_PT_annotation_layers `when applied to blender-v4.0-release.
Should I change it to `TOPBAR_PT_annotation_layers`? The name doesn't really reflect the usage context though.
Pratik Borhade
commented
Yes, I would prefer to use Yes, I would prefer to use `TOPBAR_PT_annotation_layers` :)
Milan Davidović
commented
Sure, I'll make the change. :) Sure, I'll make the change. :)
|
|||||||
|
text=text,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
|
layout.label(text="Annotation:")
|
||||||
layout.prop(gpl, "color", text="")
|
layout.prop(gpl, "color", text="")
|
||||||
|
|
||||||
space_type = tool.space_type
|
space_type = tool.space_type
|
||||||
|
|
|
@ -123,14 +123,14 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
|
||||||
SpaceLink *sl = static_cast<SpaceLink *>(area->spacedata.first);
|
SpaceLink *sl = static_cast<SpaceLink *>(area->spacedata.first);
|
||||||
|
|
||||||
switch (area->spacetype) {
|
switch (area->spacetype) {
|
||||||
case SPACE_PROPERTIES: /* properties */
|
case SPACE_INFO: /* header info */
|
||||||
case SPACE_INFO: /* header info */
|
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SPACE_TOPBAR: /* Top-bar */
|
case SPACE_TOPBAR: /* Top-bar */
|
||||||
case SPACE_VIEW3D: /* 3D-View */
|
case SPACE_VIEW3D: /* 3D-View */
|
||||||
|
case SPACE_PROPERTIES: /* properties */
|
||||||
{
|
{
|
||||||
if (r_ptr) {
|
if (r_ptr) {
|
||||||
*r_ptr = RNA_id_pointer_create(&scene->id);
|
*r_ptr = RNA_id_pointer_create(&scene->id);
|
||||||
|
|
|
@ -812,12 +812,13 @@ static void buttons_area_listener(const wmSpaceTypeListenerParams *params)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NC_GPENCIL:
|
case NC_GPENCIL:
|
||||||
switch (wmn->data) {
|
if (wmn->data == ND_DATA) {
|
||||||
case ND_DATA:
|
if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED, NA_SELECTED, NA_RENAME)) {
|
||||||
if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED, NA_SELECTED, NA_RENAME)) {
|
ED_area_tag_redraw(area);
|
||||||
ED_area_tag_redraw(area);
|
}
|
||||||
}
|
}
|
||||||
break;
|
else if (wmn->action == NA_EDITED) {
|
||||||
|
ED_area_tag_redraw(area);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NC_NODE:
|
case NC_NODE:
|
||||||
|
|
|
@ -1004,6 +1004,14 @@ static void image_header_region_listener(const wmRegionListenerParams *params)
|
||||||
ED_region_tag_redraw(region);
|
ED_region_tag_redraw(region);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NC_GPENCIL:
|
||||||
|
if (wmn->data & ND_GPENCIL_EDITMODE) {
|
||||||
|
ED_region_tag_redraw(region);
|
||||||
|
}
|
||||||
|
else if (wmn->action == NA_EDITED) {
|
||||||
|
ED_region_tag_redraw(region);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Thanks, one more formatting change is detected https://builder.blender.org/admin/#/builders/210/builds/1270 :
Thanks,
make format
didn't fix that one, I'll fix it now.This formatting change looks odd to me as well. But let's make the change for now :)