Jump to content

op_operatortable and networks

Recommended Posts

Hey. Question for anyone familiar with creating new networks and OP_OperatorTable objects.

I'm adding a new network node to DOPs. Following from as much as I could guess from the source headers, I have isNetwork() returning 1, isSubnetwork() returning 0, etc. So now it behaves like a network with DOPs functionality. That's most of what I want.

When this is all done, it's only going to make sense to use a certain subset of the available DOP nodes inside of this network. For that reason, I want to be able to limit both the node types that can be created inside the network and make the right-click op menu reflect that limited set of nodes. From my understanding, all of that is defined by the node's OP_OperatorTable. So, I've tried creating my own OP_OperatorTable, adding specific operator types to it with addOperator (the same way you install standard dso operators), then I apply that table with setOperatorTable inside the node's constructor method. No good: all dop operators are still available under the network, and any operators I add exclusively to my network's operator table are not available.

So, maybe I'm misunderstanding the Houdini architecture a little bit. Is what I'm trying to do here not possible through the HDK? Even if I can't remove some of the available dop nodes within my network, I'd at least like to be able to add a few nodes that can only be created within this specific network. Certainly there are plenty of cases in Houdini where that has been done (for instance, vop subnet in/out). But then again, all of those cases could have been hard-coded, and inaccessible to the HDK programmer.

I also thought that maybe Houdini is internally checking the network's operator type/typeId (getOpTypeID()/getOpType()) and looking up the correct operator table somewhere else using that id/name, so I've tried overriding all of those methods to point at some new kind of optype...again, with no luck, not even any 'invalid optype' warnings/errors. (we can't really create new operator types through the hdk anyway, though, right? Just new nodes for existing op types?).

Edited by Vormav
Link to comment
Share on other sites

An OP_OperatorTable defines an entire xOP context. I don't think you want to be redefining a new operator context. :)

On your DOP_Node subclass, override the virtual function OP_Network::getOperatorFilter() to return a pointer to an instance of your own OP_OperatorFilter subclass (see OP_Network.h). Your custom OP_OperatorFilter subclass should override allowOperatorAsChild() to return false if it wants to disallow the given operator type. This is typically done via a string comparison with OP_Operator::getName().

Link to comment
Share on other sites

Perfect. Thank you. I was able to filter just about everything as desired.

Well, the odd exception seems to be the ground plane. That's the only operator that for some reason doesn't even get passed through the op filter (i'm printing op names to stdout from within the filter. All ops except the ground plane make an appearance). Strange. But I think I can ignore that.

Link to comment
Share on other sites

Maybe it's version specific. I'm on H10.0.249.3 here. Running this filter method:

	virtual bool allowOperatorAsChild(OP_Operator* op)
		UT_String name = op->getName();
	std::cout << "Checking " << name << "\n";

I get the following:

Checking gasnetslicebalance
Checking switchvalue
Checking gascombustion
Checking gassphdensity
Checking pointcollider
Checking grouprel
Checking wireplasticity
Checking conrelationship
Checking gasparticlemovetoiso
Checking gasintermittentsolve
Checking gasanalysis
Checking applyrel
Checking gasseedmarkers
Checking smokeconfigureobject
Checking renderparms
Checking colliderel
Checking wireglueconstraint
Checking fluidforce
Checking gasresizefield
Checking emptydata
Checking clothphysparms
Checking matrixfield
Checking rbdpinconstraint
Checking mask
Checking wireangularspringconstraint
Checking sbdpinconstraint
Checking switchsolver
Checking pumprel
Checking dopnet
Checking ropnet
Checking merge
Checking sopscalarfield
Checking switch
Checking gasenforceboundary
Checking scalarfieldvisualization
Checking anchorobjpointnumrot
Checking gasdsdconfigureobject
Checking gaswavelets
Checking gasresizefluid
Checking sinkrel
Checking gasupres
Checking vopforce
Checking anchorobjpointnumpos
Checking gasparticleforces
Checking gascross
Checking anchorobjspacerot
Checking gasdsdsolver
Checking hardconrel
Checking gassurfacesnap
Checking rbdstate
Checking popobject
Checking anchorobjspacepos
Checking fetchdata
Checking copyobject
Checking linktosourceobject
Checking rippleobject
Checking rbdsolver
Checking wireconfigureobject
Checking gasvorticlegeometry
Checking gasadjustparticlecoordinates
Checking gasnetfetchdata
Checking gasstrainforces
Checking sbdspringconstraint
Checking indexfield
Checking gasvorticleforces
Checking gassubstep
Checking referenceframeforce
Checking sandobject
Checking staticsolver
Checking groupandapply
Checking gassurfacetension
Checking vopnet
Checking modifydata
Checking clothconfigureobject
Checking sliceplane
Checking group
Checking clothstitchgroup
Checking gasembedfluid
Checking thinplatecollider
Checking matrixfieldvisualization
Checking rop_dop
Checking container
Checking rigidbodysolver
Checking gasseedparticles
Checking file
Checking volumecollider
Checking vectorfieldvisualization
Checking clothstitchconstraint
Checking particlefluidemitter
Checking scalarfield
Checking activevalue
Checking rbdautofreeze
Checking vortexforce
Checking popnet
Checking gasfieldvop
Checking anchorworldspacerot
Checking physparms
Checking drag
Checking emptyrel
Checking affector
Checking subnet
Checking pyrosolver
Checking clothcollisionproperties
Checking anchorworldspacepos
Checking fluidobject
Checking twostateconrel
Checking windforce
Checking rbdangularconstraint
Checking indexfieldvisualization
Checking multisolver
Checking gasvorticlerecycle
Checking gasparticletosdf
Checking wirephysparms
Checking wireobject
Checking gasupresobject
Checking gravity
Checking clothobject
Checking popsolver
Checking gasmatchfield
Checking positioncomposite
Checking gascorrectbymarkers
Checking copysolver
Checking volume
Checking gasnetfieldborderexchange
Checking ripplesolver
Checking position
Checking springconrel
Checking rbdglueobject
Checking gasparticletofield
Checking sphereedgetree
Checking particlefluidobject
Checking gasextrapolate
Checking rbdspringconstraint
Checking gasburngeometry
Checking blendfactor
Checking pointforce
Checking clothstitchseams
Checking partition
Checking delete
Checking anchoralignaxis
Checking gasexternalforces
Checking anchorobjpointidrot
Checking sandsolver
Checking sopgeo
Checking velimpulseforce
Checking gasdiffuse
Checking anchorobjpointidpos
Checking rippleconfigureobject
Checking wirevolumecollider
Checking gasparticlepressure
Checking odesolver
Checking particlefluidsink
Checking gasbuildrelationshipmask
Checking gasfetchfieldstoembed
Checking rbdfracturedobject
Checking sandconfigureobject
Checking gasvelocitystretch
Checking gasadjustelasticity
Checking gasgeometrytosdf
Checking rbdpointobject
Checking rbdconfigureobject
Checking gasfeedback
Checking gasbuoyancy
Checking gaselasticity
Checking netfetchdata
Checking constraint
Checking copydata
Checking anchorobjprimpos
Checking smokeobject
Checking gasreinitializesdf
Checking objnet
Checking gasnetsliceexchange
Checking gasrest
Checking gasprojectnondivergent
Checking fluidsolver
Checking blendsolver
Checking magnetforce
Checking terrainobject
Checking instancedobject
Checking wiresolver
Checking clothsolver
Checking slicealongline
Checking rbdkeyactive
Checking fan
Checking fluidconfigureobject
Checking squishyobject
Checking split
Checking gasdsd
Checking renderparmsvolatile
Checking wireangularconstraint
Checking particlefluidsolver
Checking emptyobject
Checking gasvortexconfinement
Checking gassandforces
Checking objpos
Checking gascomputeparticleattributes
Checking gasreduce
Checking copyobjectinfo
Checking nocollider
Checking gasblur
Checking gasadvect
Checking wirevisualization
Checking noise
Checking rbdvisualization
Checking applydata
Checking sopsolver
Checking particlefieldvisualization
Checking noconrel
Checking gasdissipate
Checking motion
Checking shopnet
Checking pointpos
Checking gasstrainintegrate
Checking scriptsolver
Checking gasfieldtoparticle
Checking null
Checking anchorobjpointgrouprot
Checking gassolver
Checking gascalculate
Checking impulseforce
Checking gasintegrator
Checking geometrycopy
Checking cop2net
Checking anchorobjpointgrouppos
Checking uniformforce
Checking rbdobject
Checking gasvolumeramp
Checking colliderlabel
Checking gassphforces
Checking clothmaterialbehavior
Checking rbdhingeconstraint
Checking gasburngeometryobject
Checking gasfeatherfield
Checking vectorfield
Checking odeconfigureobject
Checking wirewirecollider
Checking popshapematch
Checking smokesolver
Checking sopvectorfield
Checking rbdangularspringconstraint
Checking gaslookup
Checking sopnet
Checking fieldforce
Checking staticobject
Checking sourcerel
Checking particlefluidconfigureobject
Checking chopnet
Checking filedata
Checking buoyancyforce
Checking spherepointtree
Checking gasbuildcollisionmask
Checking wireelasticity

Edited by Vormav
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...