Fix #19473: Toggle Quad View options missing from UI.
This commit is contained in:
@@ -1740,15 +1740,21 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel):
|
|||||||
col.prop(gs, "material_mode", text="")
|
col.prop(gs, "material_mode", text="")
|
||||||
col.prop(view, "textured_solid")
|
col.prop(view, "textured_solid")
|
||||||
|
|
||||||
# XXX - the Quad View options don't work yet
|
layout.separator()
|
||||||
# layout.separator()
|
|
||||||
#
|
|
||||||
# layout.operator("screen.region_foursplit", text="Toggle Quad View")
|
|
||||||
# col = layout.column()
|
|
||||||
# col.prop(view, "lock_rotation")
|
|
||||||
# col.prop(view, "box_preview")
|
|
||||||
# col.prop(view, "box_clip")
|
|
||||||
|
|
||||||
|
region = view.region_quadview
|
||||||
|
|
||||||
|
layout.operator("screen.region_quadview", text="Toggle Quad View")
|
||||||
|
|
||||||
|
if region:
|
||||||
|
col = layout.column()
|
||||||
|
col.prop(region, "lock_rotation")
|
||||||
|
row = col.row()
|
||||||
|
row.enabled = region.lock_rotation
|
||||||
|
row.prop(region, "box_preview")
|
||||||
|
row = col.row()
|
||||||
|
row.enabled = region.lock_rotation and region.box_preview
|
||||||
|
row.prop(region, "box_clip")
|
||||||
|
|
||||||
class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
|
class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
|
||||||
bl_space_type = 'VIEW_3D'
|
bl_space_type = 'VIEW_3D'
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct AR
|
|||||||
void view3d_clipping_local(struct RegionView3D *rv3d, float mat[][4]);
|
void view3d_clipping_local(struct RegionView3D *rv3d, float mat[][4]);
|
||||||
|
|
||||||
Base *ED_view3d_give_base_under_cursor(struct bContext *C, short *mval);
|
Base *ED_view3d_give_base_under_cursor(struct bContext *C, short *mval);
|
||||||
|
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar);
|
||||||
|
|
||||||
#endif /* ED_VIEW3D_H */
|
#endif /* ED_VIEW3D_H */
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ static void view3d_boxview_clip(ScrArea *sa)
|
|||||||
if(rv3d->viewlock & RV3D_BOXCLIP) {
|
if(rv3d->viewlock & RV3D_BOXCLIP) {
|
||||||
rv3d->rflag |= RV3D_CLIPPING;
|
rv3d->rflag |= RV3D_CLIPPING;
|
||||||
memcpy(rv3d->clip, clip, sizeof(clip));
|
memcpy(rv3d->clip, clip, sizeof(clip));
|
||||||
|
if(rv3d->clipbb) MEM_freeN(rv3d->clipbb);
|
||||||
|
rv3d->clipbb= MEM_dupallocN(bb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,6 +229,34 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *ar)
|
|||||||
view3d_boxview_clip(sa);
|
view3d_boxview_clip(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ED_view3d_quadview_update(ScrArea *sa, ARegion *ar)
|
||||||
|
{
|
||||||
|
RegionView3D *rv3d= ar->regiondata;
|
||||||
|
short viewlock;
|
||||||
|
|
||||||
|
/* this function copies flags from the first of the 3 other quadview
|
||||||
|
regions to the 2 other, so it assumes this is the region whose
|
||||||
|
properties are always being edited, weak */
|
||||||
|
viewlock= rv3d->viewlock;
|
||||||
|
|
||||||
|
if((viewlock & RV3D_LOCKED)==0)
|
||||||
|
viewlock= 0;
|
||||||
|
else if((viewlock & RV3D_BOXVIEW)==0)
|
||||||
|
viewlock &= ~RV3D_BOXCLIP;
|
||||||
|
|
||||||
|
for(; ar; ar= ar->prev) {
|
||||||
|
if(ar->alignment==RGN_ALIGN_QSPLIT) {
|
||||||
|
rv3d= ar->regiondata;
|
||||||
|
rv3d->viewlock= viewlock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rv3d->viewlock & RV3D_BOXVIEW)
|
||||||
|
view3d_boxview_copy(sa, sa->regionbase.last);
|
||||||
|
|
||||||
|
ED_area_tag_redraw(sa);
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************** init for view ops **********************************/
|
/* ************************** init for view ops **********************************/
|
||||||
|
|
||||||
typedef struct ViewOpsData {
|
typedef struct ViewOpsData {
|
||||||
|
|||||||
@@ -158,6 +158,40 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ScrArea *rna_area_from_space(PointerRNA *ptr)
|
||||||
|
{
|
||||||
|
bScreen *sc = (bScreen*)ptr->id.data;
|
||||||
|
SpaceLink *link= (SpaceLink*)ptr->data;
|
||||||
|
ScrArea *sa;
|
||||||
|
|
||||||
|
for(sa=sc->areabase.first; sa; sa=sa->next)
|
||||||
|
if(BLI_findindex(&sa->spacedata, link) != -1)
|
||||||
|
return sa;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARegion **ar_r)
|
||||||
|
{
|
||||||
|
bScreen *sc = (bScreen*)ptr->id.data;
|
||||||
|
ScrArea *sa;
|
||||||
|
ARegion *ar;
|
||||||
|
void *regiondata= ptr->data;
|
||||||
|
|
||||||
|
*sa_r= NULL;
|
||||||
|
*ar_r= NULL;
|
||||||
|
|
||||||
|
for(sa=sc->areabase.first; sa; sa=sa->next) {
|
||||||
|
for(ar=sa->regionbase.first; ar; ar=ar->next) {
|
||||||
|
if(ar->regiondata == regiondata) {
|
||||||
|
*sa_r= sa;
|
||||||
|
*ar_r= ar;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
|
static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Scene *scene = ((bScreen*)ptr->id.data)->scene;
|
Scene *scene = ((bScreen*)ptr->id.data)->scene;
|
||||||
@@ -243,6 +277,38 @@ static void rna_Space3DView_layer_set(PointerRNA *ptr, const int *values)
|
|||||||
v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values);
|
v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
|
||||||
|
{
|
||||||
|
View3D *v3d= (View3D*)(ptr->data);
|
||||||
|
ScrArea *sa= rna_area_from_space(ptr);
|
||||||
|
ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
|
||||||
|
ARegion *ar= regionbase->last; /* always last in list, weak .. */
|
||||||
|
|
||||||
|
return rna_pointer_inherit_refine(ptr, &RNA_Region3DView, ar->regiondata);
|
||||||
|
}
|
||||||
|
|
||||||
|
static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
|
||||||
|
{
|
||||||
|
View3D *v3d= (View3D*)(ptr->data);
|
||||||
|
ScrArea *sa= rna_area_from_space(ptr);
|
||||||
|
ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
|
||||||
|
ARegion *ar= regionbase->last; /* always before last in list, weak .. */
|
||||||
|
|
||||||
|
ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
|
||||||
|
|
||||||
|
return rna_pointer_inherit_refine(ptr, &RNA_Region3DView, (ar)? ar->regiondata: NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rna_Region3DView_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
|
||||||
|
{
|
||||||
|
ScrArea *sa;
|
||||||
|
ARegion *ar;
|
||||||
|
|
||||||
|
rna_area_region_from_regiondata(ptr, &sa, &ar);
|
||||||
|
if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
|
||||||
|
ED_view3d_quadview_update(sa, ar);
|
||||||
|
}
|
||||||
|
|
||||||
/* Space Image Editor */
|
/* Space Image Editor */
|
||||||
|
|
||||||
static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
|
static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
|
||||||
@@ -914,21 +980,6 @@ static void rna_def_space_3dview(BlenderRNA *brna)
|
|||||||
RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL);
|
RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL);
|
||||||
RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation.");
|
RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation.");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
|
|
||||||
RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED);
|
|
||||||
RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation");
|
|
||||||
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
|
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE);
|
|
||||||
RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXVIEW);
|
|
||||||
RNA_def_property_ui_text(prop, "Box", "");
|
|
||||||
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
|
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE);
|
|
||||||
RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP);
|
|
||||||
RNA_def_property_ui_text(prop, "Clip", "");
|
|
||||||
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
|
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
|
prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
|
RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
|
||||||
RNA_def_property_boolean_funcs(prop, NULL, "rna_Space3DView_lock_camera_and_layers_set");
|
RNA_def_property_boolean_funcs(prop, NULL, "rna_Space3DView_lock_camera_and_layers_set");
|
||||||
@@ -948,6 +999,37 @@ static void rna_def_space_3dview(BlenderRNA *brna)
|
|||||||
RNA_def_property_array(prop, 20);
|
RNA_def_property_array(prop, 20);
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something.");
|
RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something.");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
|
||||||
|
RNA_def_property_struct_type(prop, "Region3DView");
|
||||||
|
RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL);
|
||||||
|
RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region.");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
|
||||||
|
RNA_def_property_struct_type(prop, "Region3DView");
|
||||||
|
RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL);
|
||||||
|
RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings.");
|
||||||
|
|
||||||
|
/* region */
|
||||||
|
|
||||||
|
srna= RNA_def_struct(brna, "Region3DView", "Region");
|
||||||
|
RNA_def_struct_sdna(srna, "RegionView3D");
|
||||||
|
RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_LOCKED);
|
||||||
|
RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views.");
|
||||||
|
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXVIEW);
|
||||||
|
RNA_def_property_ui_text(prop, "Box", "Sync view position between side views.");
|
||||||
|
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
|
||||||
|
RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views.");
|
||||||
|
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_def_space_buttons(BlenderRNA *brna)
|
static void rna_def_space_buttons(BlenderRNA *brna)
|
||||||
|
|||||||
Reference in New Issue
Block a user