forked from bartvdbraak/blender
remove redundant null checks and avoid divide by zero in driver evaluation
This commit is contained in:
parent
fa3699f067
commit
edb850c842
@ -1697,7 +1697,7 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
|
||||
|
||||
/* perform operations on the total if appropriate */
|
||||
if (driver->type == DRIVER_TYPE_AVERAGE)
|
||||
driver->curval = (value / (float)tot);
|
||||
driver->curval = tot ? (value / (float)tot) : 0.0f;
|
||||
else
|
||||
driver->curval = value;
|
||||
}
|
||||
|
@ -2718,8 +2718,8 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
|
||||
re = RE_GetRender(iuser->scene->id.name);
|
||||
|
||||
channels = 4;
|
||||
layer = (iuser) ? iuser->layer : 0;
|
||||
pass = (iuser) ? iuser->pass : 0;
|
||||
layer = iuser->layer;
|
||||
pass = iuser->pass;
|
||||
|
||||
if (from_render) {
|
||||
RE_AcquireResultImage(re, &rres);
|
||||
|
@ -681,7 +681,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target,
|
||||
* we want either a Mesh with no derived data, or derived data with
|
||||
* deformverts
|
||||
*/
|
||||
if (target && target->type == OB_MESH) {
|
||||
if (target->type == OB_MESH) {
|
||||
/* if there's derived data without deformverts, don't use vgroups */
|
||||
if (dm) {
|
||||
use_vgroups = (dm->getVertData(dm, 0, CD_MDEFORMVERT) != NULL);
|
||||
|
@ -2051,8 +2051,10 @@ int do_version_tface(Main *main, int fileload)
|
||||
printf("Warning: material \"%s\" skipped - to convert old game texface to material go to the Help menu.\n", ma->id.name + 2);
|
||||
nowarning = 0;
|
||||
}
|
||||
else
|
||||
convert_tfacematerial(main, ma); continue;
|
||||
else {
|
||||
convert_tfacematerial(main, ma);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* no conflicts in this material - 90% of cases
|
||||
|
Loading…
Reference in New Issue
Block a user