Merge branch 'master' into blender2.8
This commit is contained in:
commit
6962119e7f
|
@ -299,6 +299,7 @@ void RB_constraint_set_limits_piston(rbConstraint *con, float lin_lower, float l
|
|||
void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, float upper);
|
||||
|
||||
/* 6dof spring specific */
|
||||
void RB_constraint_set_limits_6dof_spring(rbConstraint *con, int axis, float lower, float upper);
|
||||
void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness);
|
||||
void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping);
|
||||
void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable);
|
||||
|
|
|
@ -954,7 +954,7 @@ rbConstraint *RB_constraint_new_6dof_spring(float pivot[3], float orn[4], rbRigi
|
|||
|
||||
make_constraint_transforms(transform1, transform2, body1, body2, pivot, orn);
|
||||
|
||||
btTypedConstraint *con = new btGeneric6DofSpringConstraint(*body1, *body2, transform1, transform2, true);
|
||||
btTypedConstraint *con = new btGeneric6DofSpring2Constraint(*body1, *body2, transform1, transform2);
|
||||
|
||||
return (rbConstraint *)con;
|
||||
}
|
||||
|
@ -1034,32 +1034,38 @@ void RB_constraint_set_limits_6dof(rbConstraint *con, int axis, float lower, flo
|
|||
constraint->setLimit(axis, lower, upper);
|
||||
}
|
||||
|
||||
void RB_constraint_set_limits_6dof_spring(rbConstraint *con, int axis, float lower, float upper)
|
||||
{
|
||||
btGeneric6DofSpring2Constraint *constraint = reinterpret_cast<btGeneric6DofSpring2Constraint*>(con);
|
||||
|
||||
constraint->setLimit(axis, lower, upper);
|
||||
}
|
||||
|
||||
void RB_constraint_set_stiffness_6dof_spring(rbConstraint *con, int axis, float stiffness)
|
||||
{
|
||||
btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
|
||||
|
||||
btGeneric6DofSpring2Constraint *constraint = reinterpret_cast<btGeneric6DofSpring2Constraint*>(con);
|
||||
|
||||
constraint->setStiffness(axis, stiffness);
|
||||
}
|
||||
|
||||
void RB_constraint_set_damping_6dof_spring(rbConstraint *con, int axis, float damping)
|
||||
{
|
||||
btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
|
||||
|
||||
// invert damping range so that 0 = no damping
|
||||
constraint->setDamping(axis, 1.0f - damping);
|
||||
btGeneric6DofSpring2Constraint *constraint = reinterpret_cast<btGeneric6DofSpring2Constraint*>(con);
|
||||
|
||||
constraint->setDamping(axis, damping);
|
||||
}
|
||||
|
||||
void RB_constraint_set_spring_6dof_spring(rbConstraint *con, int axis, int enable)
|
||||
{
|
||||
btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
|
||||
|
||||
btGeneric6DofSpring2Constraint *constraint = reinterpret_cast<btGeneric6DofSpring2Constraint*>(con);
|
||||
|
||||
constraint->enableSpring(axis, enable);
|
||||
}
|
||||
|
||||
void RB_constraint_set_equilibrium_6dof_spring(rbConstraint *con)
|
||||
{
|
||||
btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
|
||||
|
||||
btGeneric6DofSpring2Constraint *constraint = reinterpret_cast<btGeneric6DofSpring2Constraint*>(con);
|
||||
|
||||
constraint->setEquilibriumPoint();
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,6 @@ def find_next(ele_dst, ele_src):
|
|||
# ... So we have the highest chance of stepping onto the opposite element.
|
||||
diff_best = 0
|
||||
ele_best = None
|
||||
ele_best_tot = 0
|
||||
ele_best_ls = []
|
||||
for ele_test in candidates:
|
||||
depth_test_a = elems_depth_measure(ele_dst, ele_test, other_edges_over_edge)
|
||||
|
@ -227,12 +226,10 @@ def find_next(ele_dst, ele_src):
|
|||
if diff_test > diff_best:
|
||||
diff_best = diff_test
|
||||
ele_best = ele_test
|
||||
ele_best_tot = 1
|
||||
ele_best_ls[:] = [ele_best]
|
||||
elif diff_test == diff_best:
|
||||
if ele_best is None:
|
||||
ele_best = ele_test
|
||||
ele_best_tot += 1
|
||||
ele_best_ls.append(ele_test)
|
||||
|
||||
if len(ele_best_ls) > 1:
|
||||
|
|
|
@ -704,6 +704,39 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool
|
|||
|
||||
/* --------------------- */
|
||||
|
||||
static void rigidbody_constraint_set_limits(RigidBodyCon *rbc, void (*set_limits)(rbConstraint*,int,float,float))
|
||||
{
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X)
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper);
|
||||
else
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_X, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_Y)
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->limit_lin_y_lower, rbc->limit_lin_y_upper);
|
||||
else
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_Y, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_Z)
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->limit_lin_z_lower, rbc->limit_lin_z_upper);
|
||||
else
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_Z, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_X)
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->limit_ang_x_lower, rbc->limit_ang_x_upper);
|
||||
else
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_ANG_X, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Y)
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->limit_ang_y_lower, rbc->limit_ang_y_upper);
|
||||
else
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_ANG_Y, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Z)
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->limit_ang_z_lower, rbc->limit_ang_z_upper);
|
||||
else
|
||||
set_limits(rbc->physics_constraint, RB_LIMIT_ANG_Z, 0.0f, -1.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create physics sim representation of constraint given rigid body constraint settings
|
||||
*
|
||||
|
@ -822,40 +855,13 @@ static void rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, b
|
|||
RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_damping_ang_z);
|
||||
|
||||
RB_constraint_set_equilibrium_6dof_spring(rbc->physics_constraint);
|
||||
ATTR_FALLTHROUGH;
|
||||
|
||||
rigidbody_constraint_set_limits(rbc, RB_constraint_set_limits_6dof_spring);
|
||||
break;
|
||||
case RBC_TYPE_6DOF:
|
||||
if (rbc->type == RBC_TYPE_6DOF) /* a litte awkward but avoids duplicate code for limits */
|
||||
rbc->physics_constraint = RB_constraint_new_6dof(loc, rot, rb1, rb2);
|
||||
rbc->physics_constraint = RB_constraint_new_6dof(loc, rot, rb1, rb2);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X)
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper);
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_X, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_Y)
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Y, rbc->limit_lin_y_lower, rbc->limit_lin_y_upper);
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Y, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_Z)
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Z, rbc->limit_lin_z_lower, rbc->limit_lin_z_upper);
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_LIN_Z, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_X)
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_X, rbc->limit_ang_x_lower, rbc->limit_ang_x_upper);
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_X, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Y)
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Y, rbc->limit_ang_y_lower, rbc->limit_ang_y_upper);
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Y, 0.0f, -1.0f);
|
||||
|
||||
if (rbc->flag & RBC_FLAG_USE_LIMIT_ANG_Z)
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->limit_ang_z_lower, rbc->limit_ang_z_upper);
|
||||
else
|
||||
RB_constraint_set_limits_6dof(rbc->physics_constraint, RB_LIMIT_ANG_Z, 0.0f, -1.0f);
|
||||
rigidbody_constraint_set_limits(rbc, RB_constraint_set_limits_6dof);
|
||||
break;
|
||||
case RBC_TYPE_MOTOR:
|
||||
rbc->physics_constraint = RB_constraint_new_motor(loc, rot, rb1, rb2);
|
||||
|
|
|
@ -115,51 +115,6 @@ extern "C" {
|
|||
|
||||
namespace DEG {
|
||||
|
||||
namespace {
|
||||
|
||||
struct BuilderWalkUserData {
|
||||
DepsgraphRelationBuilder *builder;
|
||||
};
|
||||
|
||||
void modifier_walk(void *user_data,
|
||||
struct Object * /*object*/,
|
||||
struct ID **idpoin,
|
||||
int /*cb_flag*/)
|
||||
{
|
||||
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
||||
ID *id = *idpoin;
|
||||
if (id == NULL) {
|
||||
return;
|
||||
}
|
||||
switch (GS(id->name)) {
|
||||
case ID_OB:
|
||||
data->builder->build_object(NULL, (Object *)id);
|
||||
break;
|
||||
case ID_TE:
|
||||
data->builder->build_texture((Tex *)id);
|
||||
break;
|
||||
default:
|
||||
/* pass */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void constraint_walk(bConstraint * /*con*/,
|
||||
ID **idpoin,
|
||||
bool /*is_reference*/,
|
||||
void *user_data)
|
||||
{
|
||||
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
||||
if (*idpoin) {
|
||||
ID *id = *idpoin;
|
||||
if (GS(id->name) == ID_OB) {
|
||||
data->builder->build_object(NULL, (Object *)id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace */
|
||||
|
||||
/* ***************** */
|
||||
/* Relations Builder */
|
||||
|
||||
|
@ -2118,4 +2073,43 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
|
|||
}
|
||||
}
|
||||
|
||||
/* **** ID traversal callbacks functions **** */
|
||||
|
||||
void DepsgraphRelationBuilder::modifier_walk(void *user_data,
|
||||
struct Object * /*object*/,
|
||||
struct ID **idpoin,
|
||||
int /*cb_flag*/)
|
||||
{
|
||||
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
||||
ID *id = *idpoin;
|
||||
if (id == NULL) {
|
||||
return;
|
||||
}
|
||||
switch (GS(id->name)) {
|
||||
case ID_OB:
|
||||
data->builder->build_object(NULL, (Object *)id);
|
||||
break;
|
||||
case ID_TE:
|
||||
data->builder->build_texture((Tex *)id);
|
||||
break;
|
||||
default:
|
||||
/* pass */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::constraint_walk(bConstraint * /*con*/,
|
||||
ID **idpoin,
|
||||
bool /*is_reference*/,
|
||||
void *user_data)
|
||||
{
|
||||
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
||||
if (*idpoin) {
|
||||
ID *id = *idpoin;
|
||||
if (GS(id->name) == ID_OB) {
|
||||
data->builder->build_object(NULL, (Object *)id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace DEG
|
||||
|
|
|
@ -334,6 +334,20 @@ protected:
|
|||
const KeyTo& key_to);
|
||||
|
||||
private:
|
||||
struct BuilderWalkUserData {
|
||||
DepsgraphRelationBuilder *builder;
|
||||
};
|
||||
|
||||
static void modifier_walk(void *user_data,
|
||||
struct Object *object,
|
||||
struct ID **idpoin,
|
||||
int cb_flag);
|
||||
|
||||
static void constraint_walk(bConstraint *con,
|
||||
ID **idpoin,
|
||||
bool is_reference,
|
||||
void *user_data);
|
||||
|
||||
/* State which never changes, same for the whole builder time. */
|
||||
Main *bmain_;
|
||||
Depsgraph *graph_;
|
||||
|
|
|
@ -51,6 +51,7 @@ extern "C" {
|
|||
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_armature.h"
|
||||
#include "BKE_constraint.h"
|
||||
} /* extern "C" */
|
||||
|
||||
#include "DEG_depsgraph.h"
|
||||
|
@ -406,6 +407,11 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
|
|||
}
|
||||
/* Buil constraints. */
|
||||
if (pchan->constraints.first != NULL) {
|
||||
/* Build relations for indirectly linked objects. */
|
||||
BuilderWalkUserData data;
|
||||
data.builder = this;
|
||||
BKE_constraints_id_loop(&pchan->constraints, constraint_walk, &data);
|
||||
|
||||
/* constraints stack and constraint dependencies */
|
||||
build_constraints(&object->id, DEG_NODE_TYPE_BONE, pchan->name, &pchan->constraints, &root_map);
|
||||
|
||||
|
|
|
@ -590,12 +590,14 @@ void DEG_debug_print_eval(const char *function_name,
|
|||
if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
|
||||
return;
|
||||
}
|
||||
printf("%s on %s %s(%p)%s\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str());
|
||||
fprintf(stdout,
|
||||
"%s on %s %s(%p)%s\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void DEG_debug_print_eval_subdata(const char *function_name,
|
||||
|
@ -608,17 +610,19 @@ void DEG_debug_print_eval_subdata(const char *function_name,
|
|||
if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
|
||||
return;
|
||||
}
|
||||
printf("%s on %s %s(%p)%s %s %s %s(%p)%s\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str(),
|
||||
subdata_comment,
|
||||
subdata_name,
|
||||
DEG::deg_color_for_pointer(subdata_address).c_str(),
|
||||
subdata_address,
|
||||
DEG::deg_color_end().c_str());
|
||||
fprintf(stdout,
|
||||
"%s on %s %s(%p)%s %s %s %s(%p)%s\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str(),
|
||||
subdata_comment,
|
||||
subdata_name,
|
||||
DEG::deg_color_for_pointer(subdata_address).c_str(),
|
||||
subdata_address,
|
||||
DEG::deg_color_end().c_str());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void DEG_debug_print_eval_subdata_index(const char *function_name,
|
||||
|
@ -632,18 +636,20 @@ void DEG_debug_print_eval_subdata_index(const char *function_name,
|
|||
if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
|
||||
return;
|
||||
}
|
||||
printf("%s on %s %s(%p)^%s %s %s[%d] %s(%p)%s\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str(),
|
||||
subdata_comment,
|
||||
subdata_name,
|
||||
subdata_index,
|
||||
DEG::deg_color_for_pointer(subdata_address).c_str(),
|
||||
subdata_address,
|
||||
DEG::deg_color_end().c_str());
|
||||
fprintf(stdout,
|
||||
"%s on %s %s(%p)^%s %s %s[%d] %s(%p)%s\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str(),
|
||||
subdata_comment,
|
||||
subdata_name,
|
||||
subdata_index,
|
||||
DEG::deg_color_for_pointer(subdata_address).c_str(),
|
||||
subdata_address,
|
||||
DEG::deg_color_end().c_str());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void DEG_debug_print_eval_time(const char *function_name,
|
||||
|
@ -654,11 +660,13 @@ void DEG_debug_print_eval_time(const char *function_name,
|
|||
if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
|
||||
return;
|
||||
}
|
||||
printf("%s on %s %s(%p)%s at time %f\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str(),
|
||||
time);
|
||||
fprintf(stdout,
|
||||
"%s on %s %s(%p)%s at time %f\n",
|
||||
function_name,
|
||||
object_name,
|
||||
DEG::deg_color_for_pointer(object_address).c_str(),
|
||||
object_address,
|
||||
DEG::deg_color_end().c_str(),
|
||||
time);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
|
|
@ -302,19 +302,36 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
|
|||
|
||||
static void ui_block_region_draw(const bContext *C, ARegion *ar)
|
||||
{
|
||||
ScrArea *ctx_area = CTX_wm_area(C);
|
||||
ARegion *ctx_region = CTX_wm_region(C);
|
||||
uiBlock *block;
|
||||
|
||||
if (ar->do_draw & RGN_DRAW_REFRESH_UI) {
|
||||
ScrArea *handle_ctx_area;
|
||||
ARegion *handle_ctx_region;
|
||||
uiBlock *block_next;
|
||||
|
||||
ar->do_draw &= ~RGN_DRAW_REFRESH_UI;
|
||||
for (block = ar->uiblocks.first; block; block = block_next) {
|
||||
block_next = block->next;
|
||||
if (block->handle->can_refresh) {
|
||||
handle_ctx_area = block->handle->ctx_area;
|
||||
handle_ctx_region = block->handle->ctx_region;
|
||||
|
||||
if (handle_ctx_area) {
|
||||
CTX_wm_area_set((bContext *)C, handle_ctx_area);
|
||||
}
|
||||
if (handle_ctx_region) {
|
||||
CTX_wm_region_set((bContext *)C, handle_ctx_region);
|
||||
}
|
||||
ui_popup_block_refresh((bContext *)C, block->handle, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CTX_wm_area_set((bContext *)C, ctx_area);
|
||||
CTX_wm_region_set((bContext *)C, ctx_region);
|
||||
|
||||
for (block = ar->uiblocks.first; block; block = block->next)
|
||||
UI_block_draw(C, block);
|
||||
}
|
||||
|
|
|
@ -2015,15 +2015,29 @@ void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int c
|
|||
/* before setting the view */
|
||||
if (vertical) {
|
||||
/* we always keep the scroll offset - so the total view gets increased with the scrolled away part */
|
||||
if (v2d->cur.ymax < - 0.001f)
|
||||
y = min_ii(y, v2d->cur.ymin);
|
||||
|
||||
if (v2d->cur.ymax < -FLT_EPSILON) {
|
||||
/* Clamp to lower view boundary */
|
||||
if (v2d->tot.ymin < -v2d->winy) {
|
||||
y = min_ii(y, 0);
|
||||
}
|
||||
else {
|
||||
y = min_ii(y, v2d->cur.ymin);
|
||||
}
|
||||
}
|
||||
|
||||
y = -y;
|
||||
}
|
||||
else {
|
||||
/* don't jump back when panels close or hide */
|
||||
if (!is_context_new)
|
||||
x = max_ii(x, v2d->cur.xmax);
|
||||
if (!is_context_new) {
|
||||
if (v2d->tot.xmax > v2d->winx) {
|
||||
x = max_ii(x, 0);
|
||||
}
|
||||
else {
|
||||
x = max_ii(x, v2d->cur.xmax);
|
||||
}
|
||||
}
|
||||
|
||||
y = -y;
|
||||
}
|
||||
|
||||
|
|
|
@ -703,7 +703,7 @@ static void graph_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID
|
|||
if (sgraph->ads && (ID *)sgraph->ads->filter_grp == old_id) {
|
||||
sgraph->ads->filter_grp = (Group *)new_id;
|
||||
}
|
||||
if ((ID *)sgraph->ads->source == old_id) {
|
||||
if (sgraph->ads && (ID *)sgraph->ads->source == old_id) {
|
||||
sgraph->ads->source = new_id;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1864,7 +1864,7 @@ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char *
|
|||
else {
|
||||
flag = prop->flag;
|
||||
if ((flag & PROP_EDITABLE) == 0 || (flag & PROP_REGISTER)) {
|
||||
*r_info = "This property is for internal use only and can't be edited.";
|
||||
*r_info = N_("This property is for internal use only and can't be edited");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1872,13 +1872,13 @@ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char *
|
|||
if (id) {
|
||||
if (ID_IS_LINKED(id) && (prop->flag & PROP_LIB_EXCEPTION) == 0) {
|
||||
if (!(*r_info)[0]) {
|
||||
*r_info = "Can't edit this property from a linked data-block.";
|
||||
*r_info = N_("Can't edit this property from a linked data-block.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (id->override_static != NULL && !RNA_property_overridable(ptr, prop)) {
|
||||
if (!(*r_info)[0]) {
|
||||
*r_info = "Can't edit this property from an override data-block.";
|
||||
*r_info = N_("Can't edit this property from an override data-block.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1292,49 +1292,49 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(prop, "Z Angle Stiffness", "Stiffness on the Z rotational axis");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
|
||||
|
||||
prop = RNA_def_property(srna, "spring_damping_x", PROP_FLOAT, PROP_FACTOR);
|
||||
prop = RNA_def_property(srna, "spring_damping_x", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "spring_damping_x");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||
RNA_def_property_float_default(prop, 0.5f);
|
||||
RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_x_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Damping X", "Damping on the X axis");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
|
||||
|
||||
prop = RNA_def_property(srna, "spring_damping_y", PROP_FLOAT, PROP_FACTOR);
|
||||
prop = RNA_def_property(srna, "spring_damping_y", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "spring_damping_y");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||
RNA_def_property_float_default(prop, 0.5f);
|
||||
RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_y_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Damping Y", "Damping on the Y axis");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
|
||||
|
||||
prop = RNA_def_property(srna, "spring_damping_z", PROP_FLOAT, PROP_FACTOR);
|
||||
prop = RNA_def_property(srna, "spring_damping_z", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "spring_damping_z");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||
RNA_def_property_float_default(prop, 0.5f);
|
||||
RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_z_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Damping Z", "Damping on the Z axis");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
|
||||
|
||||
prop = RNA_def_property(srna, "spring_damping_ang_x", PROP_FLOAT, PROP_FACTOR);
|
||||
prop = RNA_def_property(srna, "spring_damping_ang_x", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "spring_damping_ang_x");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||
RNA_def_property_float_default(prop, 0.5f);
|
||||
RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_ang_x_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Damping X Angle", "Damping on the X rotational axis");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
|
||||
|
||||
prop = RNA_def_property(srna, "spring_damping_ang_y", PROP_FLOAT, PROP_FACTOR);
|
||||
prop = RNA_def_property(srna, "spring_damping_ang_y", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "spring_damping_ang_y");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||
RNA_def_property_float_default(prop, 0.5f);
|
||||
RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_ang_y_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Damping Y Angle", "Damping on the Y rotational axis");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
|
||||
|
||||
prop = RNA_def_property(srna, "spring_damping_ang_z", PROP_FLOAT, PROP_FACTOR);
|
||||
prop = RNA_def_property(srna, "spring_damping_ang_z", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "spring_damping_ang_z");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
||||
RNA_def_property_float_default(prop, 0.5f);
|
||||
RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_spring_damping_ang_z_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Damping Z Angle", "Damping on the Z rotational axis");
|
||||
|
|
Loading…
Reference in New Issue