3dview --> view3d, patch by Jonathan Smith with small corrections and changes.

This commit is contained in:
Campbell Barton 2010-04-28 07:25:39 +00:00
parent 68e68af102
commit 2d4d820b97
15 changed files with 56 additions and 55 deletions

@ -1832,7 +1832,7 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
# ********** Panel **********
class VIEW3D_PT_3dview_properties(bpy.types.Panel):
class VIEW3D_PT_view3d_properties(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "View"
@ -1867,7 +1867,7 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel):
layout.column().prop(view, "cursor_location")
class VIEW3D_PT_3dview_name(bpy.types.Panel):
class VIEW3D_PT_view3d_name(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Item"
@ -1891,7 +1891,7 @@ class VIEW3D_PT_3dview_name(bpy.types.Panel):
row.prop(bone, "name", text="")
class VIEW3D_PT_3dview_display(bpy.types.Panel):
class VIEW3D_PT_view3d_display(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Display"
@ -1959,7 +1959,7 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel):
row.prop(region, "box_clip")
class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
class VIEW3D_PT_view3d_meshdisplay(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Mesh Display"
@ -1995,7 +1995,7 @@ class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
col.prop(mesh, "draw_face_area")
class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel):
class VIEW3D_PT_view3d_curvedisplay(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Curve Display"
@ -2263,11 +2263,11 @@ classes = [
VIEW3D_MT_armature_specials, # Only as a menu for keybindings
# Panels
VIEW3D_PT_3dview_properties,
VIEW3D_PT_3dview_display,
VIEW3D_PT_3dview_name,
VIEW3D_PT_3dview_meshdisplay,
VIEW3D_PT_3dview_curvedisplay,
VIEW3D_PT_view3d_properties,
VIEW3D_PT_view3d_display,
VIEW3D_PT_view3d_name,
VIEW3D_PT_view3d_meshdisplay,
VIEW3D_PT_view3d_curvedisplay,
VIEW3D_PT_background_image,
VIEW3D_PT_transform_orientations,
VIEW3D_PT_etch_a_ton,

@ -717,7 +717,7 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
smd->domain->strength = 2.0;
smd->domain->noise = MOD_SMOKE_NOISEWAVE;
smd->domain->diss_speed = 5;
// init 3dview buffer
// init view3d buffer
smd->domain->viewsettings = 0;
smd->domain->effector_weights = BKE_add_effector_weights(NULL);
}

@ -2334,8 +2334,8 @@ static void dummy_olddraw_gpencil ()
case SPACE_VIEW3D:
{
/* this shouldn't cause any overflow... */
//sprintf(name, "3DView:%s", view3d_get_name(sa->spacedata.first)); // XXX missing func..
strcpy(name, "3dView");
//sprintf(name, "View3D:%s", view3d_get_name(sa->spacedata.first)); // XXX missing func..
strcpy(name, "View3D");
special= ICON_VIEW3D;
}
break;

@ -709,7 +709,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf)
/* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly
* Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes
*/
void draw_gpencil_2dview (bContext *C, short onlyv2d)
void draw_gpencil_view2d (bContext *C, short onlyv2d)
{
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
@ -735,7 +735,7 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d)
/* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly
* Note: this gets called twice - first time with only3d=1 to draw 3d-strokes, second time with only3d=0 for screen-aligned strokes
*/
void draw_gpencil_3dview_ext (Scene *scene, ARegion *ar, short only3d)
void draw_gpencil_view3d_ext (Scene *scene, ARegion *ar, short only3d)
{
bGPdata *gpd;
int dflag = 0;
@ -749,11 +749,11 @@ void draw_gpencil_3dview_ext (Scene *scene, ARegion *ar, short only3d)
gp_draw_data(gpd, 0, 0, ar->winx, ar->winy, CFRA, dflag);
}
void draw_gpencil_3dview (bContext *C, short only3d)
void draw_gpencil_view3d (bContext *C, short only3d)
{
ARegion *ar= CTX_wm_region(C);
Scene *scene= CTX_data_scene(C);
draw_gpencil_3dview_ext(scene, ar, only3d);
draw_gpencil_view3d_ext(scene, ar, only3d);
}
/* ************************************************** */

@ -70,9 +70,9 @@ void ED_operatortypes_gpencil(void);
/* drawgpencil.c */
void draw_gpencil_2dimage(struct bContext *C, struct ImBuf *ibuf);
void draw_gpencil_2dview(struct bContext *C, short onlyv2d);
void draw_gpencil_3dview(struct bContext *C, short only3d);
void draw_gpencil_3dview_ext(struct Scene *scene, struct ARegion *ar, short only3d);
void draw_gpencil_view2d(struct bContext *C, short onlyv2d);
void draw_gpencil_view3d(struct bContext *C, short only3d);
void draw_gpencil_view3d_ext(struct Scene *scene, struct ARegion *ar, short only3d);
void gpencil_panel_standard(const struct bContext *C, struct Panel *pa);

@ -35,7 +35,7 @@ struct wmKeyConfig;
/* particle_edit.c */
int PE_poll(struct bContext *C);
int PE_hair_poll(struct bContext *C);
int PE_poll_3dview(struct bContext *C);
int PE_poll_view3d(struct bContext *C);
/* operators */
void ED_operatortypes_physics(void);

@ -124,7 +124,7 @@ int PE_hair_poll(bContext *C)
return (edit && edit->psys);
}
int PE_poll_3dview(bContext *C)
int PE_poll_view3d(bContext *C)
{
return PE_poll(C) && CTX_wm_area(C)->spacetype == SPACE_VIEW3D &&
CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW;
@ -1494,7 +1494,7 @@ void PARTICLE_OT_select_linked(wmOperatorType *ot)
/* api callbacks */
ot->exec= select_linked_exec;
ot->invoke= select_linked_invoke;
ot->poll= PE_poll_3dview;
ot->poll= PE_poll_view3d;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@ -2449,7 +2449,7 @@ static void toggle_particle_cursor(bContext *C, int enable)
pset->paintcursor = NULL;
}
else if(enable)
pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll_3dview, brush_drawcursor, NULL);
pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll_view3d, brush_drawcursor, NULL);
}
/********************* radial control operator *********************/
@ -3609,7 +3609,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot)
ot->invoke= brush_edit_invoke;
ot->modal= brush_edit_modal;
ot->cancel= brush_edit_cancel;
ot->poll= PE_poll_3dview;
ot->poll= PE_poll_view3d;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;

@ -496,7 +496,7 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d)
/* draw grease-pencil ('screen' strokes) */
//if (sima->flag & SI_DISPGP)
draw_gpencil_2dview(C, 0);
draw_gpencil_view2d(C, 0);
}
}

@ -1130,14 +1130,14 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
/* draw grease-pencil ('canvas' strokes) */
if (/*(snode->flag & SNODE_DISPGP) &&*/ (snode->nodetree))
draw_gpencil_2dview((bContext*)C, 1);
draw_gpencil_view2d((bContext*)C, 1);
/* reset view matrix */
UI_view2d_view_restore(C);
/* draw grease-pencil (screen strokes, and also paintbuffer) */
if (/*(snode->flag & SNODE_DISPGP) && */(snode->nodetree))
draw_gpencil_2dview((bContext*)C, 0);
draw_gpencil_view2d((bContext*)C, 0);
/* scrollers */
scrollers= UI_view2d_scrollers_calc(C, v2d, 10, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);

@ -822,7 +822,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
/* draw grease-pencil (screen aligned) */
// if (sseq->flag & SEQ_DRAW_GPENCIL)
// XXX draw_gpencil_2dview(sa, 0);
// XXX draw_gpencil_view2d(sa, 0);
/* ortho at pixel level */
UI_view2d_view_restore(C);

@ -212,7 +212,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
{{-1.0f, 1.0f, -1.0f}, {2.0f, 0.0f, 0.0f}}
};
/* Fragment program to calculate the 3dview of smoke */
/* Fragment program to calculate the view3d of smoke */
/* using 2 textures, density and shadow */
const char *text = "!!ARBfp1.0\n"
"PARAM dx = program.local[0];\n"

@ -77,6 +77,7 @@
#include "ED_space_api.h"
#include "ED_screen_types.h"
#include "ED_transform.h"
#include "ED_gpencil.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
@ -1656,7 +1657,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d)
v3d->zbuf= TRUE;
glEnable(GL_DEPTH_TEST);
draw_gpencil_3dview_ext(scene, ar, 1);
draw_gpencil_view3d_ext(scene, ar, 1);
v3d->zbuf= zbuf;
@ -2022,12 +2023,12 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx,
}
/* draw grease-pencil stuff */
draw_gpencil_3dview_ext(scene, ar, 1);
draw_gpencil_view3d_ext(scene, ar, 1);
ED_region_pixelspace(ar);
/* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */
draw_gpencil_3dview_ext(scene, ar, 0);
draw_gpencil_view3d_ext(scene, ar, 0);
GPU_free_images();
@ -2343,7 +2344,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
/* draw grease-pencil stuff (3d-space strokes) */
//if (v3d->flag2 & V3D_DISPGP)
draw_gpencil_3dview((bContext *)C, 1);
draw_gpencil_view3d((bContext *)C, 1);
BDR_drawSketch(C);
}
@ -2362,7 +2363,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
/* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */
// if (v3d->flag2 & V3D_DISPGP)
draw_gpencil_3dview((bContext *)C, 0);
draw_gpencil_view3d((bContext *)C, 0);
drawcursor(scene, ar, v3d);
}

@ -439,7 +439,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiBlock *block;
uiLayout *row;
RNA_pointer_create(&screen->id, &RNA_Space3DView, v3d, &v3dptr);
RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr);
RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr);
RNA_pointer_create(&scene->id, &RNA_Scene, scene, &sceneptr);

@ -437,7 +437,7 @@ extern StructRNA RNA_SolidifyModifier;
extern StructRNA RNA_Sound;
extern StructRNA RNA_SoundSequence;
extern StructRNA RNA_Space;
extern StructRNA RNA_Space3DView;
extern StructRNA RNA_SpaceView3D;
extern StructRNA RNA_SpaceConsole;
extern StructRNA RNA_SpaceDopeSheetEditor;
extern StructRNA RNA_SpaceFileBrowser;

@ -125,7 +125,7 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
switch(space->spacetype) {
case SPACE_VIEW3D:
return &RNA_Space3DView;
return &RNA_SpaceView3D;
case SPACE_IPO:
return &RNA_SpaceGraphEditor;
case SPACE_OUTLINER:
@ -227,7 +227,7 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, i
RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
if (ptr->type == &RNA_Space3DView)
if (ptr->type == &RNA_SpaceView3D)
scene = ((bScreen*)ptr->id.data)->scene;
else
scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
@ -256,7 +256,7 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, i
}
/* Space 3D View */
static void rna_Space3DView_lock_camera_and_layers_set(PointerRNA *ptr, int value)
static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
{
View3D *v3d= (View3D*)(ptr->data);
bScreen *sc= (bScreen*)ptr->id.data;
@ -299,7 +299,7 @@ static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
copy_v3_v3(cursor, values);
}
static void rna_Space3DView_layer_set(PointerRNA *ptr, const int *values)
static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
{
View3D *v3d= (View3D*)(ptr->data);
@ -313,7 +313,7 @@ static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *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);
return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, ar->regiondata);
}
static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
@ -325,10 +325,10 @@ static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
return rna_pointer_inherit_refine(ptr, &RNA_Region3DView, (ar)? ar->regiondata: NULL);
return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, (ar)? ar->regiondata: NULL);
}
static void rna_Region3DView_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
static void rna_RegionView3D_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
{
ScrArea *sa;
ARegion *ar;
@ -879,7 +879,7 @@ static void rna_def_background_image(BlenderRNA *brna)
}
static void rna_def_space_3dview(BlenderRNA *brna)
static void rna_def_space_view3d(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@ -893,7 +893,7 @@ static void rna_def_space_3dview(BlenderRNA *brna)
{V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Space3DView", "Space");
srna= RNA_def_struct(brna, "SpaceView3D", "Space");
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
@ -1079,7 +1079,7 @@ static void rna_def_space_3dview(BlenderRNA *brna)
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_funcs(prop, NULL, "rna_Space3DView_lock_camera_and_layers_set");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene's active camera and layers in this view, rather than local layers");
RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@ -1087,7 +1087,7 @@ static void rna_def_space_3dview(BlenderRNA *brna)
prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Space3DView_layer_set");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_layer_set");
RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@ -1098,35 +1098,35 @@ static void rna_def_space_3dview(BlenderRNA *brna)
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_struct_type(prop, "RegionView3D");
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_struct_type(prop, "RegionView3D");
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");
srna= RNA_def_struct(brna, "RegionView3D", "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");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_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");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_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");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "persmat");
@ -2114,7 +2114,7 @@ void RNA_def_space(BlenderRNA *brna)
rna_def_space_filebrowser(brna);
rna_def_space_outliner(brna);
rna_def_background_image(brna);
rna_def_space_3dview(brna);
rna_def_space_view3d(brna);
rna_def_space_buttons(brna);
rna_def_space_dopesheet(brna);
rna_def_space_graph(brna);