10 #ifndef __VOP_SubnetScript_h__
11 #define __VOP_SubnetScript_h__
16 class VOP_SubnetHelper;
37 bool check_shader_context)
const override;
62 int index)
const override;
64 bool isConnected(
int inputidx,
bool recursive)
override;
67 bool create_if_needed=
false)
override;
81 void deleteArraysForLoadedInputAndOutputNames();
88 bool is_child_call=
false)
override;
93 int explicitly=1)
override;
129 void handleChildAdd(
OP_Node *child );
130 void handleChildDelete(
OP_Node *child );
131 void handleDescendentAdd(
VOP_Node *descendent );
132 void handleDescendentDelete(
VOP_Node *descendent );
133 static void handleParmNodeChange(
OP_Node *caller,
void *callee,
135 void updateConnectorDefiner(
VOP_Node *node);
142 void setupConnectorDefinersAfterLoadIfNeeded(
144 void setupConnectorDefinersAfterLoad(
152 int verifyOpInputIndexForNode(
int idx)
const;
169 int out_idx,
VOP_Type shader_type)
override;
171 int out_idx,
VOP_Type shader_type)
override;
175 int subnet_output_idx)
const override;
184 .requiresUpdate(0.0))
194 {
return myIsUsingCachedCode; }
197 virtual void loadMaterialInfo();
198 virtual void unloadMaterialInfo();
202 struct vop_EncapsulatedMetaData
204 vop_EncapsulatedMetaData() : myIsValid(false) {}
211 vop_EncapsulatedMetaData &md);
213 vop_EncapsulatedMetaData &md);
215 void adjustChildrenForInputRemoval(
int idx);
216 void adjustChildrenForInputInsertion(
int idx);
223 friend class SubnetAPI;
226 VOP_SubnetHelper *mySubnetHelper;
235 bool myIsUsingCachedCode;
239 bool myIsDeletingSubnetNodes;
242 unsigned myIsSettingUpConnectorDefinersAfterLoad : 1,
243 myIsLoadingNetwork : 1,
244 myAreConnectorsSetUp : 1;
Reprsents a language for which VOPs can generate source code.
virtual void endLoadingInNetwork()
void ensureSpareParmsAreUpdatedSubclass() override
virtual void dirtyShaderList()
Some material vops cache a list of shader that needs to be dirtied.
virtual void shaderParmGrandChildChanged(VOP_Node *grand_child)
virtual unsigned maxInputs() const
Maximum inputs that can be connected to a node.
static const char * theChildTableName
void getOuterCode(UT_String &codestr, const VOP_CodeGenContext &context) override
virtual void setupConnectorsAfterLoad()
virtual unsigned getNumVisibleInputs() const
virtual VOP_ParmGeneratorMap * getSubnetVariables()
void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx) override
virtual bool getIsOutputDefinedByParmChild(int idx) const
virtual bool getIsInputDefinedByParmChild(int idx) const
void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx) override
void updateOwnerSpareParmLayout(bool allow_update_while_loading=false)
Update the owner network's spare parameter layout.
virtual unsigned getNumVisibleOutputs() const
virtual UT_StringArray * getArrayForLoadedOutputNames()
virtual bool generateErrorsSubclass()
void finishedLoadingNetwork(bool is_child_call=false) override
virtual OP_OperatorFilter * getOperatorFilter()
constexpr auto in(type t, int set) -> bool
virtual bool isConnected(int inputidx, bool recursive)
void changeParmTemplate(PRM_Template *new_template) override
virtual void handleOTLIndexFileCleared()
const char * outputLabel(OP_OutputIdx idx) const override
virtual void getSubnetOutputTerminalChild(VOP_Node *&output_vop, int &input_idx, int subnet_output_idx) const
void getInputNameSubclass(UT_String &in, int idx) const override
GLint GLint GLsizei GLint GLenum GLenum type
virtual void unmatchOTLDefinition()
Unmatches (unlocks) the node from the current HDA definition.
bool runCreateScript() override
virtual UT_IntArray getShaderLayerExportsInputsToCopy(int out_idx, VOP_Type shader_type)
virtual bool canDefineShader() const
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *op)
bool isUsingCachedCode() const
DEP_MicroNode & eventMicroNode(OP_EventType e)
virtual void shaderParmGrandChildAdded(VOP_Node *grand_child)
virtual int getNumSubnetInputsForChildren() const
virtual VOP_ExportedParmsManager * getVopExportedParmsManager(bool create_if_needed=false)
GLuint const GLchar * name
virtual void getVopFunctionArgInfos(UT_Array< VOP_FunctionArgInfo > &arg_infos)
void getOutputNameSubclass(UT_String &out, int idx) const override
bool getParmConstantString(const char *parmname, const VOP_TypeInfo &type_info, UT_String &str, bool expand_string, const VOP_Language *language=nullptr) override
Get the constant code that encodes the value of the node parameter.
bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &context, bool check_shader_context) const override
virtual void matchOTLDefinition()
virtual UT_StringArray * getArrayForLoadedInputNames()
int getInputFromNameSubclass(const UT_String &in) const override
virtual void beginLoadingInNetwork()
Called upon entering and exiting loadNetwork() method.
virtual void addNode(OP_Node *node, int notify=1, int explicitly=1)
void ensureParametersAreValid() override
void getModulesToImport(UT_StringArray &modules, const VOP_CodeGenContext &context) override
If the node generates a shader call, get the modules names to import.
void getCode(UT_String &codestr, const VOP_CodeGenContext &context) override
Get the code fragment to be included in the shader code.
VOP_Type
Enumeration of the built-in (basic) VOP data types.
virtual bool isOperatorAllowedInTabMenu(OP_Operator *op)
Returns true if the given op can show up in the Tab menu.
const char * inputLabel(OP_InputIdx idx) const override
virtual void getExtraTypesToDefine(UT_Array< VOP_TypeInfo > &types)
virtual void findAllShaders(VOP_NodeList &shader_nodes, VOP_ShaderTypeList &shader_types, UT_StringArray &output_names)
virtual bool hasCorrespondingInput(int output_idx) const
Returns true if output of a given index has an input by the same name.
virtual int getSubnetInputIndexForChildren(int child_input) const
GLsizei GLenum GLenum * types
virtual bool translatesDirectlyToUSD() const
virtual void shaderParmGrandChildDeleted(VOP_Node *grand_child)
void opChanged(OP_EventType reason, void *data=nullptr) override
virtual int getNumNodeDefinedOutputs() const
virtual UT_StringHolder getShaderLayerExportsToAdd(int out_idx, VOP_Type shader_type)
virtual void postOpChanged(OP_EventType, void *)