dopsmoketoolutils module

dopsmoketoolutils.addField(kwargs)

Selects an object and prompts for the type of field to add. Then adds it.

dopsmoketoolutils.addFieldImport(dopionode, objname, fieldname, visible)
dopsmoketoolutils.addFieldToObject(fluidobject, fieldname, fieldvizname)

Add Field inside the given fluid object.

dopsmoketoolutils.addfluidsource(objecttoconvert, preset, mode, volumeattribute, addnoise=False)
dopsmoketoolutils.addpumpcolsource(objecttoconvert, preset, solvernode)
dopsmoketoolutils.applySourceSink(fluidnode, objectnode, sourcesink)

A sourceapply is added to the fluid object. This will directly import the objectnode if it isn’t simulated. If the object node is a live simulation, it will add the name of it to the sourceapply source object.

The assumption is we have been prefixed by a convertObjectToSourceSink

dopsmoketoolutils.applysopSourceSink(fluidnode, sourcenode, sourcesink)
dopsmoketoolutils.buildCombustionModel(objnode, firenode, smokenode, flamescale)

Builds a live version of obj node that updates the combustion model.

dopsmoketoolutils.buildFluidBoxWithUpres(kwargs, fluidtype, buildmat=True)

Builds a fluid solver and fluid box complete with a tame upres choice.

dopsmoketoolutils.buildMotionOverride(name, bypass)

Builds a SIM_Motion setup to be keyframeable with no extra channels. Bypasses by default if so requested.

dopsmoketoolutils.buildNodeName(result, field_name)

Suffixes first paramater with second, but handles cases of first parm being None

dopsmoketoolutils.buildRelationshipExpression(node)

Builds the appropriate expression to refer to this node inside a relationship string. Ie, dopobjscreatedby for fluidnodes and chs() for group nodes.

dopsmoketoolutils.buildRenameNode(objectnode, fromfield, tofield)

Returns a new node, a child of object node, that will rename the field fromfield to the field tofield.

dopsmoketoolutils.burstSelectedIntoFlame(kwargs)

Creates a properly centered flame and smoke boxes for the given object and sets up the proper embedding relationship

dopsmoketoolutils.calculateDiameter(diamobject)

Calculates the approximated diameter of the specified object If the diameter is 0, return 1

dopsmoketoolutils.computeFluidDiameter(fluidnode)

Estimates a diameter for a fluid container

dopsmoketoolutils.convertObjectToFluidtype(fluidobject, objectnode, fluidtype)

object node is used as initial conditions into fluidobject according to the fluid type.

dopsmoketoolutils.convertObjectToSourceSink(fluidnode, objectnode, sourcesink, subtype=None, addnoise=True)

The chosen object is added to the simulation as a static object and set as a source or sink relationship to the rest of the simulation.

sourcesink can be Source, Sink, Pump for the static object approach. Prefixing Apply_ will instead use a sourceapply. Postfixing _Surface to an Apply_ will setup for emission from the surface.

Ideally, it is to be added to the target fluid’s source relationship, but for technical constraints we only guarantee it is added to that network. Since selection will change the current fluid network, we don’t have to worry about setting the network.

We special case particle fluids when they are the target as we have special source/sink nodes in these cases.

dopsmoketoolutils.convertRelTypeToToken(reltype)

Converts a relationship type, such as Source, into the appropriate token such as SIM_RelationshipoSource.

dopsmoketoolutils.convertSelectedToFluidtype(kwargs, fluidtype)

Select geometry and apply convertToFluid to it.

dopsmoketoolutils.convertmodeto(sourcesink)
dopsmoketoolutils.converttypeto(sourcesink, solvernode='smokesolver::2.0')

returns the correct preset values used for setting up the fluidsource operator

dopsmoketoolutils.converttypetodop(sourcesink, solvernode='smokesolver::2.0')

returns the correct preset used for setting up the source volume operator

dopsmoketoolutils.count(objecttoconvert, mode='Volume')
dopsmoketoolutils.createBillowySmokeMaterial()

Creates an official smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createBlackSmokeMaterial()

Creates an official smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createBlueConeMaterial()

Creates an official blue cone material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createDSDFlameMaterial()

Creates an official flame material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createEmptyFluidBox(sceneviewer, fluidtype, buildmat=True, prohibited=[])

Creates a new fluid object in DOPs and exports appropriately to Objects. Returns the (dopnode, fieldnode) creating/importing the fluid. prohibited parameter is a list of solver nodes that the current DOPNET may not contain. If there is a solver node in the current DOPNET that is in this list, a new DOPNET is created instead.

dopsmoketoolutils.createFlameMaterial()

Creates an official flame material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createFlameSmokeMaterial()

Creates an official smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createForSourceSink(createtype, subtype=None)
dopsmoketoolutils.createHotSmokeMaterial()

Creates an official smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createLiquidMaterial()

Creates an official liquid surface material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createLiquidSmokeMaterial()

Creates an official liquid smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createMaterial(galleryname, nodename)

Creates a material from the gallery and installs into /mat. Returns the result. Note if it already exists, it will create a new one!

dopsmoketoolutils.createMaterialFromFluidType(fluidtype)
dopsmoketoolutils.createMistMaterial()

Creates an official mist material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createMushroomMaterial()

Creates an official smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createObjectImportingFromFluid(dopnode, fluidtype, buildmat=True)

Creates a new object importing fluid from dopnode of the given type. Returns the display node of the created object.

dopsmoketoolutils.createRelationship(fluidnode, dopnode, sourcesink)

Creates a relationship of type sourcesink between the fluidnode (as the affectee) and the DOP Node (as the affector). This uses the dopobjscreatedby function to ensure node renames are properly handled. If the specified nodes are Group DOPs, a chs() expression will be built to the group’s name.

dopsmoketoolutils.createRenderNode(objectnode, dopnode, fluidtype, isupres)

Creates a dopimportfield inside objectnode that extracts the expected fields from dopnode given it being fluidtype. isupres flags that this is the upres stage so we should set the presets appropriately.

dopsmoketoolutils.createSmokeMaterial()

Creates an official smoke material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createSopAttribVolume(fluidnode, objectnode, sourcesink)

converts objects into a volumes for a dop smoke sim the script uses the type (sink/source/pump) and mode (sort of geometry) to set up operators

dopsmoketoolutils.createSopSourceForDop(fluidnode, objectnode, sourcesink, subtype=None, addnoise=False)
dopsmoketoolutils.createSprayMaterial()

Creates an official spray material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createSteamMaterial()

Creates an official steam material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.createUniformVolumeMaterial()

Creates an official uniform volume material in /mat

dopsmoketoolutils.createUniformVolumeOceanMaterial()

Creates an official uniform ocean volume material in /mat Always builds a new one as we will be setting displacement channels.

dopsmoketoolutils.createWhitewaterMaterial()

Creates an official whitewater material in /mat. Returns existing one if it already exists.

dopsmoketoolutils.deleteBoundingBox(object, sop)

Appends a node to sop that deletes the bounding box group. Sets the render, and only render, flag to this so things render nicely.

dopsmoketoolutils.distributeClusterSimulation(creator_object, fluidtype)

Prepares the the file for a cluster based distribution.

dopsmoketoolutils.distributeGridSimulation(activepane, fluidobject)

Adds the net border exchange node and builds a control panel to setup the distribution of a grid based fluid sim.

dopsmoketoolutils.distributeSimulation(kwargs, prompt=None, invalid_selection_message=None)

Selects a fluid object to distribute and then invokes the correct distribution method.

dopsmoketoolutils.dopEmptyFluidBox(scriptargs, fluidtype, prompt=None, buildmat=True, containerinstance=False)

Create an empty smoke or fluid box and export it to Objects Returns (dopnode, fieldnode), dopnode is what creates this fluid in DOPs and fieldnode is the node that imports it it in Sops.

dopsmoketoolutils.embedDopInFluid(embedobject, fluidobject)

Embeds the specified DOP_Object into the DOP_Object fluidobject embed object will be driven by the fluid object within the fluid object’s field of influence

dopsmoketoolutils.embedDopInFluidByNodes(embednode, embedtype, fluidnode, sourcetype)

Embeds the fluid of type embedtype and owned by embednode inside the fluid of sourcetype owned by fluidnode.

dopsmoketoolutils.embedInFluid(kwargs)

Selected object is added to set to float in the found fluid solver.

dopsmoketoolutils.embedObjectInFluid(objectnode, fluidobject)

Embeds the specified OBJ_Node into the DOP_Object fluidobject.

dopsmoketoolutils.findBestGroupNode(fluidnode)

Searches descendents of fluidnode for a group node that should be used for relationships rather than the groupnode. Currently we only accept a post-switch group node where that switch is suspected to have been made by an upres merge.

dopsmoketoolutils.findDopIONodes(dopnode)

Finds all DOP I/O nodes that import this DOP node. Locates it by finding all DOP I/O nodes one level deep in Objects and then checking to see if their autodopnetwork and dopscreatedby match.

dopsmoketoolutils.findImportingFluidBox(fluidnode)

Finds a DOP I/O node that imports this fluidnode. Locates it by finding all DOP I/O nodes one level deep in Objects and then checking to see if their autodopnetwork and dopscreatedby match.

dopsmoketoolutils.findOrCreateMaterial(galleryname, nodename)

Searches the gallery for a matching material and installs it into /mat. Returns the resulting material. Note that if a material already exists of this name, it will be used instead!

dopsmoketoolutils.findOrCreateMergeRelationship(reltype, forcecreate=False)

Searches the auto-net for a given type of merge relationship. If it doesn’t exist, create it. The relationship name is something like Source, Empty, etc.

dopsmoketoolutils.getExpression(node, parmname)

Returns the expression for the given parmname. If it is not an expression or the parm or node doesn’t exist returns None.

dopsmoketoolutils.getImportedFields(dopionode)
dopsmoketoolutils.haspointattribute(samplenode, attribute='v')
dopsmoketoolutils.initVelocity(kwargs)

Sets the initial velocity of the container from a SOP network.

dopsmoketoolutils.initVelocityOfFluid(fluidnode)

Initialize the velocity of the given object. Returns the volume velocity node.

dopsmoketoolutils.linkParms(destnode, srcnode, parmlist)

Creates a ch() link in the dest node pointing to the source node for each parm in the parmlist. The two nodes must have matching parm names.

dopsmoketoolutils.parentFluid(kwargs)

Select fluid and set it up to be parented.

dopsmoketoolutils.parentFluidTo(fluidnode, parentobject)

Parents the fluid dynamic object fluidobject to parent object.

dopsmoketoolutils.renamevolume(fluidsource, outnull, number=1, name='rename')
dopsmoketoolutils.resizeFluid(kwargs)

Select fluid and set it up to be resizeable.

dopsmoketoolutils.resizeFluidToMatch(fluidnode, matchobject)

Resizes the fluid dynamic object fluidobject according to match object.

dopsmoketoolutils.seedVorticles(kwargs)

Add a bounding box of vorticles to the selected simulation

dopsmoketoolutils.seedVorticlesInFluid(fluidnode)

Seed vorticles inside the given fluid object. Returns the vorticlenode

dopsmoketoolutils.selectedConvertToAttribSource(scriptargs, sourcesink, dopname, attribname, attribtype, mergemethod=None, rangein=None, rangeout=None, targetrate=None, increaserate=None, decreaserate=None, objprompt=None, fluidprompt=None, autoconvert=True)

Import selected objects to AutoDop and make sourcesink relationships.

dopsmoketoolutils.selectedConvertToSourceSink(scriptargs, sourcesink, objprompt=None, fluidprompt=None, autoconvert=True, createifempty=None, subtype=None)

Import selected objects to AutoDop and make sourcesink relationships.

dopsmoketoolutils.setupFLIPSource(fluidsource, fluidnode, sourcesink, diam)
dopsmoketoolutils.setupFLIPSourceForPyro(fluidsource, fluidnode, diam)
dopsmoketoolutils.setupPyroSource(fluidsource, noisenode, diam, scale)

scale fluidsource values relative to source scale

dopsmoketoolutils.setupmultifield(dopnode)

function sets up multi parm visualization

dopsmoketoolutils.solverinputnodes(solver)

creates a seperated list for the node specified, containing all the ancestor nodes for every independent input. ie: [[1,[x,x,x]],[2,[y,y,y]]]

dopsmoketoolutils.sourcesolvertype(solvernode)

a solver of a type pyro or upres can represent multiple fluid types this function returns the correct type based on the mode the solver is in.

dopsmoketoolutils.spliceUpresSim(fluidnode, fieldnode, upresnode, upresfieldnode)

Splices a upres sim with a normal res sim assuming both are in the same network. Also updates our upresfieldnode to object merge in the needed fields from fieldnode for proper rendering.

dopsmoketoolutils.targetDrivenSmoke(fluidobject, goalobject)

goalobject is made a target goal of fluidobject.

dopsmoketoolutils.targetDrivenSmokeSelect(kwargs)

Selects smoke & target shape, then creates a target driven effect from the smoke to the target.

dopsmoketoolutils.transferRelationships(oldnode, newnode)

For all nodes inside the dopnet given, search for relationship nodes. If the affector or affectee is a dopscreatedby or group channel reference to oldnode, change it to the approriate expression for new node.

dopsmoketoolutils.upresSelect(kwargs)

Selects a fluid sim to upres. Will then create a new DOP network to hold the resulting upresed sim.

dopsmoketoolutils.upresSmoke(fluidnode, buildmat=True, fluidlocation=None, solver=None)
dopsmoketoolutils.upresSmokeSameNet(fluidnode, buildmat=True)

Given a fluidnode builds the upres version of it. This is built in the same network as the fluid node but switches are put in place to try and ensure we can disable the uprespath.

The generated nodes are left unwired in the net. The (upresfluidnode, fieldnode) is returned.

dopsmoketoolutils.upresSmokeSelectSameNet(kwargs)

Selects a fluid sim to upres. Creates the upres simulation in the same network as that sim using a switch dop to select upres mode.