diff --git a/.gitignore b/.gitignore index b8bd026..d96199b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Debug files +Win/TestResults/ +Win/x64/ +Win/Skeleton.sdf + # Compiled Object files *.slo *.lo diff --git a/Skeleton.cpp b/Skeleton.cpp new file mode 100644 index 0000000..a33c40a --- /dev/null +++ b/Skeleton.cpp @@ -0,0 +1,478 @@ +#include "Skeleton.h" + +static PF_Err +About ( + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output ) +{ + AEGP_SuiteHandler suites(in_data->pica_basicP); + + suites.ANSICallbacksSuite1()->sprintf( out_data->return_msg, + "%s v%d.%d\r%s", + STR(StrID_Name), + MAJOR_VERSION, + MINOR_VERSION, + STR(StrID_Description)); + return PF_Err_NONE; +} + +static PF_Err +GlobalSetup ( + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output ) +{ + PF_Err err = PF_Err_NONE; + PF_Handle globH = NULL; + my_global_dataP globP = NULL; + + AEGP_SuiteHandler suites(in_data->pica_basicP); + out_data->my_version = PF_VERSION( MAJOR_VERSION, + MINOR_VERSION, + BUG_VERSION, + STAGE_VERSION, + BUILD_VERSION); + + out_data->out_flags = PF_OutFlag_DEEP_COLOR_AWARE; // just 16bpc, not 32bpc + + globH = suites.HandleSuite1()->host_new_handle(sizeof(my_global_data)); + globH = suites.HandleSuite1()->host_new_handle(sizeof(my_global_data)); + + if (globH) { + globP = reinterpret_cast(suites.HandleSuite1()->host_lock_handle(globH)); + if (globP) { + globP->initializedB = TRUE; + + if (in_data->appl_id != 'PrMr') { + ERR(suites.UtilitySuite3()->AEGP_RegisterWithAEGP(NULL, STR(StrID_Name), &globP->my_id)); + } + if (!err){ + out_data->global_data = globH; + } + } + suites.HandleSuite1()->host_unlock_handle(globH); + } else { + err = PF_Err_INTERNAL_STRUCT_DAMAGED; + } + + return err; +} + +static PF_Err +ParamsSetup ( + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output ) +{ + PF_Err err = PF_Err_NONE; + PF_ParamDef def; + + AEFX_CLR_STRUCT(def); + def.param_type = PF_Param_PATH; + def.uu.id = SKELETON_Flood_Seed_DISK_ID; + PF_STRCPY(def.name, STR(StrID_Flood_Seed_Param_Name)); + def.u.path_d.dephault = 0; + PF_ADD_PARAM(in_data, -1, &def); + AEFX_CLR_STRUCT(def); + PF_ADD_255_SLIDER(STR(StrID_BG_Param_Name),128,SKELETON_BG_DISK_ID); + AEFX_CLR_STRUCT(def); + PF_ADD_BUTTON(STR(StrID_Set_Mask_Param_Name),"Reset Mask currently",0,PF_ParamFlag_SUPERVISE,SKELETON_Set_Mask_DISK_ID); + AEFX_CLR_STRUCT(def); + + + out_data->num_params = SKELETON_NUM_PARAMS; + return err; +} + + + +PF_Pixel8 *samplePos(PF_EffectWorld &def, int x, int y){ + return (PF_Pixel8*)((char*)def.data +(y * def.rowbytes) +(x * sizeof(PF_Pixel8))); +} + +boolean IsPosValid(int x,int y ,int xL,int yL){ + if(x>=0&&x=0&&yred*38 + old_color->green*75 + old_color->blue*15) >> 7; + if(old_color->alpha !=0&&IsBlack(gray,threshold,type)){ //ɾ³ý´Ë´¦alphaµÄÌõ¼þÊÇ:alpha²»Îª0ÇһҶȵÍÓÚ·§Öµ + if (isDel == 1) + old_color->alpha =0; + return true; + }else{ + return false; + } + }else{ + return false; + } + +} + +link stack = 0; + +void push(int xx, int yy) { + link new_node; + new_node = (stack_list * ) malloc(sizeof(stack_list)); + new_node ->x = xx; + new_node ->y = yy; + new_node ->next = stack; + stack = new_node; +} + +//pop an element +void pop(int & xx, int & yy) { + link top; + top = stack; + xx = stack -> x; + yy = stack -> y; + stack = stack -> next; + free(top); +} + + +//fill the plot +void fill(PF_EffectWorld &def,int x,int y,int threshold) { + int x0, y0, xl, xr, xlold, xrold; /*x0,y0ÓÃÀ´±ê¼Çx,yµÄÖµ,xl¼Ç¼xµÄ×î×óÖµ,xr¼Ç¼xµÄ×îÓÒÖµ*/ + int go = 0, go2 = 0; + int xL = def.width; + int yL = def.height; + int i = 0; + int type = 0; + PF_Pixel8 *old_color = samplePos(def,x,y); + int gray = (old_color->red*38 + old_color->green*75 + old_color->blue*15) >> 7; + if(gray>threshold) type=0; + else type=1; + push(x, y); //ÖÖ×ÓÏñËØÈëÕ» + while (stack != 0) //Èç¹ûÕ»²»¿ÕÔòÑ­»·£¬stack==0±íʾջ¿Õ + { + go = 0; //go Ö»ÊÇÒ»¸ö±ê¼Ç + pop(x, y); + IsColorWaitToDel(def,x,y,xL,yL,1,threshold,type); + x0 = x + 1; + while (IsColorWaitToDel(def,x0,y,xL,yL,1,threshold,type)) //fill right Ìî³äÓÒ±ß + { + x0 = x0 + 1; + } + xr = x0 - 1; //¼Ç¼×îÓÒÖµ + xrold = xr; //ÔټǼһ´Î×îÓÒÖµ£¬ÒÔ±¸ºóÓà + x0 = x - 1; + while (IsColorWaitToDel(def,x0,y,xL,yL,1,threshold,type)) //fill right Ìî³ä×ó±ß + { + x0 = x0 - 1; + } + xl = x0 + 1; //¼Ç¼×î×óÖµ + xlold = xl; //ÔټǼһ´Î×î×óÖµ£¬ÒÔ±¸ºóÓà + y0 = y + 1; //go up ÏòÉÏÒÆÒ»ÌõɨÃèÏß + go2 = 0; //go2 Ò²Ö»ÊÇÒ»¸öÓÃÀ´±ê¼ÇµÄ±äÁ¿ + while (xr > xl && go == 0) //²éÕÒÉÏÒ»ÌõÏßµÄ×îÓÒÖµ,²¢¼Ç¼Ϊxr + { + if (!IsColorWaitToDel(def,xr,y0,xL,yL,0,threshold,type)) { + xr = xr - 1; + } else { + go = 1; //Èôgo=1Õâ¾äÖ´ÐеĻ°¾Í˵Ã÷ÕÒµ½ÁË×îÓÒÖµ£¬²¢ÔÚwhileÖеÄgo==0ÖÐÅжϲ¢Í˳öwhile + } + } + while (xl < xr && go2 == 0) //²éÕÒÉÏÒ»ÌõÏßµÄ×î×óÖµ£¬²¢¼Ç¼Ϊxl + { + if (!IsColorWaitToDel(def,xl,y0,xL,yL,0,threshold,type)) + xl = xl + 1; + else + go2 = 1; //go2=1Õâ¾äÖ´ÐоÍ˵Ã÷ÕÒµ½ÁË×î×óÖµ£¬²¢ÔÚ´ËwhileÖеÄgo2==0ÖÐÍ˳öwhile + } + if (go == 1 && go2 == 1) //Èç¹ûÕÒµ½ÁË×î×óÖµ¸÷×îÓÒÖµ£¬ÔòÖ´ÐÐÏÂÃæµÄÓï¾ä + { + //OutputDebugString("Down 1"); + push(xr, y0); //ÏȽ«ÉÏÒ»ÌõÏßÉϵÄ×îÓÒµã×÷ΪÖÖ×ÓµãÈëÕ» + for (i = xl; i < xr; i++) //´Ó×î×óµ½×îÓÒÑ­»·£¬ÔÚÿ¸öÁ¬ÐøÇø¼äÉÏÕÒÒ»¸öÖÖ×ÓµãÈëÕ» + { + if (IsColorWaitToDel(def,i,y0,xL,yL,0,threshold,type)) //Èç¹û²»ÊDZ߽çµã£¬Ê²Ã´Ò²²»×ö + {} else if (IsColorWaitToDel(def,i-1,y0,xL,yL,0,threshold,type)) //Èç¹ûÊDZ߽çµã£¬Ôò¿´Ëü×ó±ßµÄµãÊDz»ÊDZ߽çµã£¬Èç¹û²»ÊÇ£¬ÔòÈëÕ» + { + push(i - 1, y0); + } + } + + } + + y0 = y - 1; //go down;//ÏòÏÂÒÆÒ»ÌõɨÃèÏß + go = 0; + go2 = 0; + xl = xlold; //»¹Ô­×î×ó£¬×îÓÒ + xr = xrold; + + while (xr > xl && go == 0) //ÕÒÏÂÒ»ÌõÏßµÄ×îÓÒ + { + if (IsColorWaitToDel(def,xr,y0,xL,yL,0,threshold,type)) { + go = 1; + } else { + xr--; + } + + } + while (xl < xr && go2 == 0) //ÕÒÏÂÒ»ÌõÏßµÄ×î×ó + { + if (IsColorWaitToDel(def,xl,y0,xL,yL,0,threshold,type)) + go2 = 1; + else + xl++; + } + if (go == 1 && go2 == 1) //Èç¹ûÕÒµ½×î×óºÍ×îÓÒ£¬ÔòÖ´ÐÐ + { + push(xr, y0); + for (i = xl; i <= xr; i++) { + if (IsColorWaitToDel(def,i,y0,xL,yL,0,threshold,type)) {} else if (IsColorWaitToDel(def,i-1,y0,xL,yL,0,threshold,type) != 4) { + push(i - 1, y0); + } + } + } + } +} + + +static PF_Err +UserChangedParam( + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *outputP, + const PF_UserChangedParamExtra *which_hitP) +{ + PF_Err err = PF_Err_NONE; + my_global_dataP globP = reinterpret_cast(DH(out_data->global_data)); + AEGP_SuiteHandler suites(in_data->pica_basicP); + if (which_hitP->param_index == SKELETON_Set_Mask) + { + + PF_MaskSuite1 *msP = NULL; + PF_EffectWorld *inputP = ¶ms[0]->u.ld; + PF_EffectWorld *outputPP = outputP; + PF_PathOutlinePtr maskP = 0; + A_long mask_idL = params[SKELETON_Flood_Seed]->u.path_d.path_id; + PF_ProgPtr progPtr =in_data->effect_ref; + A_long fxIndex; //based on 0; + + ERR(AEFX_AcquireSuite(in_data, + out_data, + kPF_MaskSuite, + kPF_MaskSuiteVersion1, + 0, + reinterpret_cast(&msP))); + + ERR(suites.PathQuerySuite1()->PF_CheckoutPath( in_data->effect_ref, + mask_idL, + in_data->current_time, + in_data->time_step, + in_data->time_scale, + &maskP)); + if(maskP!=0&&mask_idL){ + AEGP_EffectRefH effectRef =NULL; + AEGP_StreamRefH streamA =NULL; + AEGP_StreamRefH parentStream =NULL; + AEGP_LayerIDVal layer_id; + A_long layer_index; + A_Time timeT = {0,1}; + AEGP_StreamValue2 value; + ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(globP->my_id,in_data->effect_ref,&effectRef)); + + ERR(suites.StreamSuite4()->AEGP_GetNewEffectStreamByIndex(globP->my_id, effectRef,1 , &streamA)); + ERR(suites.DynamicStreamSuite4()->AEGP_GetNewParentStreamRef( globP->my_id, streamA, &parentStream)); + ERR(suites.DynamicStreamSuite4()->AEGP_GetStreamIndexInParent( parentStream, &fxIndex)); + ERR(suites.StreamSuite4()->AEGP_GetNewStreamValue(globP->my_id, streamA, AEGP_LTimeMode_LayerTime, &timeT, TRUE, &value)); + layer_id = value.val.layer_id; + AEGP_LayerH effect_layer_handle = NULL; + ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectLayer(in_data->effect_ref, &effect_layer_handle)); + ERR(suites.LayerSuite8()->AEGP_GetLayerIndex(effect_layer_handle,&layer_index)); + + char buffer[700]; + sprintf_s(buffer,"var comp=app.project.activeItem;var first=%d+1,second=%d+1;v1x=v4x=v5x=-1;v1y=v2y=-1;v2x=v3x=comp.width+1;v3y=v4y=comp.height+1;v5y=0;",layer_index,fxIndex); + strcat_s(buffer,"var time = comp.time;\ +var prePropValue = comp.layer(first).property('ADBE Effect Parade')(second)(1).value;\ +var prop=comp.layer(first).property('ADBE Mask Parade')(prePropValue)('ADBE Mask Shape');\ +var thisValue = prop.valueAtTime(time,false);\ +thisValue.vertices= [[v1x-1,v1y-1],[v2x+1,v2y-1],[v3x+1,v3y+1],[v4x-1,v4y+1],[v5x-1,v5y]];\ +thisValue.inTangents=[[0,0],[0,0],[0,0],[0,0],[0,0]];\ +thisValue.outTangents=[[0,0],[0,0],[0,0],[0,0],[0,0]];\ +thisValue.closed = false;\ +prop.setValueAtTime (time,thisValue);"); + // OutputDebugString(buffer); + ERR(suites.UtilitySuite6()->AEGP_ExecuteScript(NULL,buffer,FALSE,NULL,NULL)); + ERR(suites.StreamSuite4()->AEGP_DisposeStreamValue(&value)); + if(parentStream) + ERR(suites.StreamSuite4()->AEGP_DisposeStream(parentStream)); + if(streamA) + ERR(suites.StreamSuite4()->AEGP_DisposeStream(streamA)); + if(effectRef) + ERR(suites.EffectSuite3()->AEGP_DisposeEffect(effectRef)); + } + ERR(suites.PathQuerySuite1()->PF_CheckinPath( in_data->effect_ref, + mask_idL, + FALSE, + maskP)); + if (msP){ + ERR(AEFX_ReleaseSuite(in_data, + out_data, + kPF_MaskSuite, + kPF_MaskSuiteVersion1, + 0)); + + } + } + + return err; +} + + +static PF_Err +Render ( + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *outputP ) +{ +PF_Err err = PF_Err_NONE; + + AEGP_SuiteHandler suites(in_data->pica_basicP); + + PF_EffectWorld *inputP = ¶ms[0]->u.ld; + PF_EffectWorld *outputPP = outputP; + + + A_long mask_idL = params[SKELETON_Flood_Seed]->u.path_d.path_id; + A_long threshold = params[SKELETON_BG]->u.sd.value; + A_long numPath = 0; + PF_PathOutlinePtr maskP = 0; + PF_PathVertex vertexP; + PF_MaskSuite1 *msP = NULL; + PF_Boolean openB = TRUE, + deepB = PF_WORLD_IS_DEEP(outputP); + A_long linesL = outputP->height; + + ERR(AEFX_AcquireSuite(in_data, + out_data, + kPF_MaskSuite, + kPF_MaskSuiteVersion1, + 0, + reinterpret_cast(&msP))); + + ERR(suites.WorldTransformSuite1()->copy(in_data->effect_ref,inputP,outputP,NULL,NULL)); + ERR(suites.PathQuerySuite1()->PF_CheckoutPath( in_data->effect_ref, + mask_idL, + in_data->current_time, + in_data->time_step, + in_data->time_scale, + &maskP)); + if (mask_idL&&maskP!=0){ + ERR(suites.PathDataSuite1()->PF_PathNumSegments(in_data->effect_ref, maskP,&numPath)); + A_long this_x,this_y; + for(int ii=0;ii<=numPath;ii++){ + ERR(suites.PathDataSuite1()->PF_PathVertexInfo( in_data->effect_ref, maskP,ii,&vertexP)); + this_x = (A_long)(vertexP.x+0.5); + this_y = (A_long)(vertexP.y+0.5); + if(IsPosValid(this_x,this_y,outputPP->width,outputPP->height)){ + fill(*outputPP,this_x,this_y,threshold); + } + } + + } + ERR(suites.PathQuerySuite1()->PF_CheckinPath( in_data->effect_ref, + mask_idL, + FALSE, + maskP)); + if (msP){ + ERR(AEFX_ReleaseSuite(in_data, + out_data, + kPF_MaskSuite, + kPF_MaskSuiteVersion1, + 0)); + } + return err; +} + + +DllExport +PF_Err +EntryPointFunc ( + PF_Cmd cmd, + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output, + void *extra) +{ + PF_Err err = PF_Err_NONE; + + try { + + switch (cmd) { + case PF_Cmd_ABOUT: + err = About(in_data, + out_data, + params, + output); + break; + + case PF_Cmd_GLOBAL_SETUP: + err = GlobalSetup( in_data, + out_data, + params, + output); + break; + + case PF_Cmd_PARAMS_SETUP: + err = ParamsSetup( in_data, + out_data, + params, + output); + break; + + case PF_Cmd_RENDER: + err = Render( in_data, + out_data, + params, + output); + break; + case PF_Cmd_USER_CHANGED_PARAM: + err = UserChangedParam( in_data, + out_data, + params, + output, + reinterpret_cast(extra)); + break; + } + } + catch(PF_Err &thrown_err){ + err = thrown_err; + } + return err; +} + diff --git a/Skeleton.h b/Skeleton.h new file mode 100644 index 0000000..e6afb99 --- /dev/null +++ b/Skeleton.h @@ -0,0 +1,131 @@ +/*******************************************************************/ +/* */ +/* ADOBE CONFIDENTIAL */ +/* _ _ _ _ _ _ _ _ _ _ _ _ _ */ +/* */ +/* Copyright 2007 Adobe Systems Incorporated */ +/* All Rights Reserved. */ +/* */ +/* NOTICE: All information contained herein is, and remains the */ +/* property of Adobe Systems Incorporated and its suppliers, if */ +/* any. The intellectual and technical concepts contained */ +/* herein are proprietary to Adobe Systems Incorporated and its */ +/* suppliers and may be covered by U.S. and Foreign Patents, */ +/* patents in process, and are protected by trade secret or */ +/* copyright law. Dissemination of this information or */ +/* reproduction of this material is strictly forbidden unless */ +/* prior written permission is obtained from Adobe Systems */ +/* Incorporated. */ +/* */ +/*******************************************************************/ + +/* + Skeleton.h +*/ + +#pragma once + +#ifndef SKELETON_H +#define SKELETON_H + +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned short u_int16; +typedef unsigned long u_long; +typedef short int int16; +#define PF_TABLE_BITS 12 +#define PF_TABLE_SZ_16 4096 + +#define PF_DEEP_COLOR_AWARE 1 // make sure we get 16bpc pixels; + // AE_Effect.h checks for this. + +#include "AEConfig.h" + +#ifdef AE_OS_WIN + typedef unsigned short PixelType; + #include +#endif + +#include "stdio.h" +#include "entry.h" +#include "AE_Effect.h" +#include "AE_EffectCB.h" +#include "AE_Macros.h" +#include "Param_Utils.h" +#include "AE_EffectCBSuites.h" +#include "String_Utils.h" +#include "AE_GeneralPlug.h" +#include "AEFX_ChannelDepthTpl.h" +#include "AEGP_SuiteHandler.h" +#include "AEFX_SuiteHelper.h" +#include "PF_Masks.h" +#include +#include + +#include "Skeleton_Strings.h" +#pragma comment(lib,"ws2_32.lib") +/* Versioning information */ + +#define MAJOR_VERSION 1 +#define MINOR_VERSION 0 +#define BUG_VERSION 0 +#define STAGE_VERSION PF_Stage_DEVELOP +#define BUILD_VERSION 1 +#define MaxSize 50 + +/* Parameter defaults */ + +#define SKELETON_SLIDER_MIN 0 +#define SKELETON_SLIDER_MAX 100 +#define SKELETON_SLIDER_DFLT 10 + +struct stack_node { + int x; + int y; + struct stack_node * next; +}; +typedef stack_node stack_list; +typedef stack_list * link; + +typedef struct { + PF_Boolean initializedB; + AEGP_PluginID my_id; +} my_global_data, *my_global_dataP, **my_global_dataH; + +enum { + SKELETON_INPUT = 0, + SKELETON_Flood_Seed, + SKELETON_BG, + SKELETON_Set_Mask, + SKELETON_NUM_PARAMS +}; + +enum { + SKELETON_View_Mode_DISK_ID = 1, + SKELETON_Flood_Seed_DISK_ID, + SKELETON_BG_DISK_ID, + SKELETON_Set_Mask_DISK_ID +}; + +typedef struct GainInfo{ + PF_FpLong gainF; +} GainInfo, *GainInfoP, **GainInfoH; + +#ifdef __cplusplus + extern "C" { +#endif + +DllExport PF_Err +EntryPointFunc( + PF_Cmd cmd, + PF_InData *in_data, + PF_OutData *out_data, + PF_ParamDef *params[], + PF_LayerDef *output, + void *extra) ; + +#ifdef __cplusplus +} +#endif + +#endif // SKELETON_H \ No newline at end of file diff --git a/SkeletonPiPL.r b/SkeletonPiPL.r new file mode 100644 index 0000000..feed96c --- /dev/null +++ b/SkeletonPiPL.r @@ -0,0 +1,71 @@ +#include "AEConfig.h" +#include "AE_EffectVers.h" + +#ifndef AE_OS_WIN + #include +#endif + +resource 'PiPL' (16000) { + { /* array properties: 12 elements */ + /* [1] */ + Kind { + AEEffect + }, + /* [2] */ + Name { + "Sp Mask Key" + }, + /* [3] */ + Category { + "Smallpath" + }, +#ifdef AE_OS_WIN + #ifdef AE_PROC_INTELx64 + CodeWin64X86 {"EntryPointFunc"}, + #else + CodeWin32X86 {"EntryPointFunc"}, + #endif +#else + #ifdef AE_OS_MAC + CodeMachOPowerPC {"EntryPointFunc"}, + CodeMacIntel32 {"EntryPointFunc"}, + CodeMacIntel64 {"EntryPointFunc"}, + #endif +#endif + /* [6] */ + AE_PiPL_Version { + 2, + 0 + }, + /* [7] */ + AE_Effect_Spec_Version { + PF_PLUG_IN_VERSION, + PF_PLUG_IN_SUBVERS + }, + /* [8] */ + AE_Effect_Version { + 524289 /* 1.0 */ + }, + /* [9] */ + AE_Effect_Info_Flags { + 0 + }, + /* [10] */ + AE_Effect_Global_OutFlags { + 0x02000000 //50332160 + + }, + AE_Effect_Global_OutFlags_2 { + 0x00000000 + }, + /* [11] */ + AE_Effect_Match_Name { + "ADBE Sp Key" + }, + /* [12] */ + AE_Reserved_Info { + 0 + } + } +}; + diff --git a/Skeleton_Strings.cpp b/Skeleton_Strings.cpp new file mode 100644 index 0000000..d012f91 --- /dev/null +++ b/Skeleton_Strings.cpp @@ -0,0 +1,45 @@ +/*******************************************************************/ +/* */ +/* ADOBE CONFIDENTIAL */ +/* _ _ _ _ _ _ _ _ _ _ _ _ _ */ +/* */ +/* Copyright 2007 Adobe Systems Incorporated */ +/* All Rights Reserved. */ +/* */ +/* NOTICE: All information contained herein is, and remains the */ +/* property of Adobe Systems Incorporated and its suppliers, if */ +/* any. The intellectual and technical concepts contained */ +/* herein are proprietary to Adobe Systems Incorporated and its */ +/* suppliers and may be covered by U.S. and Foreign Patents, */ +/* patents in process, and are protected by trade secret or */ +/* copyright law. Dissemination of this information or */ +/* reproduction of this material is strictly forbidden unless */ +/* prior written permission is obtained from Adobe Systems */ +/* Incorporated. */ +/* */ +/*******************************************************************/ + +#include "Skeleton.h" + +typedef struct { + A_u_long index; + A_char str[256]; +} TableString; + + + +TableString g_strs[StrID_NUMTYPES] = { + StrID_NONE, "", + StrID_Name, "Sp Mask Key v1.0", + StrID_Description, "My first plug-in.\r\rRemove pixels around every mask point,based on pixel threshold.\rFor your keying pleasure.\r\rCopyright 2015 Smallpath.", + StrID_Flood_Seed_Param_Name, "Mask", + StrID_BG_Param_Name, "BG Threshold", + StrID_Set_Mask_Param_Name, "", +}; + + +char *GetStringPtr(int strNum) +{ + return g_strs[strNum].str; +} + \ No newline at end of file diff --git a/Skeleton_Strings.h b/Skeleton_Strings.h new file mode 100644 index 0000000..e47d304 --- /dev/null +++ b/Skeleton_Strings.h @@ -0,0 +1,32 @@ +/*******************************************************************/ +/* */ +/* ADOBE CONFIDENTIAL */ +/* _ _ _ _ _ _ _ _ _ _ _ _ _ */ +/* */ +/* Copyright 2007 Adobe Systems Incorporated */ +/* All Rights Reserved. */ +/* */ +/* NOTICE: All information contained herein is, and remains the */ +/* property of Adobe Systems Incorporated and its suppliers, if */ +/* any. The intellectual and technical concepts contained */ +/* herein are proprietary to Adobe Systems Incorporated and its */ +/* suppliers and may be covered by U.S. and Foreign Patents, */ +/* patents in process, and are protected by trade secret or */ +/* copyright law. Dissemination of this information or */ +/* reproduction of this material is strictly forbidden unless */ +/* prior written permission is obtained from Adobe Systems */ +/* Incorporated. */ +/* */ +/*******************************************************************/ + +#pragma once + +typedef enum { + StrID_NONE, + StrID_Name, + StrID_Description, + StrID_Flood_Seed_Param_Name, + StrID_BG_Param_Name, + StrID_Set_Mask_Param_Name, + StrID_NUMTYPES +} StrIDType; diff --git a/Win/Skeleton.sln b/Win/Skeleton.sln new file mode 100644 index 0000000..4e6efb6 --- /dev/null +++ b/Win/Skeleton.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Skeleton", "Skeleton.vcxproj", "{2C8DED3E-111D-4272-A54A-F1865F02A90E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Debug|x64.ActiveCfg = Debug|x64 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Debug|x64.Build.0 = Debug|x64 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Debug|x86.ActiveCfg = Debug|Win32 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Debug|x86.Build.0 = Debug|Win32 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Release|x64.ActiveCfg = Release|x64 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Release|x64.Build.0 = Release|x64 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Release|x86.ActiveCfg = Release|Win32 + {2C8DED3E-111D-4272-A54A-F1865F02A90E}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Win/Skeleton.v11.suo b/Win/Skeleton.v11.suo new file mode 100644 index 0000000..4786fe6 Binary files /dev/null and b/Win/Skeleton.v11.suo differ diff --git a/Win/Skeleton.vcxproj b/Win/Skeleton.vcxproj new file mode 100644 index 0000000..e55c142 --- /dev/null +++ b/Win/Skeleton.vcxproj @@ -0,0 +1,385 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2C8DED3E-111D-4272-A54A-F1865F02A90E} + Skeleton + Sp_Mask_Key + + + + DynamicLibrary + false + v110 + + + DynamicLibrary + false + v110 + + + DynamicLibrary + false + v110 + + + DynamicLibrary + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + C:\Program Files\Adobe\Adobe After Effects CC 2014\Support Files\Plug-ins\ + $(AE_PLUGIN_BUILD_DIR)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(AE_PLUGIN_BUILD_DIR)\ + $(AE_PLUGIN_BUILD_DIR)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + .aex + .aex + .aex + .aex + + + $(ProjectName) + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/Skeleton.tlb + + + + + Disabled + ..\..\..\Headers;..\..\..\Headers\SP;..\..\..\Headers\Win;..\..\..\Resources;..\..\..\Util;%(AdditionalIncludeDirectories) + MSWindows;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + 4Bytes + true + + + AE_Effect.h + $(IntDir)$(TargetName).pch + NoListing + $(IntDir) + $(IntDir) + $(IntDir)vc$(PlatformToolsetVersion).pdb + true + Level3 + true + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + NotSet + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(IntDir)$(TargetName).pdb + + + false + + + $(IntDir)/$(TargetName).lib + MachineX64 + + + + + $(IntDir)$(TargetName).bsc + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/Skeleton.tlb + + + + + MaxSpeed + ..\..\..\Headers;..\..\..\Headers\SP;..\..\..\Headers\Win;..\..\..\Resources;..\..\..\Util;%(AdditionalIncludeDirectories) + MultiThreadedDLL + 4Bytes + true + + + AE_Effect.h + $(IntDir)$(TargetName).pch + NoListing + $(IntDir) + $(IntDir) + $(IntDir)vc$(PlatformToolsetVersion).pdb + true + Level3 + true + true + ProgramDatabase + Default + MSWindows;WIN32;_WINDOWS;%(PreprocessorDefinitions) + + + %(PreprocessorDefinitions) + 0x0409 + + + NotSet + $(OutDir)$(TargetName)$(TargetExt) + true + + + $(IntDir)$(TargetName).pdb + + + false + + + $(IntDir)/$(TargetName).lib + MachineX64 + + + $(IntDir)$(TargetName).bsc + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/Skeleton.tlb + + + + + Disabled + ..\..\..\Headers;..\..\..\Headers\SP;..\..\..\Headers\Win;..\..\..\Resources;..\..\..\Util;%(AdditionalIncludeDirectories) + MSWindows;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + 4Bytes + true + + + AE_Effect.h + $(IntDir)$(TargetName).pch + NoListing + $(IntDir) + $(IntDir) + $(IntDir)vc$(PlatformToolsetVersion).pdb + true + Level3 + true + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + NotSet + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(IntDir)$(TargetName).pdb + + + false + + + $(IntDir)/$(TargetName).lib + MachineX86 + + + $(IntDir)$(TargetName).bsc + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + .\Debug/Skeleton.tlb + + + + + MaxSpeed + ..\..\..\Headers;..\..\..\Headers\SP;..\..\..\Headers\Win;..\..\..\Resources;..\..\..\Util;%(AdditionalIncludeDirectories) + MultiThreadedDLL + 4Bytes + true + + + AE_Effect.h + $(IntDir)$(TargetName).pch + NoListing + $(IntDir) + $(IntDir) + $(IntDir)vc$(PlatformToolsetVersion).pdb + true + Level3 + true + true + ProgramDatabase + Default + MSWindows;WIN32;_WINDOWS;%(PreprocessorDefinitions) + + + %(PreprocessorDefinitions) + 0x0409 + + + NotSet + $(OutDir)$(TargetName)$(TargetExt) + true + + + $(IntDir)$(TargetName).pdb + + + false + + + $(IntDir)/$(TargetName).lib + MachineX86 + + + $(IntDir)$(TargetName).bsc + + + + + Compiling the PiPL + Compiling the PiPL + cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" +"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" +cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc + + cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" +"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" +cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc + + $(ProjectDir)%(Filename).rc;%(Outputs) + $(ProjectDir)%(Filename).rc;%(Outputs) + Compiling the PiPL + Compiling the PiPL + cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" +"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" +cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc + + cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr" +"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc" +cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc + + $(ProjectDir)%(Filename).rc;%(Outputs) + $(ProjectDir)%(Filename).rc;%(Outputs) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Win/Skeleton.vcxproj.filters b/Win/Skeleton.vcxproj.filters new file mode 100644 index 0000000..d93c672 --- /dev/null +++ b/Win/Skeleton.vcxproj.filters @@ -0,0 +1,106 @@ + + + + + {b69af876-1d29-49fa-9917-fd2efa165225} + ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe + + + {e1cf207c-552f-4fd4-96ed-76ccc9ebdf72} + + + {728b7ff5-0e0a-45d2-999a-696b548f9a28} + + + {f2f05dcb-eed5-4aa5-b2d0-504449ce3cf4} + + + + + Resources + + + + + Headers + + + Headers + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + Headers\AE + + + + + Supporting code + + + Supporting code + + + + + Headers\AE + + + + + Resources + + + \ No newline at end of file diff --git a/Win/Skeleton.vcxproj.user b/Win/Skeleton.vcxproj.user new file mode 100644 index 0000000..8e83ff1 --- /dev/null +++ b/Win/Skeleton.vcxproj.user @@ -0,0 +1,8 @@ + + + + C:\Program Files\Adobe\Adobe After Effects CC 2014\Support Files\AfterFX.exe + WindowsLocalDebugger + -debug + + \ No newline at end of file diff --git a/Win/SkeletonPiPL.aps b/Win/SkeletonPiPL.aps new file mode 100644 index 0000000..df82c60 Binary files /dev/null and b/Win/SkeletonPiPL.aps differ diff --git a/Win/SkeletonPiPL.rc b/Win/SkeletonPiPL.rc new file mode 100644 index 0000000..66967b9 --- /dev/null +++ b/Win/SkeletonPiPL.rc @@ -0,0 +1,84 @@ + + + + +16000 PiPL DISCARDABLE +BEGIN + 0x0001, + 0, 0x0, + 12, 0x0, + "MIB8", + "dnik", + 0, 0x0, + 4, 0x0, + "TKFe", + + "MIB8", + "eman", + 0, 0x0, + 12, 0x0, + "\x0BSp Mask Key", + + "MIB8", + "gtac", + 0, 0x0, + 12, 0x0, + "\x09Smallpath\0\0", + + "MIB8", + "4668", + 0, 0x0, + 16, 0x0, + "EntryPointFunc\0\0", + + "MIB8", + "RVPe", + 0, 0x0, + 4, 0x0, + 2, 0, + + "MIB8", + "RVSe", + 0, 0x0, + 4, 0x0, + 13, 4, + + "MIB8", + 0x65564552L, + 0L, + 4L + 524289L, + + "MIB8", + 0x65494E46L, + 0L, + 2L + 0L, + + "MIB8", + "OLGe", + 0L, + 4L, + 33554432L, + + "MIB8", + "2LGe", + 0L, + 4L, + 0L, + + "MIB8", + "ANMe", + 0, 0x0, + 12, 0x0, + "\x0BADBE Sp Key", + + "MIB8", + 0x6165464CL, + 0L, + 4L + 0L, + + +END +