00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __OBJ_BlendSticky__
00021 #define __OBJ_BlendSticky__
00022
00023 #include "OBJ_API.h"
00024 #include "OBJ_StickyShared.h"
00025
00026 enum OBJ_StickyBlendIndex
00027 {
00028 I_STICKYBLENDWEIGHTS = I_N_STICKYSHARED_INDICES,
00029
00030 I_N_STICKYBLEND_INDICES
00031 };
00032
00033 class OBJ_API OBJ_BlendSticky : public OBJ_StickyShared
00034 {
00035 public:
00036 OBJ_BlendSticky(OP_Network *net, const char *name,
00037 OP_Operator *op);
00038
00039 ~OBJ_BlendSticky() {}
00040
00041 static OP_Node *myConstructor(OP_Network *net,
00042 const char *name,
00043 OP_Operator *entry);
00044
00045 static PRM_Template *getTemplateList();
00046
00047 virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
00048 unsigned output_idx = 0);
00049 virtual OP_ERROR setInputReference(unsigned idx, const char *label,
00050 int keeppos,
00051 unsigned output_idx = 0);
00052 virtual OP_ERROR setIndirectInput(unsigned idx,
00053 OP_InputIndirect *in);
00054
00055 virtual void get2DWorldTransform(UT_DMatrix4 &mat,
00056 OP_Context &context);
00057
00058 virtual void STICKYGEOPATH(UT_String &str, float t);
00059 virtual void STICKYUV(UT_Vector2 &uv, float t);
00060 virtual float STICKYROT(float t);
00061 int NBLENDS()
00062 {
00063 return evalInt("weights", 0, 0);
00064 }
00065 void setNBLENDS(int n)
00066 {
00067 setInt("weights", 0, 0, n);
00068 }
00069 float BLENDWEIGHT(int i, float t)
00070 {
00071 if( nInputs() <= i )
00072 return 0;
00073 else
00074 return evalFloatInst("blend#", &i, 0, t);
00075 }
00076 int BLENDMASK(int i)
00077 {
00078 if( nInputs() <= i )
00079 return 0;
00080 else
00081 return evalIntInst("mask#", &i, 0, 0);
00082 }
00083
00084 protected:
00085 virtual int *getIndirect() const
00086 { return stickyIndirect; }
00087 OP_ERROR cookMyObj(OP_Context &context);
00088
00089 bool verifyParentGeopaths();
00090 void verifyNumInputs();
00091 virtual void createInputDependencies(float t);
00092 virtual OP_ERROR lockStickyInputs(OP_Context& context);
00093 virtual void unlockStickyInputs(OP_Context &context);
00094
00095 static int *stickyIndirect;
00096
00097 };
00098
00099 #endif
00100