texture curves were not initialized (causing crash), own regression from moving curve initialization outside evaluation.

This commit is contained in:
Campbell Barton
2012-08-29 07:58:36 +00:00
parent a3d4b98a30
commit 78ded61065
4 changed files with 11 additions and 8 deletions

View File

@@ -73,6 +73,12 @@ void node_copy_standard_storage(bNode *orig_node, bNode *new_node)
new_node->storage= MEM_dupallocN(orig_node->storage);
}
void *node_initexec_curves(bNode *node)
{
curvemapping_initialize(node->storage);
return NULL; /* unused return */
}
/**** Labels ****/
const char *node_blend_label(bNode *node)

View File

@@ -53,6 +53,7 @@ extern void node_free_standard_storage(struct bNode *node);
extern void node_copy_curves(struct bNode *orig_node, struct bNode *new_node);
extern void node_copy_standard_storage(struct bNode *orig_node, struct bNode *new_node);
extern void *node_initexec_curves(struct bNode *node);
/**** Labels ****/

View File

@@ -45,12 +45,6 @@ static bNodeSocketTemplate sh_node_curve_vec_out[]= {
{ -1, 0, "" }
};
static void *node_shader_initexec_curve(bNode *node)
{
curvemapping_initialize(node->storage);
return NULL; /* unused return */
}
static void node_shader_exec_curve_vec(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
{
float vec[3];
@@ -86,7 +80,7 @@ void register_node_type_sh_curve_vec(bNodeTreeType *ttype)
node_type_init(&ntype, node_shader_init_curve_vec);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, node_shader_exec_curve_vec);
node_type_exec_new(&ntype, node_shader_initexec_curve, NULL, NULL); /* only for its initexec func */
node_type_exec_new(&ntype, node_initexec_curves, NULL, NULL); /* only for its initexec func */
node_type_gpu(&ntype, gpu_shader_curve_vec);
nodeRegisterType(ttype, &ntype);
@@ -144,7 +138,7 @@ void register_node_type_sh_curve_rgb(bNodeTreeType *ttype)
node_type_init(&ntype, node_shader_init_curve_rgb);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, node_shader_exec_curve_rgb);
node_type_exec_new(&ntype, node_shader_initexec_curve, NULL, NULL); /* only for its initexec func */
node_type_exec_new(&ntype, node_initexec_curves, NULL, NULL); /* only for its initexec func */
node_type_gpu(&ntype, gpu_shader_curve_rgb);
nodeRegisterType(ttype, &ntype);

View File

@@ -77,6 +77,7 @@ void register_node_type_tex_curve_time(bNodeTreeType *ttype)
node_type_init(&ntype, time_init);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, time_exec);
node_type_exec_new(&ntype, node_initexec_curves, NULL, NULL); /* only for its initexec func */
nodeRegisterType(ttype, &ntype);
}
@@ -121,6 +122,7 @@ void register_node_type_tex_curve_rgb(bNodeTreeType *ttype)
node_type_init(&ntype, rgb_init);
node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves);
node_type_exec(&ntype, rgb_exec);
node_type_exec_new(&ntype, node_initexec_curves, NULL, NULL); /* only for its initexec func */
nodeRegisterType(ttype, &ntype);
}