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 
40  OP_OutputIdx output_idx = 0) override;
42  const char *label, int keeppos,
43  OP_OutputIdx output_idx = 0
44  ) override;
46  OP_IndirectInput *in) override;
47 
49  const OP_ConnectorId &input_name,
50  OP_Node *op,
51  const OP_ConnectorId *output_name = nullptr
52  ) override;
54  const OP_ConnectorId &input_name,
55  OP_IndirectInput *input) override;
57  const OP_ConnectorId &input_name,
58  const char *label,
59  int,
60  const OP_ConnectorId *output_name = nullptr
61  ) override;
62 
64  OP_Context &context) override;
65 
66  void STICKYGEOPATH(UT_String &str, fpreal t) override;
67  void STICKYUV(UT_Vector2R &uv, fpreal t) override;
68  fpreal STICKYROT(fpreal t) override;
69  int NBLENDS()
70  {
71  return evalInt("weights", 0, 0);
72  }
73  void setNBLENDS(int n)
74  {
75  setInt("weights", 0, 0, n);
76  }
77  fpreal BLENDWEIGHT(int i, fpreal t) const
78  {
79  if( nInputs() <= i )
80  return 0;
81  else
82  return evalFloatInst("blend#", &i, 0, t);
83  }
84  int BLENDMASK(int i)
85  {
86  if( nInputs() <= i )
87  return 0;
88  else
89  return evalIntInst("mask#", &i, 0, 0);
90  }
91 
92  void getParallelInputs(
93  OP_Context &context,
94  OP_NodeList &nodes) const override;
95 
96 protected:
97  int *getIndirect() const override
98  { return stickyIndirect; }
99  OP_ERROR cookMyObj(OP_Context &context) override;
100 
101  bool verifyParentGeopaths();
102  void verifyNumInputs();
103  void createInputDependencies(fpreal t) override;
104  OP_ERROR lockStickyInputs(OP_Context& context) override;
105  void unlockStickyInputs(OP_Context &context) override;
106 
107  static int *stickyIndirect;
108 
109 };
110 
111 #endif
112 
static int * stickyIndirect
OP_ERROR setInput(OP_InputIdx idx, OP_Node *op, OP_OutputIdx outputIdx=0) override
Sets a given input to connect to an output of a particular node.
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
int OP_InputIdx
Definition: OP_DataTypes.h:184
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)
OP_ERROR setIndirectInput(OP_InputIdx idx, OP_IndirectInput *in) override
Connects an input to an indirect input of our parent subnet.
constexpr auto in(type t, int set) -> bool
Definition: core.h:611
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
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
OP_ERROR setInputReference(OP_InputIdx idx, const char *label, int keeppos, OP_OutputIdx outputIdx=0) override
Connects an input to particular node by name in the network.
void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const override
fpreal BLENDWEIGHT(int i, fpreal t) const
fpreal64 fpreal
Definition: SYS_Types.h:278
void setInt(int parmi, int vectori, fpreal t, exint value)
int OP_OutputIdx
Definition: OP_DataTypes.h:185
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.
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)