OP_Node * SOP_PointsFromVoxels::myConstructor(OP_Network *net, const char *name, OP_Operator *op) { return new SOP_PointsFromVoxels(net, name, op); } SOP_PointsFromVoxels::SOP_PointsFromVoxels(OP_Network *net, const char *name, OP_Operator *op): SOP_Node(net, name, op) {} static PRM_Name names[] = { PRM_Name("prim", "Primitive Number"), PRM_Name("cull", "Cull Empty"), PRM_Name("store", "Store Voxel Values"), PRM_Name(0) }; static PRM_Default defaults[] = { PRM_Default(0), PRM_Default(0), PRM_Default(0) }; static PRM_Range prim_range(PRM_RANGE_RESTRICTED, 0, PRM_RANGE_UI, 10); PRM_Template
OP_TemplatePair* GusdOBJ_usdcamera::GetTemplates() { /* Our common camera params come from the same initialization script as the standard camera.*/ static PRM_Default primPathDef(0, "/World/main_cam"); static PRM_Name frameName("frame", "Frame"); static PRM_Default frameDef(0, "$FF"); static PRM_Name xformName("xformmode", "Transform Mode"); static PRM_Name xformNames[] = { PRM_Name("postmultctm", "Object to World"), PRM_Name("ctm", "Parent to World"), PRM_Name("obj", "Object"), PRM_Name("none", "None"), PRM_Name() }; static PRM_ChoiceList xformMenu(PRM_CHOICELIST_SINGLE, xformNames); GusdPRM_Shared prmShared; static PRM_Template camTemplates[] = { PRM_Template(PRM_FILE, 1, &prmShared->filePathName, 0, /*choicelist*/ 0, /*range*/ 0, /*callback*/ 0, &prmShared->usdFileROData), PRM_Template(PRM_STRING, 1, &prmShared->primPathName, &primPathDef), PRM_Template(PRM_FLT, 1, &frameName, &frameDef), PRM_Template(PRM_ORD, 1, &xformName, /* default*/ 0, /* choice list */ &xformMenu, /* range */0, /* callback */0, /* spare */0, /* group */0, "If this node is included in a OBJ hierarchy this " "should be set to 'Object'. If not, it should " "be set to 'Object to World'"), PRM_Template() }; unsigned numCamTemplates = PRM_Template::countTemplates(camTemplates); // for backwards compatibility with old stereo attributes { static PRM_Name isStereoName("isstereo", "Is Stereo"); static PRM_Name rightEyeName( "isrighteye", "Is Right Eye" ); static PRM_Name convergenceDistanceName("convergencedistance", "Convergence Distance"); static PRM_Name interocularDistanceName("interoculardistance", "Interocular Distance"); static PRM_Name leftEyeBiasName("lefteyebias", "Left Eye Bias"); static PRM_Template stereoAttrsTemplates[] = { PRM_Template(PRM_TOGGLE | PRM_TYPE_INVISIBLE, 1, &isStereoName, /* defaults */ 0, /* choice list */ 0, /* range ptr */0, /* callback */0, /* spare */ 0, /* parmgroup*/ 1, "Show mono view if off. Right or left eye view if on."), PRM_Template(PRM_TOGGLE | PRM_TYPE_INVISIBLE, 1, &rightEyeName, /* defaults */ 0, /* choice list */ 0, /* range ptr */0, /* callback */0, /* spare */ 0, /* parmgroup*/ 1, "If checked, show right eye view. " "Otherwise show left eye view."), PRM_Template(PRM_FLT | PRM_TYPE_INVISIBLE, 1, &convergenceDistanceName, 0), PRM_Template(PRM_FLT | PRM_TYPE_INVISIBLE, 1, &interocularDistanceName, 0), PRM_Template(PRM_FLT | PRM_TYPE_INVISIBLE, 1, &leftEyeBiasName, /* defaults */ 0, /* choice list */ 0, /* range ptr */0, /* callback */0, /* spare */ 0, /* parmgroup*/ 1, "If 0, left eye view matches mono view. " "If 1, right eye view matches mono view." ), PRM_Template() }; unsigned numStereoAttrsTemplates = PRM_Template::countTemplates(stereoAttrsTemplates); // } static PRM_Name displayFrustumName( "displayFrustum", "Display Frustum"); static PRM_Template displayFrustum(PRM_TOGGLE, 1, &displayFrustumName, 0); const PRM_Template* const objTemplates = getTemplateList(OBJ_PARMS_PLAIN); unsigned numObjTemplates = PRM_Template::countTemplates(objTemplates); /* First template in common obj parms is a switcher. We need to modify the switcher to include our own tab.*/ UT_IntArray numSwitchersOnPages, numNonSwitchersOnPages; PRM_Template::getSwitcherStats(objTemplates, numSwitchersOnPages, numNonSwitchersOnPages); unsigned oldSwitcherSize = numNonSwitchersOnPages.entries(); static std::vector<PRM_Default> tabs(oldSwitcherSize+1); static PRM_Default renderPaneDefault; for(int i = 0; i < oldSwitcherSize; ++i) { tabs[i] = objTemplates->getFactoryDefaults()[i]; // We want to add an item to the Render pane, displayFrustum. // We need to increase the item count in the switcher default. if(UT_String(tabs[i].getString()) == "Render") { renderPaneDefault.setString(tabs[i].getString()); renderPaneDefault.setFloat(tabs[i].getFloat() + 1); tabs[i] = renderPaneDefault; } } tabs[oldSwitcherSize] = PRM_Default(numCamTemplates + numStereoAttrsTemplates, "USD"); static PRM_Name switcherName = *objTemplates->getNamePtr(); static std::vector<PRM_Template> templates; templates.push_back( PRM_Template(PRM_SWITCHER, tabs.size(), &switcherName, &tabs[0])); for(std::size_t i = 1; i < numObjTemplates; ++i) { templates.push_back( objTemplates[i] ); if(UT_String(objTemplates[i].getNamePtr()->getToken()) == "display") templates.push_back(displayFrustum); } templates.insert(templates.end(), camTemplates, camTemplates + numCamTemplates); templates.insert(templates.end(), stereoAttrsTemplates, stereoAttrsTemplates + numStereoAttrsTemplates); templates.push_back(PRM_Template()); static OP_TemplatePair templatePair(&templates[0], NULL); return &templatePair; }
SOP_PrimCentroid::myConstructor(OP_Network *net, const char *name, OP_Operator *op) { return new SOP_PrimCentroid(net, name, op); } SOP_PrimCentroid::SOP_PrimCentroid(OP_Network *net, const char *name, OP_Operator *op): SOP_Node(net, name, op) {} static PRM_Name methodChoices[] = { PRM_Name("bary", "Barycenter"), PRM_Name("bbox", "Bounding Box"), PRM_Name(0) }; static PRM_ChoiceList methodChoiceMenu( (PRM_ChoiceListType)(PRM_CHOICELIST_EXCLUSIVE | PRM_CHOICELIST_REPLACE), methodChoices); static PRM_Name names[] = { PRM_Name("method", "Method"), PRM_Name("attributes", "Attributes to Copy"), PRM_Name("copyvariables", "Copy Local Variables"),
{ table->addOperator( new OP_Operator("script", "Script", ROP_Script::myConstructor, ROP_Script::getTemplatePair(), 0, 9999, ROP_Script::getVariablePair(), OP_FLAG_GENERATOR) ); } static PRM_Name names[] = { PRM_Name("sepparm1", "Separator"), PRM_Name("command", "Command"), PRM_Name("language", "Language"), PRM_Name("sepparm2", "Separator"), }; static PRM_Default defaults[] = { PRM_Default(0, ""), PRM_Default(0, "hscript"), }; static PRM_Name languages[] = { PRM_Name("hscript", "Hscript"), PRM_Name("python", "Python"),
OP_Node * SOP_IdBlast::myConstructor(OP_Network *net, const char *name, OP_Operator *op) { return new SOP_IdBlast(net, name, op); } SOP_IdBlast::SOP_IdBlast(OP_Network *net, const char *name, OP_Operator *op): SOP_Node(net, name, op) {} static PRM_Name names[] = { PRM_Name("group", "Group"), PRM_Name("negate", "Delete Non-Selected"), }; static PRM_Default defaults[] = { PRM_Default(0, ""), PRM_Default(0), }; PRM_Template SOP_IdBlast::myTemplateList[] = { PRM_Template(PRM_STRING, 1, &names[0], &defaults[0]), PRM_Template(PRM_TOGGLE, 1, &names[1], &defaults[1]), PRM_Template() };
OP_Node * SOP_IdBlast::myConstructor(OP_Network *net, const char *name, OP_Operator *op) { return new SOP_IdBlast(net, name, op); } SOP_IdBlast::SOP_IdBlast(OP_Network *net, const char *name, OP_Operator *op): SOP_Node(net, name, op) {} static PRM_Name names[] = { PRM_Name("ids", "Ids"), }; static PRM_Default defaults[] = { PRM_Default(0, ""), }; PRM_Template SOP_IdBlast::myTemplateList[] = { PRM_Template(PRM_STRING, 1, &names[0], &defaults[0]), PRM_Template() }; int addOffsetToGroup(int num, int sec, void *data) {
// Populate the menu with the selected attributes. me->fillAttribNameMenu(menu, 100, owner, input_index, &SOP_PrimGroupCentroid::validateAttrib, &mode); } static PRM_ChoiceList attribMenu((PRM_ChoiceListType)(PRM_CHOICELIST_TOGGLE), &SOP_PrimGroupCentroid::buildMenu); static PRM_Name names[] = { PRM_Name("mode", "Mode"), PRM_Name("group", "Group"), PRM_Name("method", "Method"), PRM_Name("store", "Store Source Identifier"), PRM_Name("attributes", "Attributes to Copy"), PRM_Name("behavior", "Unmatched Behavior"), PRM_Name("bind_attributes", "Bind Attributes to Copy"), }; static PRM_Name modeChoices[] = { PRM_Name("group", "Group"), PRM_Name("name", "Name"), PRM_Name("class", "Class"), PRM_Name(0) };
static PRM_Range minOneRange(PRM_RANGE_RESTRICTED,1,PRM_RANGE_FREE,10); static PRM_Range minZeroRange(PRM_RANGE_RESTRICTED,0,PRM_RANGE_FREE,10); static PRM_Range zeroToOneRange(PRM_RANGE_RESTRICTED,0,PRM_RANGE_RESTRICTED,1); static PRM_Range pointSizeRange(PRM_RANGE_RESTRICTED,1,PRM_RANGE_FREE,10); static PRM_Name switcherName("particlesSystemSwitcher"); static PRM_Default switcherList[] = { PRM_Default(9, "Velocity"), PRM_Default(5, "Display"), }; // The names here have to match the inline evaluation functions static PRM_Name names[] = { PRM_Name("maxParts", "Max Particles"), PRM_Name("startFrame", "Start Frame"), PRM_Name("substeps", "Substeps"), PRM_Name("life", "Life"), PRM_Name("lifeVar", "Life Var"), PRM_Name("velDamp", "Velocity Damping"), PRM_Name("gravityStr", "Gravity Strength"), PRM_Name("gravityDir", "Gravity Dir"), PRM_Name("fluidStr", "Fluid Strength"), PRM_Name("preview", "Preview"), PRM_Name("pointSize","Point Size"), PRM_Name("opacity","Opacity"), PRM_Name("startColor","Start Color"),
SOP_PrimCentroid::myConstructor(OP_Network *net, const char *name, OP_Operator *op) { return new SOP_PrimCentroid(net, name, op); } SOP_PrimCentroid::SOP_PrimCentroid(OP_Network *net, const char *name, OP_Operator *op): SOP_Node(net, name, op) {} static PRM_Name methodChoices[] = { PRM_Name("bary", "Barycenter"), PRM_Name("bbox", "Bounding Box"), PRM_Name(0) }; static PRM_ChoiceList methodChoiceMenu( (PRM_ChoiceListType)(PRM_CHOICELIST_EXCLUSIVE | PRM_CHOICELIST_REPLACE), methodChoices); static PRM_Name names[] = { PRM_Name("method", "Method"), PRM_Name("attributes", "Attributes to Copy"), };
help += " no subdivision will occur.\n"; } void newSopOperator(OP_OperatorTable *table) { table->addOperator(new OP_CleaveOperator()); } static PRM_Name names[] = { PRM_Name("freq", "Frequency"), PRM_Name("init", "Initial Rotation"), PRM_Name("delta", "Cummulative Rotation"), PRM_Name("rand", "Random Rotation"), PRM_Name("seed", "Seed"), PRM_Name("splits", "Splits"), PRM_Name("randsplits", "Use Random Splits"), PRM_Name("dist", "Channel Width"), PRM_Name("dist_scale", "Channel Scale"), PRM_Name("subdiv_thresh", "Subdiv threshold"), };
PRM_Name("emit#pos", "Emitter # Pos"), PRM_Name("emit#rad", "Radius"), PRM_Name("emit#amount", "Amount"), }; static PRM_Template emitterTemplate[] = { PRM_Template(PRM_XYZ, 3, &eNames[0], PRMzeroDefaults), PRM_Template(PRM_FLT, 1, &eNames[1], PRMoneDefaults), PRM_Template(PRM_FLT, 1, &eNames[2], PRMoneDefaults), PRM_Template() };*/ static PRM_Name sliceType[] = { PRM_Name("density", "Density"), PRM_Name("velocity", "Velocity"), PRM_Name("noise", "Noise"), PRM_Name("pressure", "Pressure"), PRM_Name("vorticity", "Vorticity"), PRM_Name("obstacles", "Obstacles"), PRM_Name(0) }; static PRM_ChoiceList sliceTypeMenu(PRM_CHOICELIST_SINGLE, sliceType); static PRM_Name resDis[] = { PRM_Name("r128", "128"), PRM_Name("r256", "256"), PRM_Name("r512", "512"),
PRM_Name("emit#pos", "Emitter # Pos"), PRM_Name("emit#rad", "Radius"), PRM_Name("emit#amount", "Amount"), }; static PRM_Template emitterTemplate[] = { PRM_Template(PRM_XYZ, 3, &eNames[0], PRMzeroDefaults), PRM_Template(PRM_FLT, 1, &eNames[1], PRMoneDefaults), PRM_Template(PRM_FLT, 1, &eNames[2], PRMoneDefaults), PRM_Template() };*/ static PRM_Name previewChoices[] = { PRM_Name("density", "Density"), PRM_Name("velocity", "Velocity"), PRM_Name("noise", "Noise"), PRM_Name("pressure", "Pressure"), PRM_Name("vorticity", "Vorticity"), PRM_Name("obstacles", "Obstacles"), PRM_Name(0) }; static PRM_ChoiceList previewMenu(PRM_CHOICELIST_SINGLE, previewChoices); // The names here have to match the inline evaluation functions static PRM_Name names[] = {
#include <PRM/PRM_Include.h> void newSopOperator(OP_OperatorTable *table) { table->addOperator(new OP_Operator("aaOceanSOP", "aaOceanSOP", aaOceanSOP::myConstructor, aaOceanSOP::myTemplateList, 1, 1, 0)); } static PRM_Name names[] = { PRM_Name("resolution", "Resolution"), PRM_Name("seed", "Seed"), PRM_Name("oceanScale", "Ocean Scale"), PRM_Name("oceanDepth", "Ocean Depth"), PRM_Name("surfaceTension", "Surface Tension"), PRM_Name("velocity", "Wave Size"), PRM_Name("cutoff", "Wave Smooth"), PRM_Name("windDir", "Wind Dir"), PRM_Name("windAlign", "Wind Align"), PRM_Name("damp", "Reflected Waves"), PRM_Name("waveSpeed", "Wave Speed"), PRM_Name("waveHeight", "Wave Height"), PRM_Name("chop", "Chop Amount"), PRM_Name("enableEigens", "Output Eigens Attributes"),