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 
31  ~OBJ_BlendSticky() override {}
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  OP_ERROR setInput(unsigned idx, OP_Node *op,
40  unsigned output_idx = 0) override;
41  OP_ERROR setInputReference(unsigned idx, const char *label,
42  int keeppos,
43  unsigned output_idx = 0) override;
44  OP_ERROR setIndirectInput(unsigned idx,
45  OP_IndirectInput *in) override;
46 
48  const OP_ConnectorId &input_name,
49  OP_Node *op,
50  const OP_ConnectorId *output_name = nullptr
51  ) override;
53  const OP_ConnectorId &input_name,
54  OP_IndirectInput *input) override;
56  const OP_ConnectorId &input_name,
57  const char *label,
58  int,
59  const OP_ConnectorId *output_name = nullptr
60  ) override;
61 
63  OP_Context &context) override;
64 
65  void STICKYGEOPATH(UT_String &str, fpreal t) override;
66  void STICKYUV(UT_Vector2R &uv, fpreal t) override;
67  fpreal STICKYROT(fpreal t) override;
68  int NBLENDS()
69  {
70  return evalInt("weights", 0, 0);
71  }
72  void setNBLENDS(int n)
73  {
74  setInt("weights", 0, 0, n);
75  }
76  fpreal BLENDWEIGHT(int i, fpreal t) const
77  {
78  if( nInputs() <= i )
79  return 0;
80  else
81  return evalFloatInst("blend#", &i, 0, t);
82  }
83  int BLENDMASK(int i)
84  {
85  if( nInputs() <= i )
86  return 0;
87  else
88  return evalIntInst("mask#", &i, 0, 0);
89  }
90 
91  void getParallelInputs(
92  OP_Context &context,
93  OP_NodeList &nodes) const override;
94 
95 protected:
96  int *getIndirect() const override
97  { return stickyIndirect; }
98  OP_ERROR cookMyObj(OP_Context &context) override;
99 
100  bool verifyParentGeopaths();
101  void verifyNumInputs();
102  void createInputDependencies(fpreal t) override;
103  OP_ERROR lockStickyInputs(OP_Context& context) override;
104  void unlockStickyInputs(OP_Context &context) override;
105 
106  static int *stickyIndirect;
107 
108 };
109 
110 #endif
111 
static int * stickyIndirect
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
virtual fpreal STICKYROT(fpreal t)
OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=NULL) override
static PRM_Template * getTemplateList()
GA_API const UT_StringHolder uv
OP_ERROR setIndirectInput(unsigned idx, OP_IndirectInput *in) override
Connects an input to an indirect input of our parent subnet.
OBJ_StickyBlendIndex
virtual void STICKYGEOPATH(UT_String &str, fpreal t)
UT_ErrorSeverity
Definition: UT_Error.h:25
OP_ERROR cookMyObj(OP_Context &context) override
int BLENDMASK(int i)
virtual unsigned nInputs() const
GLdouble n
Definition: glcorearb.h:2008
virtual OP_ERROR lockStickyInputs(OP_Context &context)
int * getIndirect() const override
virtual void STICKYUV(UT_Vector2R &uv, fpreal t)
virtual void createInputDependencies(fpreal t)
~OBJ_BlendSticky() override
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.
bool get2DWorldTransform(UT_DMatrix4 &mat, OP_Context &context) override
fpreal evalFloatInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const override
fpreal BLENDWEIGHT(int i, fpreal t) const
fpreal64 fpreal
Definition: SYS_Types.h:277
void setInt(int parmi, int vectori, fpreal t, exint value)
void setNBLENDS(int n)
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.
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.
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 void unlockStickyInputs(OP_Context &context)
OP_ERROR setNamedIndirectInput(const OP_ConnectorId &input_name, OP_IndirectInput *input) override
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)