texture curves were not initialized (causing crash), own regression from moving curve initialization outside evaluation.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 ****/
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user