A graphical special is an object that Snappers have. It's usually used to further modify the current 3D model of a Snapper at a mesh level.
Assigning a graphical special
Call setGraphicalSpecial()
. The first boolean argument is setting it to use graphical specials, and the next boolean is to set the graphical specials detail level.
FetchEnv
. This is because we are now editing the model at the mesh level, and the base mesh itself is what you are modifying on top of.
How to modify the meshes
When the Snapper
has a graphical special, fetch3D()
of the Snapper
will use the Editable3D
's get3D()
. From here, Editable3D
will now make use of the meshes
field in order to create the 3D, and it is in this meshes
field where we can make our adjustments.
Each mesh can also have it's userMaterial
, material
, textureSpace
, layerExpr
, doubleSided
be set with using propDefs (code in the EditableDrawProxy):
/** * Get 3D */ extend public Primitive3D get3D(Editable3D z3D, Object owner, FetchEnv3D env) { Primitive3D[] prims(); if (z3D) { str->int picks(); for (mesh in z3D.meshes, index=index) if (!z3D.isHidden(mesh)) { if (mesh) { TriMeshF3D t(mesh); Material3D mMaterial = mesh.get(#"userMaterial").Material3D; if (!mMaterial) mMaterial = mesh.get(#"material").Material3D; TextureSpace3D ts = mesh.get(#textureSpace).TextureSpace3D; LayerExpr mLayer = mesh.get(#"layerExpr").LayerExpr; Bool mDouble = mesh.get(#"doubleSided").Bool; t.setMaterial(mMaterial); if (ts) t.setTextureSpace(ts); t.layer = mLayer; if (mDouble) t.setDoubleSided(mDouble.v); t.setOwner(ExtendedPickSurface(owner, t, z3D.meshId(mesh, picks).toS, mesh)); prims << t; } } } return safeSet3D(prims); }
You can also access the Editable3DTree to modify the mesh tree of the model.
Comments
0 comments
Please sign in to leave a comment.