Porting your code to SeExpr v3Generation

Name and Namespace Changes

In order to allow both older and newer versions of SeExpr to coexist, we renamed all classes and added an 'SeExpr2' namespace. Refer to the table below for renaming the SeExpr classes in your code.

Was Becomes
SeExpression SeExpr2::Expression
SeExprEditor ExprEditor
SeExprEd*Editable *Editable
SeExprEdExpressionTextEdit ExprTextEdit
SeExprEdPopupDocumentation ExprPopupDoc
SeExprEd* Expr*
SeExpr* SeExpr2::Expr*
SeVec3d

using Vec3d = SeExpr2::Vec<double,3>;

using Vec3dRef= SeExpr2::Vec<double,3,true>;

SeCurve SeExpr2::Curve
#include <SeExprEdEditable*.h> #include <SeExpr2/ui/Editable*.h>
#include <SeExprEd*.h> #include <SeExpr2/ui/Expr*.h>
#include <SeExpr*.h> #include <SeExpr2/Expr*.h>
prep() prep() and also define new evalConstant() method, for custom functions
eval() evalFP(), for custom functions
SeExpr::clamp SeExpr2::clamp
expreditor // internal Disney Maya plugin expreditor2

Checking Variable Typing in Custom Functions

If you've written any custom functions, you'll be checking variable types in your prep() method, eg:

bool valid=true;
valid &= node->checkArg(0, ExprType().FP(3).Constant(), envBuilder);

Variable types are defined in SeExpr2::ExprType():

Defining Variables in Derived Expression Classes

If you've created a custom Expression class, and have defined your own variable struct within that class, you will want it to inherit from ExprVarRef. Some of the changes include:

Here is an example of a simple expression variable reference:

struct MyVar : public ExprVarRef {
    double value;
    Var() : ExprVarRef(TypeVec(1).Varying()) {}
    void eval(double* result) {result[0] = value;}
    void eval(const char**) {}

Using ExprFuncSimple to Write Custom Functions

See How to Write an Expression Function and Plugin

Changes to Build Files

kida:

cmake: