diff options
Diffstat (limited to 'source/blender/shader_fx/intern/FX_shader_light.c')
-rw-r--r-- | source/blender/shader_fx/intern/FX_shader_light.c | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/source/blender/shader_fx/intern/FX_shader_light.c b/source/blender/shader_fx/intern/FX_shader_light.c index d4c726a63db..d3d5b9b69cb 100644 --- a/source/blender/shader_fx/intern/FX_shader_light.c +++ b/source/blender/shader_fx/intern/FX_shader_light.c @@ -40,56 +40,57 @@ static void initData(ShaderFxData *fx) { - LightShaderFxData *gpfx = (LightShaderFxData *)fx; - gpfx->energy = 10.0f; - gpfx->ambient = 5.0f; - gpfx->object = NULL; + LightShaderFxData *gpfx = (LightShaderFxData *)fx; + gpfx->energy = 10.0f; + gpfx->ambient = 5.0f; + gpfx->object = NULL; } static void copyData(const ShaderFxData *md, ShaderFxData *target) { - BKE_shaderfx_copyData_generic(md, target); + BKE_shaderfx_copyData_generic(md, target); } static void updateDepsgraph(ShaderFxData *md, const ModifierUpdateDepsgraphContext *ctx) { - LightShaderFxData *fxd = (LightShaderFxData *)md; - if (fxd->object != NULL) { - DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx"); - } - DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx"); + LightShaderFxData *fxd = (LightShaderFxData *)md; + if (fxd->object != NULL) { + DEG_add_object_relation(ctx->node, fxd->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx"); + } + DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Light ShaderFx"); } static bool isDisabled(ShaderFxData *fx, int UNUSED(userRenderParams)) { - LightShaderFxData *fxd = (LightShaderFxData *)fx; + LightShaderFxData *fxd = (LightShaderFxData *)fx; - return !fxd->object; + return !fxd->object; } -static void foreachObjectLink( - ShaderFxData *fx, Object *ob, - ShaderFxObjectWalkFunc walk, void *userData) +static void foreachObjectLink(ShaderFxData *fx, + Object *ob, + ShaderFxObjectWalkFunc walk, + void *userData) { - LightShaderFxData *fxd = (LightShaderFxData *)fx; + LightShaderFxData *fxd = (LightShaderFxData *)fx; - walk(userData, ob, &fxd->object, IDWALK_CB_NOP); + walk(userData, ob, &fxd->object, IDWALK_CB_NOP); } ShaderFxTypeInfo shaderfx_Type_Light = { - /* name */ "Light", - /* structName */ "LightShaderFxData", - /* structSize */ sizeof(LightShaderFxData), - /* type */ eShaderFxType_GpencilType, - /* flags */ 0, - - /* copyData */ copyData, - - /* initData */ initData, - /* freeData */ NULL, - /* isDisabled */ isDisabled, - /* updateDepsgraph */ updateDepsgraph, - /* dependsOnTime */ NULL, - /* foreachObjectLink */ foreachObjectLink, - /* foreachIDLink */ NULL, + /* name */ "Light", + /* structName */ "LightShaderFxData", + /* structSize */ sizeof(LightShaderFxData), + /* type */ eShaderFxType_GpencilType, + /* flags */ 0, + + /* copyData */ copyData, + + /* initData */ initData, + /* freeData */ NULL, + /* isDisabled */ isDisabled, + /* updateDepsgraph */ updateDepsgraph, + /* dependsOnTime */ NULL, + /* foreachObjectLink */ foreachObjectLink, + /* foreachIDLink */ NULL, }; |