Cleanup: rename 'centre' to 'center' in View3D
This commit is contained in:
@@ -401,7 +401,7 @@ static void library_foreach_screen_area(LibraryForeachIDData *data, ScrArea *are
|
||||
View3D *v3d = (View3D *)sl;
|
||||
|
||||
FOREACH_CALLBACK_INVOKE(data, v3d->camera, IDWALK_CB_NOP);
|
||||
FOREACH_CALLBACK_INVOKE(data, v3d->ob_centre, IDWALK_CB_NOP);
|
||||
FOREACH_CALLBACK_INVOKE(data, v3d->ob_center, IDWALK_CB_NOP);
|
||||
|
||||
if (v3d->localvd) {
|
||||
FOREACH_CALLBACK_INVOKE(data, v3d->localvd->camera, IDWALK_CB_NOP);
|
||||
|
||||
@@ -7386,7 +7386,7 @@ static void lib_link_area(FileData *fd, ID *parent_id, ScrArea *area)
|
||||
View3D *v3d = (View3D *)sl;
|
||||
|
||||
v3d->camera = newlibadr(fd, parent_id->lib, v3d->camera);
|
||||
v3d->ob_centre = newlibadr(fd, parent_id->lib, v3d->ob_centre);
|
||||
v3d->ob_center = newlibadr(fd, parent_id->lib, v3d->ob_center);
|
||||
|
||||
if (v3d->localvd) {
|
||||
v3d->localvd->camera = newlibadr(fd, parent_id->lib, v3d->localvd->camera);
|
||||
@@ -7897,7 +7897,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
|
||||
ARegion *region;
|
||||
|
||||
v3d->camera = restore_pointer_by_name(id_map, (ID *)v3d->camera, USER_REAL);
|
||||
v3d->ob_centre = restore_pointer_by_name(id_map, (ID *)v3d->ob_centre, USER_REAL);
|
||||
v3d->ob_center = restore_pointer_by_name(id_map, (ID *)v3d->ob_center, USER_REAL);
|
||||
|
||||
/* Free render engines for now. */
|
||||
ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
|
||||
|
||||
@@ -359,9 +359,9 @@ void ED_armature_bone_rename(Main *bmain,
|
||||
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
||||
if (sl->spacetype == SPACE_VIEW3D) {
|
||||
View3D *v3d = (View3D *)sl;
|
||||
if (v3d->ob_centre && v3d->ob_centre->data == arm) {
|
||||
if (STREQ(v3d->ob_centre_bone, oldname)) {
|
||||
BLI_strncpy(v3d->ob_centre_bone, newname, MAXBONENAME);
|
||||
if (v3d->ob_center && v3d->ob_center->data == arm) {
|
||||
if (STREQ(v3d->ob_center_bone, oldname)) {
|
||||
BLI_strncpy(v3d->ob_center_bone, newname, MAXBONENAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ static void gp_rotate_v2_v2v2fl(float v[2],
|
||||
add_v2_v2v2(v, r, origin);
|
||||
}
|
||||
|
||||
/* Helper to rotate line around line centre */
|
||||
/* Helper to rotate line around line center. */
|
||||
static void gp_primitive_rotate_line(
|
||||
float va[2], float vb[2], const float a[2], const float b[2], const float angle)
|
||||
{
|
||||
|
||||
@@ -1523,12 +1523,12 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i
|
||||
|
||||
/* Values in local-view aren't used, see: T52663 */
|
||||
if (is_local == false) {
|
||||
if ((ID *)v3d->ob_centre == old_id) {
|
||||
v3d->ob_centre = (Object *)new_id;
|
||||
if ((ID *)v3d->ob_center == old_id) {
|
||||
v3d->ob_center = (Object *)new_id;
|
||||
/* Otherwise, bonename may remain valid...
|
||||
* We could be smart and check this, too? */
|
||||
if (new_id == NULL) {
|
||||
v3d->ob_centre_bone[0] = '\0';
|
||||
v3d->ob_center_bone[0] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3182,7 +3182,7 @@ static int view_lock_to_active_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
if (v3d) {
|
||||
ED_view3d_lock_clear(v3d);
|
||||
|
||||
v3d->ob_centre = obact; /* can be NULL */
|
||||
v3d->ob_center = obact; /* can be NULL */
|
||||
|
||||
if (obact && obact->type == OB_ARMATURE) {
|
||||
if (obact->mode & OB_MODE_POSE) {
|
||||
@@ -3190,13 +3190,13 @@ static int view_lock_to_active_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
Object *obact_eval = DEG_get_evaluated_object(depsgraph, obact);
|
||||
bPoseChannel *pcham_act = BKE_pose_channel_active(obact_eval);
|
||||
if (pcham_act) {
|
||||
BLI_strncpy(v3d->ob_centre_bone, pcham_act->name, sizeof(v3d->ob_centre_bone));
|
||||
BLI_strncpy(v3d->ob_center_bone, pcham_act->name, sizeof(v3d->ob_center_bone));
|
||||
}
|
||||
}
|
||||
else {
|
||||
EditBone *ebone_act = ((bArmature *)obact->data)->act_edbone;
|
||||
if (ebone_act) {
|
||||
BLI_strncpy(v3d->ob_centre_bone, ebone_act->name, sizeof(v3d->ob_centre_bone));
|
||||
BLI_strncpy(v3d->ob_center_bone, ebone_act->name, sizeof(v3d->ob_center_bone));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5140,7 +5140,7 @@ void ED_view3d_cursor3d_update(bContext *C,
|
||||
}
|
||||
|
||||
/* offset the cursor lock to avoid jumping to new offset */
|
||||
if (v3d->ob_centre_cursor) {
|
||||
if (v3d->ob_center_cursor) {
|
||||
if (U.uiflag & USER_LOCK_CURSOR_ADJUST) {
|
||||
|
||||
float co_2d_curr[2], co_2d_prev[2];
|
||||
|
||||
@@ -398,7 +398,7 @@ bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const BoundBox *bb)
|
||||
|
||||
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
|
||||
{
|
||||
return (rv3d->persp != RV3D_CAMOB) && (v3d->ob_centre_cursor || v3d->ob_centre);
|
||||
return (rv3d->persp != RV3D_CAMOB) && (v3d->ob_center_cursor || v3d->ob_center);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,9 +416,10 @@ void ED_view3d_lastview_store(RegionView3D *rv3d)
|
||||
|
||||
void ED_view3d_lock_clear(View3D *v3d)
|
||||
{
|
||||
v3d->ob_centre = NULL;
|
||||
v3d->ob_centre_bone[0] = '\0';
|
||||
v3d->ob_centre_cursor = false;
|
||||
v3d->ob_center = NULL;
|
||||
v3d->ob_center_bone[0] = '\0';
|
||||
v3d->ob_center_cursor = false;
|
||||
|
||||
v3d->flag2 &= ~V3D_LOCK_CAMERA;
|
||||
}
|
||||
|
||||
|
||||
@@ -834,13 +834,13 @@ void view3d_viewmatrix_set(Depsgraph *depsgraph,
|
||||
if (rv3d->persp == RV3D_PERSP) {
|
||||
rv3d->viewmat[3][2] -= rv3d->dist;
|
||||
}
|
||||
if (v3d->ob_centre) {
|
||||
Object *ob_eval = DEG_get_evaluated_object(depsgraph, v3d->ob_centre);
|
||||
if (v3d->ob_center) {
|
||||
Object *ob_eval = DEG_get_evaluated_object(depsgraph, v3d->ob_center);
|
||||
float vec[3];
|
||||
|
||||
copy_v3_v3(vec, ob_eval->obmat[3]);
|
||||
if (ob_eval->type == OB_ARMATURE && v3d->ob_centre_bone[0]) {
|
||||
bPoseChannel *pchan = BKE_pose_channel_find_name(ob_eval->pose, v3d->ob_centre_bone);
|
||||
if (ob_eval->type == OB_ARMATURE && v3d->ob_center_bone[0]) {
|
||||
bPoseChannel *pchan = BKE_pose_channel_find_name(ob_eval->pose, v3d->ob_center_bone);
|
||||
if (pchan) {
|
||||
copy_v3_v3(vec, pchan->pose_mat[3]);
|
||||
mul_m4_v3(ob_eval->obmat, vec);
|
||||
@@ -849,7 +849,7 @@ void view3d_viewmatrix_set(Depsgraph *depsgraph,
|
||||
translate_m4(rv3d->viewmat, -vec[0], -vec[1], -vec[2]);
|
||||
use_lock_ofs = true;
|
||||
}
|
||||
else if (v3d->ob_centre_cursor) {
|
||||
else if (v3d->ob_center_cursor) {
|
||||
float vec[3];
|
||||
copy_v3_v3(vec, scene->cursor.location);
|
||||
translate_m4(rv3d->viewmat, -vec[0], -vec[1], -vec[2]);
|
||||
|
||||
@@ -2760,7 +2760,7 @@ void createTransData(bContext *C, TransInfo *t)
|
||||
t->flag |= T_CAMERA;
|
||||
}
|
||||
}
|
||||
else if (v3d->ob_centre && v3d->ob_centre->id.tag & LIB_TAG_DOIT) {
|
||||
else if (v3d->ob_center && v3d->ob_center->id.tag & LIB_TAG_DOIT) {
|
||||
t->flag |= T_CAMERA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,14 +265,14 @@ typedef struct View3D {
|
||||
short persp DNA_DEPRECATED;
|
||||
short view DNA_DEPRECATED;
|
||||
|
||||
struct Object *camera, *ob_centre;
|
||||
struct Object *camera, *ob_center;
|
||||
rctf render_border;
|
||||
|
||||
/** Allocated backup of its self while in localview. */
|
||||
struct View3D *localvd;
|
||||
|
||||
/** Optional string for armature bone to define center, MAXBONENAME. */
|
||||
char ob_centre_bone[64];
|
||||
char ob_center_bone[64];
|
||||
|
||||
unsigned short local_view_uuid;
|
||||
char _pad6[2];
|
||||
@@ -281,7 +281,7 @@ typedef struct View3D {
|
||||
short _pad7[3];
|
||||
|
||||
/** Optional bool for 3d cursor to define center. */
|
||||
short ob_centre_cursor;
|
||||
short ob_center_cursor;
|
||||
short scenelock;
|
||||
short gp_flag;
|
||||
short flag;
|
||||
|
||||
@@ -88,6 +88,9 @@ DNA_STRUCT_RENAME_ELEM(ThemeSpace, scrubbing_background, time_scrub_background)
|
||||
DNA_STRUCT_RENAME_ELEM(ThemeSpace, show_back_grad, background_type)
|
||||
DNA_STRUCT_RENAME_ELEM(View3D, far, clip_end)
|
||||
DNA_STRUCT_RENAME_ELEM(View3D, near, clip_start)
|
||||
DNA_STRUCT_RENAME_ELEM(View3D, ob_centre, ob_center)
|
||||
DNA_STRUCT_RENAME_ELEM(View3D, ob_centre_bone, ob_center_bone)
|
||||
DNA_STRUCT_RENAME_ELEM(View3D, ob_centre_cursor, ob_center_cursor)
|
||||
DNA_STRUCT_RENAME_ELEM(bGPDstroke, gradient_f, hardeness)
|
||||
DNA_STRUCT_RENAME_ELEM(bGPDstroke, gradient_s, aspect_ratio)
|
||||
DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveInX, curve_in_x)
|
||||
|
||||
@@ -3958,19 +3958,19 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
||||
|
||||
prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "ob_centre");
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "ob_center");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Lock to Object", "3D View center is locked to this object's position");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "ob_centre_bone");
|
||||
RNA_def_property_string_sdna(prop, NULL, "ob_center_bone");
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Lock to Bone", "3D View center is locked to this bone's position");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "ob_center_cursor", 1);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
Reference in New Issue
Block a user