示例#1
0
static PRM_Template *
getTemplates()
{
    static PRM_Template	*theTemplate = 0;

    if (theTemplate)
        return theTemplate;
    theTemplate = new PRM_Template[22];

    theTemplate[0] = PRM_Template(PRM_FILE, 1, &theFileName, &theFileDefault);// this is the save seed geopath
    theTemplate[1] = PRM_Template(PRM_STRING,1,&theArDso,&theArDsoDefault);


    theTemplate[2] = theRopTemplates[ROP_TPRERENDER_TPLATE];                   // it's  must appear in every rop
    theTemplate[3] = theRopTemplates[ROP_PRERENDER_TPLATE];
    theTemplate[4] = theRopTemplates[ROP_LPRERENDER_TPLATE];
    theTemplate[5] = theRopTemplates[ROP_TPREFRAME_TPLATE];
    theTemplate[6]= theRopTemplates[ROP_PREFRAME_TPLATE];
    theTemplate[7] = theRopTemplates[ROP_LPREFRAME_TPLATE];
    theTemplate[8] = theRopTemplates[ROP_TPOSTFRAME_TPLATE];
    theTemplate[9] = theRopTemplates[ROP_POSTFRAME_TPLATE];
    theTemplate[10] = theRopTemplates[ROP_LPOSTFRAME_TPLATE];
    theTemplate[11] = theRopTemplates[ROP_TPOSTRENDER_TPLATE];
    theTemplate[12] = theRopTemplates[ROP_POSTRENDER_TPLATE];
    theTemplate[13] = theRopTemplates[ROP_LPOSTRENDER_TPLATE];
    theTemplate[14] = theRopTemplates[ROP_INITSIM_TPLATE];
    theTemplate[15] = theRopTemplates[ROP_MKPATH_TPLATE];
    return theTemplate;
}
示例#2
0
static PRM_Template *
getTemplates()
{
    static PRM_Template	*theTemplate = 0;

    if (theTemplate)
	return theTemplate;

    // Array large enough to hold our custom parms and all the
    // render script parms.
    theTemplate = new PRM_Template[17];

    // Separator between frame/take parms and the code parm.
    theTemplate[0] = PRM_Template(PRM_SEPARATOR, 1, &names[0]);

    // String paramater containing the code to run.  Horizontally
    // joined to the next parm.
    theTemplate[1] = PRM_Template(PRM_STRING, 1, &names[1], &defaults[0]);
    theTemplate[1].setJoinNext(true);

    // String menu to select the code language.
    theTemplate[2] = PRM_Template(PRM_STRING, 1, &names[2], &defaults[1], &languageMenu);
    theTemplate[2].setTypeExtended(PRM_TYPE_NO_LABEL);

    // Separator between the code parm and the render scripts.
    theTemplate[3] = PRM_Template(PRM_SEPARATOR, 1, &names[3]);

    theTemplate[4] = theRopTemplates[ROP_TPRERENDER_TPLATE];
    theTemplate[5] = theRopTemplates[ROP_PRERENDER_TPLATE];
    theTemplate[6] = theRopTemplates[ROP_LPRERENDER_TPLATE];

    theTemplate[7] = theRopTemplates[ROP_TPREFRAME_TPLATE];
    theTemplate[8] = theRopTemplates[ROP_PREFRAME_TPLATE];
    theTemplate[9] = theRopTemplates[ROP_LPREFRAME_TPLATE];

    theTemplate[10] = theRopTemplates[ROP_TPOSTFRAME_TPLATE];
    theTemplate[11] = theRopTemplates[ROP_POSTFRAME_TPLATE];
    theTemplate[12] = theRopTemplates[ROP_LPOSTFRAME_TPLATE];

    theTemplate[13] = theRopTemplates[ROP_TPOSTRENDER_TPLATE];
    theTemplate[14] = theRopTemplates[ROP_POSTRENDER_TPLATE];
    theTemplate[15] = theRopTemplates[ROP_LPOSTRENDER_TPLATE];

    theTemplate[16] = PRM_Template();

    return theTemplate;
}
示例#3
0
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;
}
示例#4
0
					 SOP_UniPdist::myConstructor,
					 SOP_UniPdist::myTemplateList,
					 1,
					 1,
					 0));
}

static PRM_Range rangeP(PRM_RANGE_UI , 0.0, PRM_RANGE_UI , 100.0);
static PRM_Default  oneDefault(1);
static PRM_Name distanceName ("dist", "Distance");
static PRM_Name keepGroup("keepgroup", "Keep group");


PRM_Template
SOP_UniPdist::myTemplateList[] = {
	PRM_Template(PRM_FLT_J, 1, &distanceName, &oneDefault, 0, &rangeP, 0, 0, 0, "Distance/Radius"),
    PRM_Template(),
};


OP_Node *SOP_UniPdist::myConstructor(OP_Network *net, const char *name, OP_Operator *op)
{
    return new SOP_UniPdist(net, name, op);
}

SOP_UniPdist::SOP_UniPdist(OP_Network *net, const char *name, OP_Operator *op)
	: SOP_Node(net, name, op), myGroup(0)
{
}

SOP_UniPdist::~SOP_UniPdist()
    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
SOP_PointsFromVoxels::myTemplateList[] = {
    PRM_Template(PRM_INT, 1, &names[0], &defaults[0], 0, &prim_range),
    PRM_Template(PRM_TOGGLE, 1, &names[1], &defaults[1]),
    PRM_Template(PRM_TOGGLE, 1, &names[2], &defaults[2]),
    PRM_Template()
};

OP_ERROR
SOP_PointsFromVoxels::cookMySop(OP_Context &context)
{
    bool                        cull, store;
    fpreal                      now, value;
    int                         rx, ry, rz;
    unsigned                    primnum;

    GA_Offset                   ptOff;
    GA_ROAttributeRef           input_attr_gah;
                                   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)
{
    GroupIdMapPair              *pair;

    GA_PointGroup               *group;

    IdOffsetMap                 *id_map;
    IdOffsetMap::const_iterator map_it;


    // Get the pair.
    pair = (GroupIdMapPair *)data;
    PRM_Name("copyvariables", "Copy Local Variables"),
};

static PRM_Default defaults[] =
{
    PRM_Default(0),
    PRM_Default(0, ""),
    PRM_Default(1),
};

static PRM_ChoiceList attribMenu((PRM_ChoiceListType)(PRM_CHOICELIST_TOGGLE),
                                 &SOP_PrimCentroid::buildMenu);

PRM_Template
SOP_PrimCentroid::myTemplateList[] = {
    PRM_Template(PRM_ORD, 1, &names[0], &defaults[0], &methodChoiceMenu),
    PRM_Template(PRM_STRING, 1, &names[1], &defaults[1], &attribMenu),
    PRM_Template(PRM_TOGGLE, 1, &names[2], &defaults[2]),
    PRM_Template()
};

void
SOP_PrimCentroid::buildMenu(void *data,
                            PRM_Name *menu,
                            int list_size,
                            const PRM_SpareData *,
                            const PRM_Parm *)
{
    // Get the instance of the operator.
    SOP_PrimCentroid *me = (SOP_PrimCentroid *)data;
    behaviorChoices);

static PRM_Default defaults[] =
{
    PRM_Default(1),
    PRM_Default(0),
    PRM_Default(0),
    PRM_Default(0),
    PRM_Default(0, ""),
    PRM_Default(0),
    PRM_Default(0, ""),
};

PRM_Template
SOP_PrimGroupCentroid::myTemplateList[] = {
    PRM_Template(PRM_ORD, 1, &names[0], &defaults[0], &modeChoiceMenu),
    PRM_Template(PRM_STRING, 1, &names[1], &defaults[1], &SOP_Node::primGroupMenu),
    PRM_Template(PRM_ORD, 1, &names[2], &defaults[2], &methodChoiceMenu),
    PRM_Template(PRM_TOGGLE, 1, &names[3], &defaults[3]),
    PRM_Template(PRM_STRING, 1, &names[4], &defaults[4], &attribMenu),
    PRM_Template(PRM_ORD, 1, &names[5], &defaults[5], &behaviorChoiceMenu),
    PRM_Template(PRM_STRING, 1, &names[6], &defaults[6], &attribMenu),
    PRM_Template()
};

int
SOP_PrimGroupCentroid::buildAttribData(int mode,
                                       const GU_Detail *input_geo,
                                       UT_Array<GA_Range> &range_array,
                                       UT_StringArray &string_values,
                                       UT_IntArray &int_values)
示例#9
0
	PRM_Name("endColor","End Color"),

	PRM_Name("noiseAmp","Noise Amp"),
	PRM_Name("noiseFreq","Noise Freq"),
	PRM_Name("noiseOct","Noise Oct"),
	PRM_Name("noiseLacun","Noise Lac"),
	PRM_Name("noiseOffset","Noise Offset"),




};

PRM_Template SOP_CudaParticles::myTemplateList[] = {
	
	PRM_Template(PRM_INT, 1, &names[0], &maxPartsDefault, 0, &minZeroRange),			//maxParts
	PRM_Template(PRM_INT, 1, &names[1], PRMoneDefaults),								//startframe
	PRM_Template(PRM_INT, 1, &names[2], PRMoneDefaults, 0, &minOneRange),				//substeps
	PRM_Template(PRM_FLT | PRM_TYPE_JOIN_NEXT, 1, &names[3], &lifeDefault, 0, &minZeroRange),		//life
	PRM_Template(PRM_FLT, 1, &names[4], PRMoneDefaults, 0, &minZeroRange),				//lifevar

	PRM_Template(PRM_SWITCHER, sizeof(switcherList)/sizeof(PRM_Default), &switcherName, switcherList),

	PRM_Template(PRM_FLT, 1, &names[5], &velDampDefault, 0, &minZeroRange),				//velDamp
	PRM_Template(PRM_FLT, 1, &names[6], &gravityStrDefault),								//gravityStr
	PRM_Template(PRM_XYZ, 3, &names[7], gravityDirDefaults),								//gravityDir
	PRM_Template(PRM_FLT, 1, &names[8], PRMzeroDefaults),								//fluidStr

	PRM_Template(PRM_FLT, 1, &names[14], PRMzeroDefaults),				//noiseAmp
	PRM_Template(PRM_FLT, 1, &names[15], PRMoneDefaults, 0, &minZeroRange),				//noiseFreq
	PRM_Template(PRM_INT, 1, &names[16], PRMtwoDefaults, 0, &minOneRange),				//noiseOct
示例#10
0
    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_Template
SOP_Cleave::myTemplateList[] =
{
    PRM_Template(PRM_STRING,    1, &PRMgroupName, 0, &SOP_Node::primGroupMenu),
    PRM_Template(PRM_INT_J,     1, &names[0], PRMtwoDefaults, 0, &PRMfrequency10Range),
    PRM_Template(PRM_ANGLE_J,   1, &names[1], 0, 0, &PRMangleRange),
    PRM_Template(PRM_ANGLE_J,   1, &names[2], 0, 0, &PRMangleRange),
    PRM_Template(PRM_ANGLE_J,   1, &names[3], 0, 0, &PRMangleRange),
    PRM_Template(PRM_INT_J,     1, &names[4], 0, 0, &PRMdivisionRange),
    PRM_Template(PRM_INT_J,	1, &names[5], PRMthreeDefaults, 0, &PRMorderRange),
    PRM_Template(PRM_TOGGLE,    1, &names[6]),
    PRM_Template(PRM_FLT_J,	1, &names[7], PRMzeroDefaults, 0, &PRMtoleranceRange),
    PRM_Template(PRM_FLT_J,	1, &names[8], PRMoneDefaults,  0, &PRMtoleranceRange),
    PRM_Template(PRM_FLT_J,	1, &names[9], PRMzeroDefaults, 0, &PRMtoleranceRange),
    PRM_Template(),
};


OP_Node *
示例#11
0
static PRM_Name         nameRainDirection("dir", "Rain Dir");
static PRM_Default      defaultRainDirection[] = 
                        {
                           PRM_Default(0.0), PRM_Default(-1.0), PRM_Default(0.0)
                        };

static PRM_Range        rangeSpeedVarience(PRM_RANGE_UI,0.0,PRM_RANGE_UI,1.0);
static PRM_Default      defaultSpeedVarience(0.2);
static PRM_Name         nameSpeedVarience("speedVarience","Speed Varience");

static PRM_Range        rangeTime(PRM_RANGE_UI,0.0,PRM_RANGE_UI,1.0);
static PRM_Default      defaultTime(0, "hou.time()", CH_PYTHON_EXPRESSION);
static PRM_Name         nameTime("time","Time");                       

PRM_Template SOP_Rain::myTemplateList[] = {
    PRM_Template(   PRM_FLT, 1, &nameSpeed, &defaultSpeed, 0, &rangeSpeed,
                    parmChanged ),
    PRM_Template(   PRM_FLT_E, 1, &nameFps, &defaultFps, 0, &rangeFps ),
    PRM_Template(   PRM_XYZ, 3, &nameBoundMin, defaultBoundMin,0,0,parmChanged),
    PRM_Template(   PRM_XYZ, 3, &nameBoundMax, defaultBoundMax,0,0,parmChanged),
    PRM_Template(   PRM_INT_LOG_E, 1, &nameNpoints, &defaultNpoints, 0,
                    &rangeNpoints, pointsNumberChanged ),
    PRM_Template(   PRM_INT, 1, &nameSeed, &defaultSeed, 0, &rangeSeed,
                    parmChanged),
    PRM_Template(   PRM_FLT_E, 1, &nameDiceMin, &defaultDiceMin, 0,
                    &rangeDiceMin, parmChanged ),
    PRM_Template(   PRM_FLT_E, 1, &nameDiceMax, &defaultDiceMax, 0, 
                    &rangeDiceMax, parmChanged ),
    PRM_Template(   PRM_DIRECTION, 3, &nameRainDirection, defaultRainDirection,
                    0, 0, parmChanged ),
    PRM_Template(   PRM_FLT, 1, &nameSpeedVarience, &defaultSpeedVarience,
                    0, &rangeSpeedVarience, parmChanged ),
示例#12
0
	PRM_Name("displaySlice", "DisplaySlice"),
	PRM_Name("sliceType", "Slice Type"),
	PRM_Name("sliceAxis", "Slice Axis"),
	PRM_Name("slicePos", "Slice Position"),
	PRM_Name("sliceBounds", "Bounds"),

	PRM_Name("copyVel", "Copy Velocity"),
	PRM_Name("copyDens", "Copy Dens"),



};

PRM_Template SOP_FluidSolver3D::myTemplateList[] = {
	
	PRM_Template(PRM_XYZ, 3, &names[0], PRMzeroDefaults),						//pos
	PRM_Template(PRM_XYZ, 3, &names[1], PRMzeroDefaults),						//rot

	PRM_Template(PRM_XYZ, 3, &names[2], resDefaults),							//res
	PRM_Template(PRM_INT_XYZ, 3, &names[3], sizeDefaults),						//size

	PRM_Template(PRM_TOGGLE | PRM_TYPE_JOIN_NEXT, 1, &names[4], PRMoneDefaults),	//borderNegX
	PRM_Template(PRM_TOGGLE, 1, &names[5], PRMoneDefaults),							//borderPosX
	PRM_Template(PRM_TOGGLE | PRM_TYPE_JOIN_NEXT, 1, &names[6], PRMoneDefaults),	//borderNegY
	PRM_Template(PRM_TOGGLE, 1, &names[7], PRMoneDefaults),							//borderPosY
	PRM_Template(PRM_TOGGLE | PRM_TYPE_JOIN_NEXT, 1, &names[8], PRMoneDefaults),	//borderNegZ
	PRM_Template(PRM_TOGGLE, 1, &names[9], PRMoneDefaults),							//borderPosZ

	PRM_Template(PRM_SWITCHER, sizeof(switcherList)/sizeof(PRM_Default), &switcherName, switcherList),

	PRM_Template(PRM_INT, 1, &names[10], PRMoneDefaults, 0, &minOneRange),			//substeps
示例#13
0
// interp toggle
static PRM_Name        interpToggleName("interp_toggle","Catmull-Rom Interpolation");
static PRM_Default     interpToggleDefault = PRM_Default(1); 

// normals toggle
static PRM_Name       normalsToggleName("normals_toggle","Normals");
static PRM_Default     normalsToggleDefault = PRM_Default(0); 

// jacobian toggle
static PRM_Name       jacobianToggleName("jacobian_toggle","Jacobian");
static PRM_Default     jacobianToggleDefault = PRM_Default(0); 

PRM_Template
SOP_Ocean::myTemplateList[] = 
{
    PRM_Template(PRM_INT,1,&resolutionName, resolutionDefaults,0,&resolutionRange,oceanChanged),

    PRM_Template(PRM_XYZ,1,&gridName, gridDefaults,0,&gridRange,oceanChanged),

    PRM_Template(PRM_FLT,1,&windspeedName, &windspeedDefault,0,&windspeedRange,oceanChanged),

    PRM_Template(PRM_ANGLE,1,&winddirName,&winddirDefault,0,&winddirRange,oceanChanged),

    PRM_Template(PRM_FLT,1,&smallestName, &smallestDefault,0,&smallestRange,oceanChanged),

    PRM_Template(PRM_FLT,1,&fiddleName, &fiddleDefault,0,&fiddleRange,oceanChanged),

    PRM_Template(PRM_INT,1,&seedName, 0,0,0,oceanChanged),

    PRM_Template(PRM_TOGGLE,1,&chopToggleName, &chopToggleDefault,0,0,oceanChanged), 
示例#14
0
	PRM_Name("velDamp", "Velocity Damping"),
	PRM_Name("vortConf", "Vorticity Confinement"),
	PRM_Name("noiseStr", "Noise Strength"),
	PRM_Name("noiseFreq", "Noise Frequency"),
	PRM_Name("noiseOct", "Noise Octaves"),
	PRM_Name("noiseLacun", "Noise Lacunarity"),
	PRM_Name("noiseSpeed", "Noise Speed"),
	PRM_Name("noiseAmp", "Noise Amplitude"),

	//PRM_Name("emitNum",  "Number of Emitters"),

};

PRM_Template SOP_FluidSolver2D::myTemplateList[] = {
	
	PRM_Template(PRM_XYZ, 3, &names[0], PRMzeroDefaults),		//position
	PRM_Template(PRM_XYZ, 3, &names[1], PRMzeroDefaults),		//rotation

	PRM_Template(PRM_XYZ, 2, &names[2], resDefaults),			//res
	PRM_Template(PRM_INT_XYZ, 3, &names[3], sizeDefaults),		//size

	PRM_Template(PRM_TOGGLE | PRM_TYPE_JOIN_NEXT, 1, &names[4], PRMoneDefaults),	//border-x
	PRM_Template(PRM_TOGGLE, 1, &names[5], PRMoneDefaults),							//border+x
	PRM_Template(PRM_TOGGLE | PRM_TYPE_JOIN_NEXT, 1, &names[6], PRMoneDefaults),	//border-y
	PRM_Template(PRM_TOGGLE, 1, &names[7], PRMoneDefaults),							//border+y

	PRM_Template(PRM_SWITCHER, sizeof(switcherList)/sizeof(PRM_Default), &switcherName, switcherList),

	PRM_Template(PRM_INT, 1, &names[11], PRMoneDefaults, 0, &minOneRange),			//substeps
	PRM_Template(PRM_INT, 1, &names[12], &jacIterDefault,0, &jacIterRange),			//jacIter
    PRM_Template(PRM_INT,	1, &names[13], PRMoneDefaults),							//startframe
示例#15
0
static PRM_Range        oceanDepthRange(PRM_RANGE_RESTRICTED, 0.001, PRM_RANGE_RESTRICTED, 10000.0);
static PRM_Default      oceanDepthDefault(10000.0);

static PRM_Range        seedRange(PRM_RANGE_RESTRICTED, 1, PRM_RANGE_RESTRICTED, 15);
static PRM_Default      seedDefault(1);

static PRM_Range        velocityRange(PRM_RANGE_RESTRICTED, 0.0, PRM_RANGE_RESTRICTED, 30.0);
static PRM_Default      velocityDefault(4.0);

static PRM_Range        loopTimeRange(PRM_RANGE_RESTRICTED, 0.001, PRM_RANGE_UI, 1000.0);
static PRM_Default      loopTimeDefault(1000.0);

PRM_Template aaOceanSOP::myTemplateList[] = 
{   
    PRM_Template(PRM_INT_E, 1, &names[0],  &resolutionDefault,  0, &resolutionRange),       // resolution   // 0
    PRM_Template(PRM_FLT_J, 1, &names[2],  &oceanScaleDefault,  0, &oceanScaleRange),       // oceanScale   // 2
    PRM_Template(PRM_FLT_J, 1, &names[3],  &oceanDepthDefault,  0, &oceanDepthRange),       // oceanDepth   // 3
    PRM_Template(PRM_FLT_J, 1, &names[4],  PRMzeroDefaults,     0, &PRMunitRange),          // surfaceTension// 4
    PRM_Template(PRM_INT_E, 1, &names[1],  &seedDefault,        0, &seedRange),             // seed         // 1
    PRM_Template(PRM_FLT_J, 1, &names[14], PRMzeroDefaults,     0, &PRMscaleRange),         // timeOffset   // 14
    PRM_Template(PRM_FLT_J, 1, &names[15], &loopTimeDefault,    0, &loopTimeRange),         // loop time    // 15

    PRM_Template(PRM_FLT_J, 1, &names[11], PRMoneDefaults,      0, &PRMdivision0Range),     // waveHeight   // 11
    PRM_Template(PRM_FLT_J, 1, &names[5],  &velocityDefault,    0, &velocityRange),         // velocity (Wave Size) //5
    PRM_Template(PRM_FLT_J, 1, &names[10], PRMoneDefaults,      0, &PRMdivision0Range),     // waveSpeed    // 10
    PRM_Template(PRM_FLT_J, 1, &names[12], PRMzeroDefaults,     0, &PRMrolloffRange),       // chop         // 12
    PRM_Template(PRM_FLT_J, 1, &names[6],  PRMzeroDefaults,     0, &PRMdivision0Range),     // cutoff (Wave Smooth) // 6

    PRM_Template(PRM_FLT_J, 1, &names[7],  PRMzeroDefaults,     0, &PRMangleRange),         // windDir      // 7
    PRM_Template(PRM_FLT_J, 1, &names[9],  PRMzeroDefaults,     0, &PRMunitRange),          // damp         // 9
示例#16
0
//Gets node description data
const SIM_DopDescription* SIM_SnowSolver::getDescription(){
	//TODO: maybe move some of the particles attributes into SIM data fields instead of having them attached to particles?
	
	/* Particle parameters (lagrangian):
		We will just use the default point attribute "P" for particle position;
		
		Also, we can just use temporary matrices for SVD/Polar Decomp/Velocity Grad,
		since they get recomputed at each timestep anyways. If we split this up into
		multiple sub-solver nodes, we'd need to make them particle attributes.
	*/
	static PRM_Name p_field(MPM_PARTICLES, "Particles");			//particles
	static PRM_Name p_fe(MPM_P_FE, "Fe Attr");					//particle elastic deformation gradient
	static PRM_Name p_fp(MPM_P_FP, "Fp Attr");					//particle plastic deformation gradient
	static PRM_Name p_vel(MPM_P_VEL, "Velocity Attr");			//particle velocity
	static PRM_Name p_vol(MPM_P_VOL, "Volume Attr");				//particle volume
	static PRM_Name p_d(MPM_P_D, "Density Attr");					//particle density
	//It may be better to remove these, if recomputing these values is actually faster than caching
	static PRM_Name p_w(MPM_P_W, "Weights Attr");					//particle weight (for each node within 2-node radius)
	static PRM_Name p_wg(MPM_P_WG, "Weight Gradients Attr");		//particle weight gradient (for each node within 2-node radius)

	//Grid parameters (eulerian):
	static PRM_Name g_mass(MPM_G_MASS, "Mass Field");				//grid mass
	static PRM_Name g_nvel(MPM_G_NVEL, "New Velocity Field");		//grid velocity (after applying forces)
	static PRM_Name g_ovel(MPM_G_OVEL, "Old Velocity Field");		//grid velocity (before applying forces)
	static PRM_Name g_active(MPM_G_ACTIVE, "Activated Field");	//boolean field that tells whether there are particles within a radius of 2
	static PRM_Name g_density(MPM_G_DENSITY, "Density Field");	//grid density
	static PRM_Name g_col(MPM_G_COL, "Collision Field"); 			// grid collision
	static PRM_Name g_colVel(MPM_G_COLVEL, "Collision Velocity Field"); 			// grid collision velocity
	static PRM_Name g_extForce(MPM_G_EXTFORCE, "External Force Field"); //grid external forces

	static PRM_Name parm_p_mass(MPM_P_MASS, "Particle Mass");
	static PRM_Name parm_youngs_modulus(MPM_YOUNGS_MODULUS, "Youngs Modulus");
	static PRM_Name parm_poissons_ratio(MPM_POISSONS_RATIO, "Poissons Ratio");
	static PRM_Name parm_crit_comp(MPM_CRIT_COMP, "Critical Compression");
	static PRM_Name parm_crit_stretch(MPM_CRIT_STRETCH, "Critical Stretch");
	static PRM_Name parm_flip_percent(MPM_FLIP_PERCENT, "Flip Percent");
	static PRM_Name parm_hardening(MPM_HARDENING, "Hardening");
	static PRM_Name parm_cfl(MPM_CFL, "CFL");
	static PRM_Name parm_cof(MPM_COF, "COF");
	static PRM_Name parm_div_size(MPM_DIV_SIZE, "Division Size");
	static PRM_Name parm_max_vel(MPM_MAX_VEL, "Maximum Velocity");

	static PRM_Name parm_gravity(MPM_GRAVITY, "Gravity");
	static PRM_Name parm_bbox_min(MPM_BBOX_MIN, "BBox Min");
	static PRM_Name parm_bbox_max(MPM_BBOX_MAX, "BBox Max");

	static PRM_Template theTemplates[] = {
		//particles
		PRM_Template(PRM_STRING, 1, &p_field),
		PRM_Template(PRM_STRING, 1, &p_fe),
		PRM_Template(PRM_STRING, 1, &p_fp),
		PRM_Template(PRM_STRING, 1, &p_vel),
		PRM_Template(PRM_STRING, 1, &p_vol),
		PRM_Template(PRM_STRING, 1, &p_d),
		PRM_Template(PRM_STRING, 1, &p_w),
		PRM_Template(PRM_STRING, 1, &p_wg),
		//grid
		PRM_Template(PRM_STRING, 1, &g_mass),
		PRM_Template(PRM_STRING, 1, &g_nvel),
		PRM_Template(PRM_STRING, 1, &g_ovel),
		PRM_Template(PRM_STRING, 1, &g_active),
		PRM_Template(PRM_STRING, 1, &g_density),
		PRM_Template(PRM_STRING, 1, &g_col),
		PRM_Template(PRM_STRING, 1, &g_colVel),
		PRM_Template(PRM_STRING, 1, &g_extForce),
		//constants
		PRM_Template(PRM_FLT_J, 1, &parm_p_mass),
		PRM_Template(PRM_FLT_J, 1, &parm_youngs_modulus),
		PRM_Template(PRM_FLT_J, 1, &parm_poissons_ratio),
		PRM_Template(PRM_FLT_J, 1, &parm_crit_comp),
		PRM_Template(PRM_FLT_J, 1, &parm_crit_stretch),
		PRM_Template(PRM_FLT_J, 1, &parm_flip_percent),
		PRM_Template(PRM_FLT_J, 1, &parm_hardening),
		PRM_Template(PRM_FLT_J, 1, &parm_cfl),
		PRM_Template(PRM_FLT_J, 1, &parm_cof),
		PRM_Template(PRM_FLT_J, 1, &parm_div_size),
		PRM_Template(PRM_FLT_J, 1, &parm_max_vel),
		//vector constants
		PRM_Template(PRM_XYZ, 3, &parm_gravity),
		PRM_Template(PRM_XYZ, 3, &parm_bbox_min),
		PRM_Template(PRM_XYZ, 3, &parm_bbox_max),
		//what is this for ???
		PRM_Template()
	};

	static SIM_DopDescription desc(
		true,					// true, to make this node a DOP
		"hdk_SnowSolver",		// internal name
		"Snow Solver",			// node label
		"Solver",				// data name (for details view)
		classname(),			// type of this dop
		theTemplates			// input parameters
	);
	return &desc;
}