Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/fmodifier.c
| Context not available. | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "CLG_log.h" | |||||
| #include "DNA_anim_types.h" | #include "DNA_anim_types.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| Context not available. | |||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| static CLG_LogRef LOG = { "bke.fmodifier" }; | |||||
| /* ******************************** F-Modifiers ********************************* */ | /* ******************************** F-Modifiers ********************************* */ | ||||
| /* Forward declarations. */ | /* Forward declarations. */ | ||||
| Context not available. | |||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| printf("Invalid Function-Generator for F-Modifier - %d\n", data->type); | CLOG_ERROR(&LOG, "Invalid Function-Generator for F-Modifier - %d", data->type); | ||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||
| * - keyframe to be added would replace one of the existing ones on bounds | * - keyframe to be added would replace one of the existing ones on bounds | ||||
| */ | */ | ||||
| if ((arraylen <= 0) || (array == NULL)) { | if ((arraylen <= 0) || (array == NULL)) { | ||||
| printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array\n"); | CLOG_WARN(&LOG, "encountered invalid array"); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| /* print error if loop-limit exceeded */ | /* print error if loop-limit exceeded */ | ||||
| if (loopbreaker == (maxloop - 1)) { | if (loopbreaker == (maxloop - 1)) { | ||||
| printf("Error: binarysearch_fcm_envelopedata_index() was taking too long\n"); | CLOG_ERROR(&LOG, "binary search was taking too long"); | ||||
| // include debug info | // include debug info | ||||
| printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen); | CLOG_ERROR(&LOG, "\tround = %d: start = %d, end = %d, arraylen = %d", loopbreaker, start, end, arraylen); | ||||
| } | } | ||||
| /* not found, so return where to place it */ | /* not found, so return where to place it */ | ||||
| Context not available. | |||||
| return fmodifiersTypeInfo[type]; | return fmodifiersTypeInfo[type]; | ||||
| } | } | ||||
| else { | else { | ||||
| printf("No valid F-Curve Modifier type-info data available. Type = %i\n", type); | CLOG_ERROR(&LOG, "No valid F-Curve Modifier type-info data available. Type = %i", type); | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| Context not available. | |||||
| if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) { | if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) { | ||||
| /* cycles modifier must be first in stack, so for now, don't add if it can't be */ | /* cycles modifier must be first in stack, so for now, don't add if it can't be */ | ||||
| /* TODO: perhaps there is some better way, but for now, */ | /* TODO: perhaps there is some better way, but for now, */ | ||||
| printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack.\n"); | CLOG_STR_ERROR(&LOG, "Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack."); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| /* XXX this case can probably be removed some day, as it shouldn't happen... */ | /* XXX this case can probably be removed some day, as it shouldn't happen... */ | ||||
| printf("remove_fmodifier() - no modifier stack given\n"); | CLOG_STR_ERROR(&LOG, "no modifier stack given"); | ||||
| MEM_freeN(fcm); | MEM_freeN(fcm); | ||||
| return false; | return false; | ||||
| } | } | ||||
| Context not available. | |||||
| ChannelDriver *driver; | ChannelDriver *driver; | ||||
| /* sanity checks */ | /* sanity checks */ | ||||
| /* TODO: make these tests report errors using reports not printf's */ | /* TODO: make these tests report errors using reports not CLOG's */ | ||||
| if (ELEM(NULL, fcu, fcu->modifiers.first)) { | if (ELEM(NULL, fcu, fcu->modifiers.first)) { | ||||
| printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); | CLOG_ERROR(&LOG, "No F-Curve with F-Curve Modifiers to Bake"); | ||||
| return; | return; | ||||
| } | } | ||||
| Context not available. | |||||