Fix T47081: laplacian smooth edit mode tool crash.
This commit is contained in:
@@ -156,6 +156,14 @@ void EIG_linear_solver_variable_lock(LinearSolver *solver, int index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EIG_linear_solver_variable_unlock(LinearSolver *solver, int index)
|
||||||
|
{
|
||||||
|
if (solver->variable[index].locked) {
|
||||||
|
assert(solver->state == LinearSolver::STATE_VARIABLES_CONSTRUCT);
|
||||||
|
solver->variable[index].locked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void linear_solver_variables_to_vector(LinearSolver *solver)
|
static void linear_solver_variables_to_vector(LinearSolver *solver)
|
||||||
{
|
{
|
||||||
int num_rhs = solver->num_rhs;
|
int num_rhs = solver->num_rhs;
|
||||||
@@ -269,6 +277,10 @@ void EIG_linear_solver_right_hand_side_add(LinearSolver *solver, int rhs, int in
|
|||||||
|
|
||||||
bool EIG_linear_solver_solve(LinearSolver *solver)
|
bool EIG_linear_solver_solve(LinearSolver *solver)
|
||||||
{
|
{
|
||||||
|
/* nothing to solve, perhaps all variables were locked */
|
||||||
|
if (solver->m == 0 || solver->n == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
||||||
assert(solver->state != LinearSolver::STATE_VARIABLES_CONSTRUCT);
|
assert(solver->state != LinearSolver::STATE_VARIABLES_CONSTRUCT);
|
||||||
|
@@ -51,6 +51,7 @@ void EIG_linear_solver_delete(LinearSolver *solver);
|
|||||||
void EIG_linear_solver_variable_set(LinearSolver *solver, int rhs, int index, double value);
|
void EIG_linear_solver_variable_set(LinearSolver *solver, int rhs, int index, double value);
|
||||||
double EIG_linear_solver_variable_get(LinearSolver *solver, int rhs, int index);
|
double EIG_linear_solver_variable_get(LinearSolver *solver, int rhs, int index);
|
||||||
void EIG_linear_solver_variable_lock(LinearSolver *solver, int index);
|
void EIG_linear_solver_variable_lock(LinearSolver *solver, int index);
|
||||||
|
void EIG_linear_solver_variable_unlock(LinearSolver *solver, int index);
|
||||||
|
|
||||||
/* Matrix (A) and right hand side (b) */
|
/* Matrix (A) and right hand side (b) */
|
||||||
|
|
||||||
|
@@ -505,6 +505,7 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
|
|||||||
}
|
}
|
||||||
BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
|
BMO_ITER (v, &siter, op->slots_in, "verts", BM_VERT) {
|
||||||
m_vertex_id = BM_elem_index_get(v);
|
m_vertex_id = BM_elem_index_get(v);
|
||||||
|
EIG_linear_solver_variable_unlock(sys->context, m_vertex_id);
|
||||||
EIG_linear_solver_variable_set(sys->context, 0, m_vertex_id, v->co[0]);
|
EIG_linear_solver_variable_set(sys->context, 0, m_vertex_id, v->co[0]);
|
||||||
EIG_linear_solver_variable_set(sys->context, 1, m_vertex_id, v->co[1]);
|
EIG_linear_solver_variable_set(sys->context, 1, m_vertex_id, v->co[1]);
|
||||||
EIG_linear_solver_variable_set(sys->context, 2, m_vertex_id, v->co[2]);
|
EIG_linear_solver_variable_set(sys->context, 2, m_vertex_id, v->co[2]);
|
||||||
|
Reference in New Issue
Block a user