HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_BlendSticky.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OBJ_BlendSticky.h (Custom Library, C++)
7  *
8  * COMMENTS: A sticky object that blends its UV transform from other objects.
9  *
10  */
11 
12 #ifndef __OBJ_BlendSticky__
13 #define __OBJ_BlendSticky__
14 
15 #include "OBJ_API.h"
16 #include "OBJ_StickyShared.h"
17 
19 {
21 
23 };
24 
26 {
27 public:
28  OBJ_BlendSticky(OP_Network *net, const char *name,
29  OP_Operator *op);
30 
32 
33  static OP_Node *myConstructor(OP_Network *net,
34  const char *name,
35  OP_Operator *entry);
36 
37  static PRM_Template *getTemplateList();
38 
39  virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
40  unsigned output_idx = 0);
41  virtual OP_ERROR setInputReference(unsigned idx, const char *label,
42  int keeppos,
43  unsigned output_idx = 0);
44  virtual OP_ERROR setIndirectInput(unsigned idx,
45  OP_IndirectInput *in);
46 
47  virtual OP_ERROR setNamedInput(const OP_ConnectorId& input_name, OP_Node *op,
48  const OP_ConnectorId* output_name = NULL);
49  virtual OP_ERROR setNamedIndirectInput(const OP_ConnectorId& input_name,
50  OP_IndirectInput *input);
51  virtual OP_ERROR setNamedInputReference(const OP_ConnectorId& input_name,
52  const char *label, int, const OP_ConnectorId* output_name = NULL);
53 
54  virtual bool get2DWorldTransform(UT_DMatrix4 &mat,
55  OP_Context &context);
56 
57  virtual void STICKYGEOPATH(UT_String &str, fpreal t);
58  virtual void STICKYUV(UT_Vector2R &uv, fpreal t);
59  virtual fpreal STICKYROT(fpreal t);
60  int NBLENDS()
61  {
62  return evalInt("weights", 0, 0);
63  }
64  void setNBLENDS(int n)
65  {
66  setInt("weights", 0, 0, n);
67  }
68  fpreal BLENDWEIGHT(int i, fpreal t) const
69  {
70  if( nInputs() <= i )
71  return 0;
72  else
73  return evalFloatInst("blend#", &i, 0, t);
74  }
75  int BLENDMASK(int i)
76  {
77  if( nInputs() <= i )
78  return 0;
79  else
80  return evalIntInst("mask#", &i, 0, 0);
81  }
82 
83  virtual void getParallelInputs(OP_Context &context,
84  OP_NodeList &nodes) const;
85 
86 protected:
87  virtual int *getIndirect() const
88  { return stickyIndirect; }
89  OP_ERROR cookMyObj(OP_Context &context);
90 
91  bool verifyParentGeopaths();
92  void verifyNumInputs();
93  virtual void createInputDependencies(fpreal t);
94  virtual OP_ERROR lockStickyInputs(OP_Context& context);
95  virtual void unlockStickyInputs(OP_Context &context);
96 
97  static int *stickyIndirect;
98 
99 };
100 
101 #endif
102 
static int * stickyIndirect
virtual OP_ERROR setInputReference(unsigned idx, const char *label, int keeppos, unsigned outputIdx=0) override
Connects an input to particular node by name in the network.
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
virtual fpreal STICKYROT(fpreal t)
static PRM_Template * getTemplateList()
virtual OP_ERROR setNamedIndirectInput(const OP_ConnectorId &input_name, OP_IndirectInput *input) override
GA_API const UT_StringHolder uv
OBJ_StickyBlendIndex
virtual void STICKYGEOPATH(UT_String &str, fpreal t)
UT_ErrorSeverity
Definition: UT_Error.h:25
int BLENDMASK(int i)
2D Vector class.
Definition: UT_Vector2.h:138
virtual OP_ERROR cookMyObj(OP_Context &context)
png_uint_32 i
Definition: png.h:2877
virtual unsigned nInputs() const
virtual bool get2DWorldTransform(UT_DMatrix4 &mat, OP_Context &context)
GLdouble n
Definition: glcorearb.h:2007
virtual OP_ERROR lockStickyInputs(OP_Context &context)
virtual void STICKYUV(UT_Vector2R &uv, fpreal t)
virtual OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=NULL) override
virtual void createInputDependencies(fpreal t)
fpreal evalFloatInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
virtual OP_ERROR setNamedInput(const OP_ConnectorId &input_name, OP_Node *op, const OP_ConnectorId *output_name=NULL) override
New input functions that use names instead of indices.
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:270
fpreal BLENDWEIGHT(int i, fpreal t) const
void setInt(int parmi, int vectori, fpreal t, exint value)
virtual void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const override
void setNBLENDS(int n)
exint evalInt(int pi, int vi, fpreal t) const
exint evalIntInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
#define OBJ_API
Definition: OBJ_API.h:10
virtual OP_ERROR setIndirectInput(unsigned idx, OP_IndirectInput *in) override
Connects an input to an indirect input of our parent subnet.
virtual int * getIndirect() const
virtual void unlockStickyInputs(OP_Context &context)
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
virtual OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0) override
Sets a given input to connect to an output of a particular node.