00001 /* 00002 * Copyright (c) 2012 00003 * Side Effects Software Inc. All rights reserved. 00004 * 00005 * Redistribution and use of Houdini Development Kit samples in source and 00006 * binary forms, with or without modification, are permitted provided that the 00007 * following conditions are met: 00008 * 1. Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 2. The name of Side Effects Software may not be used to endorse or 00011 * promote products derived from this software without specific prior 00012 * written permission. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS 00015 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00017 * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00019 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00020 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00021 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00022 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00023 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 * 00025 *---------------------------------------------------------------------------- 00026 * Blends inputs 2,3,4... using the weights in input 1. 00027 */ 00028 00029 #ifndef __CHOP_Blend__ 00030 #define __CHOP_Blend__ 00031 00032 #include <CHOP/CHOP_Node.h> 00033 00034 #define ARG_BLEND_DIFFERENCE (myParmBase +0) 00035 #define ARG_BLEND_FIRST_WEIGHT (myParmBase +1) 00036 00037 namespace HDK_Sample { 00038 00039 class CHOP_Blend : public CHOP_Node 00040 { 00041 public: 00042 00043 00044 static OP_Node *myConstructor(OP_Network*, const char *, 00045 OP_Operator *); 00046 static OP_TemplatePair myTemplatePair; 00047 static OP_VariablePair myVariablePair; 00048 static PRM_Template myTemplateList[]; 00049 static CH_LocalVariable myVariableList[]; 00050 00051 OP_ERROR cookMyChop(OP_Context &context); 00052 virtual unsigned disableParms(); 00053 00054 protected: 00055 00056 CHOP_Blend(OP_Network *net, 00057 const char *name, 00058 OP_Operator *op); 00059 virtual ~CHOP_Blend(); 00060 00061 private: 00062 00063 int GETDIFFERENCE() 00064 { return evalInt(ARG_BLEND_DIFFERENCE,0,0); } 00065 00066 int FIRST_WEIGHT() 00067 { return evalInt(ARG_BLEND_FIRST_WEIGHT,0,0); } 00068 00069 int findFirstAvailableTracks(OP_Context &context); 00070 int findInputClips(OP_Context &context, const CL_Clip *blendclip); 00071 00072 const CL_Clip *getCacheInputClip(int j); 00073 00074 00075 UT_IntArray myAvailableTracks; 00076 UT_FloatArray myTotalArray; 00077 UT_PtrArray<const CL_Clip *> myInputClip; 00078 00079 }; 00080 00081 } // End HDK_Sample namespace 00082 00083 #endif 00084
1.5.9