Cleanup: Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule. This should be the final commit of the series of commits that addresses this particular rule. No functional changes.
This commit is contained in:
parent
3d48d99647
commit
c04088fed1
|
@ -12,7 +12,6 @@ Checks: >
|
||||||
|
|
||||||
-readability-misleading-indentation,
|
-readability-misleading-indentation,
|
||||||
|
|
||||||
-readability-else-after-return,
|
|
||||||
-readability-inconsistent-declaration-parameter-name,
|
-readability-inconsistent-declaration-parameter-name,
|
||||||
-readability-redundant-preprocessor,
|
-readability-redundant-preprocessor,
|
||||||
-readability-function-size,
|
-readability-function-size,
|
||||||
|
|
|
@ -249,9 +249,8 @@ size_t MEM_guarded_allocN_len(const void *vmemh)
|
||||||
memh--;
|
memh--;
|
||||||
return memh->len;
|
return memh->len;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *MEM_guarded_dupallocN(const void *vmemh)
|
void *MEM_guarded_dupallocN(const void *vmemh)
|
||||||
|
@ -611,12 +610,11 @@ static int compare_len(const void *p1, const void *p2)
|
||||||
if (pb1->len < pb2->len) {
|
if (pb1->len < pb2->len) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (pb1->len == pb2->len) {
|
if (pb1->len == pb2->len) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MEM_guarded_printmemlist_stats(void)
|
void MEM_guarded_printmemlist_stats(void)
|
||||||
|
@ -682,7 +680,7 @@ void MEM_guarded_printmemlist_stats(void)
|
||||||
if (a == b) {
|
if (a == b) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (strcmp(printblock[a].name, printblock[b].name) == 0) {
|
if (strcmp(printblock[a].name, printblock[b].name) == 0) {
|
||||||
printblock[b].len += printblock[a].len;
|
printblock[b].len += printblock[a].len;
|
||||||
printblock[b].items++;
|
printblock[b].items++;
|
||||||
}
|
}
|
||||||
|
@ -1213,8 +1211,7 @@ const char *MEM_guarded_name_ptr(void *vmemh)
|
||||||
memh--;
|
memh--;
|
||||||
return memh->name;
|
return memh->name;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return "MEM_guarded_name_ptr(NULL)";
|
return "MEM_guarded_name_ptr(NULL)";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
|
|
|
@ -94,9 +94,8 @@ size_t MEM_lockfree_allocN_len(const void *vmemh)
|
||||||
if (vmemh) {
|
if (vmemh) {
|
||||||
return MEMHEAD_FROM_PTR(vmemh)->len & ~((size_t)(MEMHEAD_ALIGN_FLAG));
|
return MEMHEAD_FROM_PTR(vmemh)->len & ~((size_t)(MEMHEAD_ALIGN_FLAG));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MEM_lockfree_freeN(void *vmemh)
|
void MEM_lockfree_freeN(void *vmemh)
|
||||||
|
@ -436,8 +435,7 @@ const char *MEM_lockfree_name_ptr(void *vmemh)
|
||||||
if (vmemh) {
|
if (vmemh) {
|
||||||
return "unknown block name ptr";
|
return "unknown block name ptr";
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return "MEM_lockfree_name_ptr(NULL)";
|
return "MEM_lockfree_name_ptr(NULL)";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
|
|
|
@ -120,9 +120,9 @@ const char *BLT_translate_do(const char *msgctxt, const char *msgid)
|
||||||
if (BLT_translate()) {
|
if (BLT_translate()) {
|
||||||
return BLT_pgettext(msgctxt, msgid);
|
return BLT_pgettext(msgctxt, msgid);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return msgid;
|
return msgid;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
(void)msgctxt;
|
(void)msgctxt;
|
||||||
return msgid;
|
return msgid;
|
||||||
|
@ -135,9 +135,9 @@ const char *BLT_translate_do_iface(const char *msgctxt, const char *msgid)
|
||||||
if (BLT_translate_iface()) {
|
if (BLT_translate_iface()) {
|
||||||
return BLT_pgettext(msgctxt, msgid);
|
return BLT_pgettext(msgctxt, msgid);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return msgid;
|
return msgid;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
(void)msgctxt;
|
(void)msgctxt;
|
||||||
return msgid;
|
return msgid;
|
||||||
|
@ -150,9 +150,9 @@ const char *BLT_translate_do_tooltip(const char *msgctxt, const char *msgid)
|
||||||
if (BLT_translate_tooltips()) {
|
if (BLT_translate_tooltips()) {
|
||||||
return BLT_pgettext(msgctxt, msgid);
|
return BLT_pgettext(msgctxt, msgid);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return msgid;
|
return msgid;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
(void)msgctxt;
|
(void)msgctxt;
|
||||||
return msgid;
|
return msgid;
|
||||||
|
@ -165,9 +165,9 @@ const char *BLT_translate_do_new_dataname(const char *msgctxt, const char *msgid
|
||||||
if (BLT_translate_new_dataname()) {
|
if (BLT_translate_new_dataname()) {
|
||||||
return BLT_pgettext(msgctxt, msgid);
|
return BLT_pgettext(msgctxt, msgid);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return msgid;
|
return msgid;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
(void)msgctxt;
|
(void)msgctxt;
|
||||||
return msgid;
|
return msgid;
|
||||||
|
|
|
@ -179,13 +179,12 @@ BMLoop *BM_loop_other_vert_loop_by_edge(BMLoop *l, BMEdge *e)
|
||||||
if (l->e == e) {
|
if (l->e == e) {
|
||||||
return l->next;
|
return l->next;
|
||||||
}
|
}
|
||||||
else if (l->prev->e == e) {
|
if (l->prev->e == e) {
|
||||||
return l->prev;
|
return l->prev;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
BLI_assert(0);
|
BLI_assert(0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,14 +42,13 @@ bool AttributesInfoBuilder::add(StringRef name, const CPPType &type, const void
|
||||||
defaults_.append(dst);
|
defaults_.append(dst);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
const CPPType &stored_type = *types_[names_.index_of_as(name)];
|
const CPPType &stored_type = *types_[names_.index_of_as(name)];
|
||||||
if (stored_type != type) {
|
if (stored_type != type) {
|
||||||
std::cout << "Warning: Tried to add an attribute twice with different types (" << name
|
std::cout << "Warning: Tried to add an attribute twice with different types (" << name << ": "
|
||||||
<< ": " << stored_type.name() << ", " << type.name() << ").\n";
|
<< stored_type.name() << ", " << type.name() << ").\n";
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AttributesInfo::AttributesInfo(const AttributesInfoBuilder &builder)
|
AttributesInfo::AttributesInfo(const AttributesInfoBuilder &builder)
|
||||||
|
|
|
@ -519,7 +519,7 @@ MFNetworkEvaluationStorage::~MFNetworkEvaluationStorage()
|
||||||
if (any_value == nullptr) {
|
if (any_value == nullptr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::OwnSingle) {
|
if (any_value->type == ValueType::OwnSingle) {
|
||||||
OwnSingleValue *value = (OwnSingleValue *)any_value;
|
OwnSingleValue *value = (OwnSingleValue *)any_value;
|
||||||
GMutableSpan span = value->span;
|
GMutableSpan span = value->span;
|
||||||
const CPPType &type = span.type();
|
const CPPType &type = span.type();
|
||||||
|
@ -710,10 +710,9 @@ GMutableSpan MFNetworkEvaluationStorage::get_single_output__full(const MFOutputS
|
||||||
|
|
||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
BLI_assert(any_value->type == ValueType::OutputSingle);
|
BLI_assert(any_value->type == ValueType::OutputSingle);
|
||||||
return ((OutputSingleValue *)any_value)->span;
|
return ((OutputSingleValue *)any_value)->span;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GMutableSpan MFNetworkEvaluationStorage::get_single_output__single(const MFOutputSocket &socket)
|
GMutableSpan MFNetworkEvaluationStorage::get_single_output__single(const MFOutputSocket &socket)
|
||||||
|
@ -729,12 +728,11 @@ GMutableSpan MFNetworkEvaluationStorage::get_single_output__single(const MFOutpu
|
||||||
|
|
||||||
return value->span;
|
return value->span;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
BLI_assert(any_value->type == ValueType::OutputSingle);
|
BLI_assert(any_value->type == ValueType::OutputSingle);
|
||||||
GMutableSpan span = ((OutputSingleValue *)any_value)->span;
|
GMutableSpan span = ((OutputSingleValue *)any_value)->span;
|
||||||
BLI_assert(span.size() == 1);
|
BLI_assert(span.size() == 1);
|
||||||
return span;
|
return span;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GVectorArray &MFNetworkEvaluationStorage::get_vector_output__full(const MFOutputSocket &socket)
|
GVectorArray &MFNetworkEvaluationStorage::get_vector_output__full(const MFOutputSocket &socket)
|
||||||
|
@ -749,10 +747,9 @@ GVectorArray &MFNetworkEvaluationStorage::get_vector_output__full(const MFOutput
|
||||||
|
|
||||||
return *value->vector_array;
|
return *value->vector_array;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
BLI_assert(any_value->type == ValueType::OutputVector);
|
BLI_assert(any_value->type == ValueType::OutputVector);
|
||||||
return *((OutputVectorValue *)any_value)->vector_array;
|
return *((OutputVectorValue *)any_value)->vector_array;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GVectorArray &MFNetworkEvaluationStorage::get_vector_output__single(const MFOutputSocket &socket)
|
GVectorArray &MFNetworkEvaluationStorage::get_vector_output__single(const MFOutputSocket &socket)
|
||||||
|
@ -767,12 +764,11 @@ GVectorArray &MFNetworkEvaluationStorage::get_vector_output__single(const MFOutp
|
||||||
|
|
||||||
return *value->vector_array;
|
return *value->vector_array;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
BLI_assert(any_value->type == ValueType::OutputVector);
|
BLI_assert(any_value->type == ValueType::OutputVector);
|
||||||
GVectorArray &vector_array = *((OutputVectorValue *)any_value)->vector_array;
|
GVectorArray &vector_array = *((OutputVectorValue *)any_value)->vector_array;
|
||||||
BLI_assert(vector_array.size() == 1);
|
BLI_assert(vector_array.size() == 1);
|
||||||
return vector_array;
|
return vector_array;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GMutableSpan MFNetworkEvaluationStorage::get_mutable_single__full(const MFInputSocket &input,
|
GMutableSpan MFNetworkEvaluationStorage::get_mutable_single__full(const MFInputSocket &input,
|
||||||
|
@ -955,15 +951,14 @@ GVSpan MFNetworkEvaluationStorage::get_single_input__full(const MFInputSocket &s
|
||||||
if (value->is_single_allocated) {
|
if (value->is_single_allocated) {
|
||||||
return GVSpan::FromSingle(value->span.type(), value->span.data(), min_array_size_);
|
return GVSpan::FromSingle(value->span.type(), value->span.data(), min_array_size_);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return value->span;
|
return value->span;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::InputSingle) {
|
if (any_value->type == ValueType::InputSingle) {
|
||||||
InputSingleValue *value = (InputSingleValue *)any_value;
|
InputSingleValue *value = (InputSingleValue *)any_value;
|
||||||
return value->virtual_span;
|
return value->virtual_span;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::OutputSingle) {
|
if (any_value->type == ValueType::OutputSingle) {
|
||||||
OutputSingleValue *value = (OutputSingleValue *)any_value;
|
OutputSingleValue *value = (OutputSingleValue *)any_value;
|
||||||
BLI_assert(value->is_computed);
|
BLI_assert(value->is_computed);
|
||||||
return value->span;
|
return value->span;
|
||||||
|
@ -984,12 +979,12 @@ GVSpan MFNetworkEvaluationStorage::get_single_input__single(const MFInputSocket
|
||||||
BLI_assert(value->span.size() == 1);
|
BLI_assert(value->span.size() == 1);
|
||||||
return value->span;
|
return value->span;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::InputSingle) {
|
if (any_value->type == ValueType::InputSingle) {
|
||||||
InputSingleValue *value = (InputSingleValue *)any_value;
|
InputSingleValue *value = (InputSingleValue *)any_value;
|
||||||
BLI_assert(value->virtual_span.is_single_element());
|
BLI_assert(value->virtual_span.is_single_element());
|
||||||
return value->virtual_span;
|
return value->virtual_span;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::OutputSingle) {
|
if (any_value->type == ValueType::OutputSingle) {
|
||||||
OutputSingleValue *value = (OutputSingleValue *)any_value;
|
OutputSingleValue *value = (OutputSingleValue *)any_value;
|
||||||
BLI_assert(value->is_computed);
|
BLI_assert(value->is_computed);
|
||||||
BLI_assert(value->span.size() == 1);
|
BLI_assert(value->span.size() == 1);
|
||||||
|
@ -1012,15 +1007,14 @@ GVArraySpan MFNetworkEvaluationStorage::get_vector_input__full(const MFInputSock
|
||||||
GSpan span = (*value->vector_array)[0];
|
GSpan span = (*value->vector_array)[0];
|
||||||
return GVArraySpan(span, min_array_size_);
|
return GVArraySpan(span, min_array_size_);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return *value->vector_array;
|
return *value->vector_array;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::InputVector) {
|
if (any_value->type == ValueType::InputVector) {
|
||||||
InputVectorValue *value = (InputVectorValue *)any_value;
|
InputVectorValue *value = (InputVectorValue *)any_value;
|
||||||
return value->virtual_array_span;
|
return value->virtual_array_span;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::OutputVector) {
|
if (any_value->type == ValueType::OutputVector) {
|
||||||
OutputVectorValue *value = (OutputVectorValue *)any_value;
|
OutputVectorValue *value = (OutputVectorValue *)any_value;
|
||||||
return *value->vector_array;
|
return *value->vector_array;
|
||||||
}
|
}
|
||||||
|
@ -1040,12 +1034,12 @@ GVArraySpan MFNetworkEvaluationStorage::get_vector_input__single(const MFInputSo
|
||||||
BLI_assert(value->vector_array->size() == 1);
|
BLI_assert(value->vector_array->size() == 1);
|
||||||
return *value->vector_array;
|
return *value->vector_array;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::InputVector) {
|
if (any_value->type == ValueType::InputVector) {
|
||||||
InputVectorValue *value = (InputVectorValue *)any_value;
|
InputVectorValue *value = (InputVectorValue *)any_value;
|
||||||
BLI_assert(value->virtual_array_span.is_single_array());
|
BLI_assert(value->virtual_array_span.is_single_array());
|
||||||
return value->virtual_array_span;
|
return value->virtual_array_span;
|
||||||
}
|
}
|
||||||
else if (any_value->type == ValueType::OutputVector) {
|
if (any_value->type == ValueType::OutputVector) {
|
||||||
OutputVectorValue *value = (OutputVectorValue *)any_value;
|
OutputVectorValue *value = (OutputVectorValue *)any_value;
|
||||||
BLI_assert(value->vector_array->size() == 1);
|
BLI_assert(value->vector_array->size() == 1);
|
||||||
return *value->vector_array;
|
return *value->vector_array;
|
||||||
|
|
|
@ -45,9 +45,8 @@ static bool set_tag_and_check_if_modified(bool &tag, bool new_value)
|
||||||
tag = new_value;
|
tag = new_value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Array<bool> mask_nodes_to_the_left(MFNetwork &network, Span<MFNode *> nodes)
|
static Array<bool> mask_nodes_to_the_left(MFNetwork &network, Span<MFNode *> nodes)
|
||||||
|
|
|
@ -180,9 +180,8 @@ float get_modifier_point_weight(MDeformVert *dvert, bool inverse, int def_nr)
|
||||||
if (inverse == 1) {
|
if (inverse == 1) {
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return -1.0f;
|
return -1.0f;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return weight;
|
return weight;
|
||||||
|
|
|
@ -484,7 +484,7 @@ static void generate_geometry(GpencilModifierData *md,
|
||||||
/* Early exit */
|
/* Early exit */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (ctime >= end_frame) {
|
if (ctime >= end_frame) {
|
||||||
/* Past End - Animation finished. Display final result. */
|
/* Past End - Animation finished. Display final result. */
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
/* 1) Reverse = Start with all, end with nothing.
|
/* 1) Reverse = Start with all, end with nothing.
|
||||||
|
|
|
@ -120,7 +120,7 @@ static float gpencil_hook_falloff(const struct GPHookData_cb *tData, const float
|
||||||
if (len_sq > tData->falloff_sq) {
|
if (len_sq > tData->falloff_sq) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
else if (len_sq > 0.0f) {
|
if (len_sq > 0.0f) {
|
||||||
float fac;
|
float fac;
|
||||||
|
|
||||||
if (tData->falloff_type == eGPHook_Falloff_Const) {
|
if (tData->falloff_type == eGPHook_Falloff_Const) {
|
||||||
|
|
|
@ -452,21 +452,20 @@ static void execute_posetree(struct Depsgraph *depsgraph,
|
||||||
/* don't solve IK when we are setting the pole angle */
|
/* don't solve IK when we are setting the pole angle */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
mul_m4_m4m4(goal, goalinv, rootmat);
|
|
||||||
copy_v3_v3(polepos, goal[3]);
|
|
||||||
poleconstrain = 1;
|
|
||||||
|
|
||||||
/* for pole targets, we blend the result of the ik solver
|
mul_m4_m4m4(goal, goalinv, rootmat);
|
||||||
* instead of the target position, otherwise we can't get
|
copy_v3_v3(polepos, goal[3]);
|
||||||
* a smooth transition */
|
poleconstrain = 1;
|
||||||
resultblend = 1;
|
|
||||||
resultinf = target->con->enforce;
|
|
||||||
|
|
||||||
if (data->flag & CONSTRAINT_IK_GETANGLE) {
|
/* for pole targets, we blend the result of the ik solver
|
||||||
poleangledata = data;
|
* instead of the target position, otherwise we can't get
|
||||||
data->flag &= ~CONSTRAINT_IK_GETANGLE;
|
* a smooth transition */
|
||||||
}
|
resultblend = 1;
|
||||||
|
resultinf = target->con->enforce;
|
||||||
|
|
||||||
|
if (data->flag & CONSTRAINT_IK_GETANGLE) {
|
||||||
|
poleangledata = data;
|
||||||
|
data->flag &= ~CONSTRAINT_IK_GETANGLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -446,24 +446,21 @@ static double EulerAngleFromMatrix(const KDL::Rotation &R, int axis)
|
||||||
if (axis == 0) {
|
if (axis == 0) {
|
||||||
return -KDL::atan2(R(1, 2), R(2, 2));
|
return -KDL::atan2(R(1, 2), R(2, 2));
|
||||||
}
|
}
|
||||||
else if (axis == 1) {
|
if (axis == 1) {
|
||||||
return KDL::atan2(-R(0, 2), t);
|
return KDL::atan2(-R(0, 2), t);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return -KDL::atan2(R(0, 1), R(0, 0));
|
return -KDL::atan2(R(0, 1), R(0, 0));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (axis == 0) {
|
if (axis == 0) {
|
||||||
return -KDL::atan2(-R(2, 1), R(1, 1));
|
return -KDL::atan2(-R(2, 1), R(1, 1));
|
||||||
}
|
|
||||||
else if (axis == 1) {
|
|
||||||
return KDL::atan2(-R(0, 2), t);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (axis == 1) {
|
||||||
|
return KDL::atan2(-R(0, 2), t);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double ComputeTwist(const KDL::Rotation &R)
|
static double ComputeTwist(const KDL::Rotation &R)
|
||||||
|
|
|
@ -356,141 +356,140 @@ static bool init_structDNA(SDNA *sdna, bool do_endian_swap, const char **r_error
|
||||||
*r_error_message = "SDNA error in SDNA file";
|
*r_error_message = "SDNA error in SDNA file";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
const char *cp;
|
const char *cp;
|
||||||
|
|
||||||
|
data++;
|
||||||
|
/* Names array ('NAME') */
|
||||||
|
if (*data == MAKE_ID('N', 'A', 'M', 'E')) {
|
||||||
|
data++;
|
||||||
|
|
||||||
|
sdna->names_len = *data;
|
||||||
|
if (do_endian_swap) {
|
||||||
|
BLI_endian_switch_int32(&sdna->names_len);
|
||||||
|
}
|
||||||
|
sdna->names_len_alloc = sdna->names_len;
|
||||||
|
|
||||||
data++;
|
data++;
|
||||||
/* Names array ('NAME') */
|
sdna->names = MEM_callocN(sizeof(void *) * sdna->names_len, "sdnanames");
|
||||||
if (*data == MAKE_ID('N', 'A', 'M', 'E')) {
|
}
|
||||||
data++;
|
else {
|
||||||
|
*r_error_message = "NAME error in SDNA file";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
sdna->names_len = *data;
|
cp = (char *)data;
|
||||||
if (do_endian_swap) {
|
for (int nr = 0; nr < sdna->names_len; nr++) {
|
||||||
BLI_endian_switch_int32(&sdna->names_len);
|
sdna->names[nr] = cp;
|
||||||
|
|
||||||
|
/* "float gravity [3]" was parsed wrong giving both "gravity" and
|
||||||
|
* "[3]" members. we rename "[3]", and later set the type of
|
||||||
|
* "gravity" to "void" so the offsets work out correct */
|
||||||
|
if (*cp == '[' && strcmp(cp, "[3]") == 0) {
|
||||||
|
if (nr && strcmp(sdna->names[nr - 1], "Cvi") == 0) {
|
||||||
|
sdna->names[nr] = "gravity[3]";
|
||||||
|
gravity_fix = nr;
|
||||||
}
|
}
|
||||||
sdna->names_len_alloc = sdna->names_len;
|
|
||||||
|
|
||||||
data++;
|
|
||||||
sdna->names = MEM_callocN(sizeof(void *) * sdna->names_len, "sdnanames");
|
|
||||||
}
|
}
|
||||||
else {
|
while (*cp) {
|
||||||
*r_error_message = "NAME error in SDNA file";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
cp = (char *)data;
|
|
||||||
for (int nr = 0; nr < sdna->names_len; nr++) {
|
|
||||||
sdna->names[nr] = cp;
|
|
||||||
|
|
||||||
/* "float gravity [3]" was parsed wrong giving both "gravity" and
|
|
||||||
* "[3]" members. we rename "[3]", and later set the type of
|
|
||||||
* "gravity" to "void" so the offsets work out correct */
|
|
||||||
if (*cp == '[' && strcmp(cp, "[3]") == 0) {
|
|
||||||
if (nr && strcmp(sdna->names[nr - 1], "Cvi") == 0) {
|
|
||||||
sdna->names[nr] = "gravity[3]";
|
|
||||||
gravity_fix = nr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (*cp) {
|
|
||||||
cp++;
|
|
||||||
}
|
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
|
cp++;
|
||||||
|
}
|
||||||
|
|
||||||
cp = pad_up_4(cp);
|
cp = pad_up_4(cp);
|
||||||
|
|
||||||
/* Type names array ('TYPE') */
|
/* Type names array ('TYPE') */
|
||||||
data = (int *)cp;
|
data = (int *)cp;
|
||||||
if (*data == MAKE_ID('T', 'Y', 'P', 'E')) {
|
if (*data == MAKE_ID('T', 'Y', 'P', 'E')) {
|
||||||
data++;
|
data++;
|
||||||
|
|
||||||
sdna->types_len = *data;
|
sdna->types_len = *data;
|
||||||
if (do_endian_swap) {
|
if (do_endian_swap) {
|
||||||
BLI_endian_switch_int32(&sdna->types_len);
|
BLI_endian_switch_int32(&sdna->types_len);
|
||||||
}
|
|
||||||
|
|
||||||
data++;
|
|
||||||
sdna->types = MEM_callocN(sizeof(void *) * sdna->types_len, "sdnatypes");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*r_error_message = "TYPE error in SDNA file";
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cp = (char *)data;
|
data++;
|
||||||
for (int nr = 0; nr < sdna->types_len; nr++) {
|
sdna->types = MEM_callocN(sizeof(void *) * sdna->types_len, "sdnatypes");
|
||||||
/* WARNING! See: DNA_struct_rename_legacy_hack_static_from_alias docs. */
|
}
|
||||||
sdna->types[nr] = DNA_struct_rename_legacy_hack_static_from_alias(cp);
|
else {
|
||||||
while (*cp) {
|
*r_error_message = "TYPE error in SDNA file";
|
||||||
cp++;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cp = (char *)data;
|
||||||
|
for (int nr = 0; nr < sdna->types_len; nr++) {
|
||||||
|
/* WARNING! See: DNA_struct_rename_legacy_hack_static_from_alias docs. */
|
||||||
|
sdna->types[nr] = DNA_struct_rename_legacy_hack_static_from_alias(cp);
|
||||||
|
while (*cp) {
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
|
cp++;
|
||||||
|
}
|
||||||
|
|
||||||
cp = pad_up_4(cp);
|
cp = pad_up_4(cp);
|
||||||
|
|
||||||
/* Type lengths array ('TLEN') */
|
|
||||||
data = (int *)cp;
|
|
||||||
if (*data == MAKE_ID('T', 'L', 'E', 'N')) {
|
|
||||||
data++;
|
|
||||||
sp = (short *)data;
|
|
||||||
sdna->types_size = sp;
|
|
||||||
|
|
||||||
if (do_endian_swap) {
|
|
||||||
BLI_endian_switch_int16_array(sp, sdna->types_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
sp += sdna->types_len;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*r_error_message = "TLEN error in SDNA file";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
/* prevent BUS error */
|
|
||||||
if (sdna->types_len & 1) {
|
|
||||||
sp++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Struct array ('STRC') */
|
|
||||||
data = (int *)sp;
|
|
||||||
if (*data == MAKE_ID('S', 'T', 'R', 'C')) {
|
|
||||||
data++;
|
|
||||||
|
|
||||||
sdna->structs_len = *data;
|
|
||||||
if (do_endian_swap) {
|
|
||||||
BLI_endian_switch_int32(&sdna->structs_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
data++;
|
|
||||||
sdna->structs = MEM_callocN(sizeof(void *) * sdna->structs_len, "sdnastrcs");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*r_error_message = "STRC error in SDNA file";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Type lengths array ('TLEN') */
|
||||||
|
data = (int *)cp;
|
||||||
|
if (*data == MAKE_ID('T', 'L', 'E', 'N')) {
|
||||||
|
data++;
|
||||||
sp = (short *)data;
|
sp = (short *)data;
|
||||||
for (int nr = 0; nr < sdna->structs_len; nr++) {
|
sdna->types_size = sp;
|
||||||
sdna->structs[nr] = sp;
|
|
||||||
|
|
||||||
if (do_endian_swap) {
|
if (do_endian_swap) {
|
||||||
short a;
|
BLI_endian_switch_int16_array(sp, sdna->types_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
sp += sdna->types_len;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*r_error_message = "TLEN error in SDNA file";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/* prevent BUS error */
|
||||||
|
if (sdna->types_len & 1) {
|
||||||
|
sp++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Struct array ('STRC') */
|
||||||
|
data = (int *)sp;
|
||||||
|
if (*data == MAKE_ID('S', 'T', 'R', 'C')) {
|
||||||
|
data++;
|
||||||
|
|
||||||
|
sdna->structs_len = *data;
|
||||||
|
if (do_endian_swap) {
|
||||||
|
BLI_endian_switch_int32(&sdna->structs_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
data++;
|
||||||
|
sdna->structs = MEM_callocN(sizeof(void *) * sdna->structs_len, "sdnastrcs");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*r_error_message = "STRC error in SDNA file";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sp = (short *)data;
|
||||||
|
for (int nr = 0; nr < sdna->structs_len; nr++) {
|
||||||
|
sdna->structs[nr] = sp;
|
||||||
|
|
||||||
|
if (do_endian_swap) {
|
||||||
|
short a;
|
||||||
|
|
||||||
|
BLI_endian_switch_int16(&sp[0]);
|
||||||
|
BLI_endian_switch_int16(&sp[1]);
|
||||||
|
|
||||||
|
a = sp[1];
|
||||||
|
sp += 2;
|
||||||
|
while (a--) {
|
||||||
BLI_endian_switch_int16(&sp[0]);
|
BLI_endian_switch_int16(&sp[0]);
|
||||||
BLI_endian_switch_int16(&sp[1]);
|
BLI_endian_switch_int16(&sp[1]);
|
||||||
|
|
||||||
a = sp[1];
|
|
||||||
sp += 2;
|
sp += 2;
|
||||||
while (a--) {
|
|
||||||
BLI_endian_switch_int16(&sp[0]);
|
|
||||||
BLI_endian_switch_int16(&sp[1]);
|
|
||||||
sp += 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sp += 2 * sp[1] + 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
sp += 2 * sp[1] + 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -578,16 +577,15 @@ SDNA *DNA_sdna_from_data(const void *data,
|
||||||
if (init_structDNA(sdna, do_endian_swap, &error_message)) {
|
if (init_structDNA(sdna, do_endian_swap, &error_message)) {
|
||||||
return sdna;
|
return sdna;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (r_error_message == NULL) {
|
if (r_error_message == NULL) {
|
||||||
fprintf(stderr, "Error decoding blend file SDNA: %s\n", error_message);
|
fprintf(stderr, "Error decoding blend file SDNA: %s\n", error_message);
|
||||||
}
|
|
||||||
else {
|
|
||||||
*r_error_message = error_message;
|
|
||||||
}
|
|
||||||
DNA_sdna_free(sdna);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
*r_error_message = error_message;
|
||||||
|
}
|
||||||
|
DNA_sdna_free(sdna);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -764,34 +762,33 @@ static eSDNA_Type sdna_type_nr(const char *dna_type)
|
||||||
if (STR_ELEM(dna_type, "char", "const char")) {
|
if (STR_ELEM(dna_type, "char", "const char")) {
|
||||||
return SDNA_TYPE_CHAR;
|
return SDNA_TYPE_CHAR;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "uchar", "unsigned char")) {
|
if (STR_ELEM(dna_type, "uchar", "unsigned char")) {
|
||||||
return SDNA_TYPE_UCHAR;
|
return SDNA_TYPE_UCHAR;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "short")) {
|
if (STR_ELEM(dna_type, "short")) {
|
||||||
return SDNA_TYPE_SHORT;
|
return SDNA_TYPE_SHORT;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "ushort", "unsigned short")) {
|
if (STR_ELEM(dna_type, "ushort", "unsigned short")) {
|
||||||
return SDNA_TYPE_USHORT;
|
return SDNA_TYPE_USHORT;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "int")) {
|
if (STR_ELEM(dna_type, "int")) {
|
||||||
return SDNA_TYPE_INT;
|
return SDNA_TYPE_INT;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "float")) {
|
if (STR_ELEM(dna_type, "float")) {
|
||||||
return SDNA_TYPE_FLOAT;
|
return SDNA_TYPE_FLOAT;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "double")) {
|
if (STR_ELEM(dna_type, "double")) {
|
||||||
return SDNA_TYPE_DOUBLE;
|
return SDNA_TYPE_DOUBLE;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "int64_t")) {
|
if (STR_ELEM(dna_type, "int64_t")) {
|
||||||
return SDNA_TYPE_INT64;
|
return SDNA_TYPE_INT64;
|
||||||
}
|
}
|
||||||
else if (STR_ELEM(dna_type, "uint64_t")) {
|
if (STR_ELEM(dna_type, "uint64_t")) {
|
||||||
return SDNA_TYPE_UINT64;
|
return SDNA_TYPE_UINT64;
|
||||||
}
|
}
|
||||||
/* invalid! */
|
/* invalid! */
|
||||||
else {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1150,7 +1147,7 @@ static void reconstruct_elem(const SDNA *newsdna,
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (countpos != 0) { /* name is an array */
|
if (countpos != 0) { /* name is an array */
|
||||||
|
|
||||||
if (oname[countpos] == '[' && strncmp(name, oname, countpos) == 0) { /* basis equal */
|
if (oname[countpos] == '[' && strncmp(name, oname, countpos) == 0) { /* basis equal */
|
||||||
const int new_name_array_len = newsdna->names_array_len[new_name_nr];
|
const int new_name_array_len = newsdna->names_array_len[new_name_nr];
|
||||||
|
|
|
@ -360,7 +360,7 @@ static int add_type(const char *str, int size)
|
||||||
if (str[0] == 0) {
|
if (str[0] == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if (strchr(str, '*')) {
|
if (strchr(str, '*')) {
|
||||||
/* note: this is valid C syntax but we can't parse, complain!
|
/* note: this is valid C syntax but we can't parse, complain!
|
||||||
* `struct SomeStruct* some_var;` <-- correct but we cant handle right now. */
|
* `struct SomeStruct* some_var;` <-- correct but we cant handle right now. */
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -117,12 +117,11 @@ static float mix_weight(float weight, float weight2, char mix_mode)
|
||||||
if (mix_mode == MOD_WVG_MIX_DIF) {
|
if (mix_mode == MOD_WVG_MIX_DIF) {
|
||||||
return (weight < weight2 ? weight2 - weight : weight - weight2);
|
return (weight < weight2 ? weight2 - weight : weight - weight2);
|
||||||
}
|
}
|
||||||
else if (mix_mode == MOD_WVG_MIX_AVG) {
|
if (mix_mode == MOD_WVG_MIX_AVG) {
|
||||||
return (weight + weight2) * 0.5f;
|
return (weight + weight2) * 0.5f;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return weight2;
|
return weight2;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************
|
/**************************************
|
||||||
|
|
|
@ -491,7 +491,7 @@ static float clipx_rctf(rctf *rf, float x1, float x2)
|
||||||
rf->xmin = rf->xmax;
|
rf->xmin = rf->xmax;
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
else if (size != 0.0f) {
|
if (size != 0.0f) {
|
||||||
return BLI_rctf_size_x(rf) / size;
|
return BLI_rctf_size_x(rf) / size;
|
||||||
}
|
}
|
||||||
return 1.0;
|
return 1.0;
|
||||||
|
@ -514,7 +514,7 @@ static float clipy_rctf(rctf *rf, float y1, float y2)
|
||||||
rf->ymin = rf->ymax;
|
rf->ymin = rf->ymax;
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
else if (size != 0.0f) {
|
if (size != 0.0f) {
|
||||||
return BLI_rctf_size_y(rf) / size;
|
return BLI_rctf_size_y(rf) / size;
|
||||||
}
|
}
|
||||||
return 1.0;
|
return 1.0;
|
||||||
|
|
|
@ -281,9 +281,8 @@ RenderLayer *RE_GetRenderLayer(RenderResult *rr, const char *name)
|
||||||
if (rr == NULL) {
|
if (rr == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return BLI_findstring(&rr->layers, name, offsetof(RenderLayer, name));
|
return BLI_findstring(&rr->layers, name, offsetof(RenderLayer, name));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RE_HasSingleLayer(Render *re)
|
bool RE_HasSingleLayer(Render *re)
|
||||||
|
@ -1655,9 +1654,8 @@ static bool check_valid_compositing_camera(Scene *scene, Object *camera_override
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return (camera_override != NULL || scene->camera != NULL);
|
return (camera_override != NULL || scene->camera != NULL);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool check_valid_camera_multiview(Scene *scene, Object *camera, ReportList *reports)
|
static bool check_valid_camera_multiview(Scene *scene, Object *camera, ReportList *reports)
|
||||||
|
@ -1755,7 +1753,7 @@ static bool node_tree_has_composite_output(bNodeTree *ntree)
|
||||||
if (ELEM(node->type, CMP_NODE_COMPOSITE, CMP_NODE_OUTPUT_FILE)) {
|
if (ELEM(node->type, CMP_NODE_COMPOSITE, CMP_NODE_OUTPUT_FILE)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) {
|
if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) {
|
||||||
if (node->id) {
|
if (node->id) {
|
||||||
if (node_tree_has_composite_output((bNodeTree *)node->id)) {
|
if (node_tree_has_composite_output((bNodeTree *)node->id)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -2506,9 +2504,8 @@ void RE_RenderAnim(Render *re,
|
||||||
/* Skip this frame, but could update for physics and particles system. */
|
/* Skip this frame, but could update for physics and particles system. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
nfra += tfra;
|
nfra += tfra;
|
||||||
}
|
|
||||||
|
|
||||||
/* Touch/NoOverwrite options are only valid for image's */
|
/* Touch/NoOverwrite options are only valid for image's */
|
||||||
if (is_movie == false) {
|
if (is_movie == false) {
|
||||||
|
@ -2863,7 +2860,7 @@ RenderPass *RE_pass_find_by_name(volatile RenderLayer *rl, const char *name, con
|
||||||
if (viewname == NULL || viewname[0] == '\0') {
|
if (viewname == NULL || viewname[0] == '\0') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (STREQ(rp->view, viewname)) {
|
if (STREQ(rp->view, viewname)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -709,7 +709,7 @@ static int order_render_passes(const void *a, const void *b)
|
||||||
if (passtype_a > passtype_b) {
|
if (passtype_a > passtype_b) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (passtype_a < passtype_b) {
|
if (passtype_a < passtype_b) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,7 +728,7 @@ static int order_render_passes(const void *a, const void *b)
|
||||||
if (STREQ(rpa->view, STEREO_LEFT_NAME)) {
|
if (STREQ(rpa->view, STEREO_LEFT_NAME)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (STREQ(rpb->view, STEREO_LEFT_NAME)) {
|
if (STREQ(rpb->view, STEREO_LEFT_NAME)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,7 +736,7 @@ static int order_render_passes(const void *a, const void *b)
|
||||||
if (STREQ(rpa->view, STEREO_RIGHT_NAME)) {
|
if (STREQ(rpa->view, STEREO_RIGHT_NAME)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (STREQ(rpb->view, STEREO_RIGHT_NAME)) {
|
if (STREQ(rpb->view, STEREO_RIGHT_NAME)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -930,9 +930,8 @@ bool RE_WriteRenderResult(ReportList *reports,
|
||||||
if (!STREQ(view, viewname)) {
|
if (!STREQ(view, viewname)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
viewname = "";
|
viewname = "";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip compositing if only a single other layer is requested. */
|
/* Skip compositing if only a single other layer is requested. */
|
||||||
|
@ -993,9 +992,8 @@ bool RE_WriteRenderResult(ReportList *reports,
|
||||||
if (!STREQ(view, viewname)) {
|
if (!STREQ(view, viewname)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
viewname = "";
|
viewname = "";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We only store RGBA passes as half float, for
|
/* We only store RGBA passes as half float, for
|
||||||
|
|
|
@ -1381,20 +1381,19 @@ static int multitex_nodes_intern(Tex *tex,
|
||||||
|
|
||||||
return rgbnor;
|
return rgbnor;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return multitex(tex,
|
return multitex(tex,
|
||||||
texvec,
|
texvec,
|
||||||
dxt,
|
dxt,
|
||||||
dyt,
|
dyt,
|
||||||
osatex,
|
osatex,
|
||||||
texres,
|
texres,
|
||||||
thread,
|
thread,
|
||||||
which_output,
|
which_output,
|
||||||
pool,
|
pool,
|
||||||
skip_load_image,
|
skip_load_image,
|
||||||
texnode_preview,
|
texnode_preview,
|
||||||
use_nodes);
|
use_nodes);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is called from the shader and texture nodes
|
/* this is called from the shader and texture nodes
|
||||||
|
|
|
@ -710,9 +710,8 @@ BLI_INLINE float hair_volume_density_divergence(float density,
|
||||||
if (density > density_threshold && density > target_density) {
|
if (density > density_threshold && density > target_density) {
|
||||||
return strength * logf(target_density / density);
|
return strength * logf(target_density / density);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SIM_hair_volume_solve_divergence(HairGrid *grid,
|
bool SIM_hair_volume_solve_divergence(HairGrid *grid,
|
||||||
|
@ -1030,14 +1029,13 @@ bool SIM_hair_volume_solve_divergence(HairGrid *grid,
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
/* Clear result in case of error */
|
|
||||||
for (i = 0, vert = grid->verts; i < num_cells; i++, vert++) {
|
|
||||||
zero_v3(vert->velocity_smooth);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
/* Clear result in case of error */
|
||||||
|
for (i = 0, vert = grid->verts; i < num_cells; i++, vert++) {
|
||||||
|
zero_v3(vert->velocity_smooth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* XXX weighting is incorrect, disabled for now */
|
#if 0 /* XXX weighting is incorrect, disabled for now */
|
||||||
|
|
|
@ -1711,9 +1711,8 @@ BLI_INLINE float fbstar(float length, float L, float kb, float cb)
|
||||||
if (tempfb_fl < fbstar_fl) {
|
if (tempfb_fl < fbstar_fl) {
|
||||||
return fbstar_fl;
|
return fbstar_fl;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return tempfb_fl;
|
return tempfb_fl;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// function to calculae bending spring force (taken from Choi & Co)
|
// function to calculae bending spring force (taken from Choi & Co)
|
||||||
|
@ -1725,9 +1724,8 @@ BLI_INLINE float fbstar_jacobi(float length, float L, float kb, float cb)
|
||||||
if (tempfb_fl < fbstar_fl) {
|
if (tempfb_fl < fbstar_fl) {
|
||||||
return -cb;
|
return -cb;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return -kb * fbderiv(length, L);
|
return -kb * fbderiv(length, L);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate elonglation */
|
/* calculate elonglation */
|
||||||
|
@ -1864,9 +1862,8 @@ bool SIM_mass_spring_force_spring_bending(
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_INLINE void poly_avg(lfVector *data, const int *inds, int len, float r_avg[3])
|
BLI_INLINE void poly_avg(lfVector *data, const int *inds, int len, float r_avg[3])
|
||||||
|
@ -2352,9 +2349,8 @@ bool SIM_mass_spring_force_spring_goal(Implicit_Data *data,
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* IMPLICIT_SOLVER_BLENDER */
|
#endif /* IMPLICIT_SOLVER_BLENDER */
|
||||||
|
|
|
@ -102,9 +102,8 @@ fn::GVSpan ParticleFunctionEvaluator::get(int output_index, StringRef expected_n
|
||||||
if (particle_fn_.output_is_global_[output_index]) {
|
if (particle_fn_.output_is_global_[output_index]) {
|
||||||
return fn::GVSpan::FromSingleWithMaxSize(type, buffer);
|
return fn::GVSpan::FromSingleWithMaxSize(type, buffer);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return fn::GVSpan(fn::GSpan(type, buffer, mask_.min_array_size()));
|
return fn::GVSpan(fn::GSpan(type, buffer, mask_.min_array_size()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticleFunctionEvaluator::compute_globals()
|
void ParticleFunctionEvaluator::compute_globals()
|
||||||
|
|
Loading…
Reference in New Issue