Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.
polyGeoSampler [-alphaBlend string] [-averageColor] [-clampAlphaMax float] [-clampAlphaMin float] [-clampRGBMax float float float] [-clampRGBMin float float float] [-colorBlend string] [-colorDisplayOption] [-computeShadows] [-displaceGeometry] [-flatShading] [-ignoreDoubleSided] [-lightingOnly] [-reuseShadows] [-sampleByFace] [-scaleFactor float] [-shareUV] [-useLightShadows]
polyGeoSampler is undoable, NOT queryable, and editable.
This command performs a render sampling of surface color and transparency for each selected vertex or face and stores the sampled data as either the color value, or uses the sampled data to displace the affected vertices or faces by a sampled data value. Transparency is not used for displacement, and displacement is performed along vertex normals. The sampled data value used can be pre-scaled by a user defined amount. Additionally, the normals chosen for sampling can be overridden using a "flat" shading option. This option basically means to always use the normals of the faces when computing sampling values. This may be a desired if the user wishes to override an edge smoothness factor. Basically with the "flat" shading option on, edges are always considered to be hard. Note that displacement sampling will result in the -sampleByFace option to be turned off, since a displacement of a vertex always affects the faces the vertex is connected to. Finally, it is possible to force the storage of shared colors per vertex, and / or force the usage of unshared UV values. The computation of the resulting color is as follows:resulting-RGB = (sampled-RGB * scale-factor); if (color blend is none) resulting-RGB = geometry-RGB else if (color blend is add) resulting-RGB = geometry-RGB + sampled-RGB; else if (color blend is subtract) resulting-RGB = geometry-RGB - sampled-RGB; else if (color blend is multiply) resulting-RGB = geometry-RGB * sampled-RGB; else if (color blend is divide) resulting-RGB = geometry-RGB / sampled-RGB; else if (color blend is average) resulting-RGB = (geometry-RGB * 1/2) + (sampled-RGB * 1/2); if (clamp option set) clamp resulting-RGB between minimum-RGB and maximum-RGB,The analogous computation is done for computing the resulting alpha value. The command requires that there be a camera selected in your scene in order to work properly in -batch or -prompt mode.
boolean | Success or Failure |
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
-alphaBlend(-abl)
|
string
|
|||
|
||||
-averageColor(-ac)
|
|
|||
|
||||
-clampAlphaMax(-amx)
|
float
|
|||
|
||||
-clampAlphaMin(-amn)
|
float
|
|||
|
||||
-clampRGBMax(-cmx)
|
float float float
|
|||
|
||||
-clampRGBMin(-cmn)
|
float float float
|
|||
|
||||
-colorBlend(-cbl)
|
string
|
|||
|
||||
-colorDisplayOption(-cdo)
|
|
|||
|
||||
-computeShadows(-cs)
|
|
|||
|
||||
-displaceGeometry(-dg)
|
|
|||
|
||||
-flatShading(-fs)
|
|
|||
|
||||
-ignoreDoubleSided(-ids)
|
|
|||
|
||||
-lightingOnly(-lo)
|
|
|||
|
||||
-reuseShadows(-rs)
|
|
|||
|
||||
-sampleByFace(-bf)
|
|
|||
|
||||
-scaleFactor(-sf)
|
float
|
|||
|
||||
-shareUV(-su)
|
|
|||
|
||||
-useLightShadows(-ul)
|
|
|||
|
Flag can appear in Create mode of command | Flag can appear in Edit mode of command |
Flag can appear in Query mode of command | Flag can be used more than once in a command. |
// Example 1. Sample for color values. // a. No arguments. Will perform sampling of color + transparency at // the vertex level, and store color values for affected vertices. // No shadows will be computed. polyGeoSampler; // b. With shadows and illumination only polyGeoSampler -lightingOnly -computeShadows; // c. Sampling only complete selected faces polyGeoSampler -sampleByFace; // d. "Flat shading". // Example 2. Sample for displacement values. // a. Using displace option polyGeoSampler -displaceGeometry; // Example 3. Scaling the sampled data. // a. Scaling option polyGeoSampler -scaleFactor 0.1; // Example 4. Don't force unshared UV value usage, and force // the storage of shared colors for vertices. polyGeoSampler -shareUV -averageColor; // Example 5. Clamping colors. In this example the alpha and // RGB channels of the colors are clamped between a min of 0,0,0,1 // and a max of 1,2,1,0.5 . polyGeomSampler -amn 0.0 -amx 0.5 -cmn 0.0 0.0 0.0 -cmx 1.0 2.0 1.0; // Example 6. Multiply the new sample color values with the existing // colors stored on the geometry, but leave the alpha values // as they were on the geometry. polyGeomSampler -colorBlend "multiply" -alphaBlend "none";