ShapeMap : textureMap

ShapeMap - superclass: textureMap; super-superclass:material - 35:0 - classID: #(1917470054L, 1344173505L)

   

NEW in 3ds Max 2017: This texture map can render one or more scene shape objects into a procedural texture map.

   

Constructor:

ShapeMap...

   

Properties:

Parameters Rollout

Filtering Group Of Controls

<ShapeMap>.filter     BooleanClass    default: true   --  boolean

Get/set the state of the "Filter Result" checkbox.

   

<ShapeMap>.mipmap     BooleanClass    default: true   --  boolean

Get/set the state of the "Mip Mapping" checkbox.

   

Cropping / Placement Group Of Controls

<ShapeMap>.applycrop     BooleanClass    default: false   --  boolean

Get/set the state of the "Apply" checkbox.

   

<ShapeMap>.croporplace     Integer    default: 0   --  integer

Get/set the state of the "Crop / Place" radio buttons.

Possible values are:

0 - Crop (default)

1 - Place

   

<ShapeMap>.crop_u     Float    default: 0.0   --  animatable; float; Clip_U_Offset

Get/set the value of the "U" spinner.

   

<ShapeMap>.crop_v     Float    default: 0.0   --  animatable; float; Clip_V_Offset

Get/set the value of the "V" spinner.

   

<ShapeMap>.crop_w     Float    default: 1.0   --  animatable; float; Clip_U_Width

Get/set the value of the "W" spinner.

   

<ShapeMap>.crop_h     Float    default: 1.0   --  animatable; float; Clip_V_Width

Get/set the value of the "H" spinner.

   

<ShapeMap>.Jitter     BooleanClass    default: false   --  Boolean

Get/set the state of the "Jitter" checkbox.

Used only when .croporplace is set to 1 – Place.

   

<ShapeMap>.jitteramt     Float    default: 1.0   --  animatable; float; Jitter_Placement

Get/set the value of the "Jitter" spinner.

Used only when .croporplace is set to 1 – Place.

   

Mono Channel Output Group Of Controls

<ShapeMap>.monoOutput     Integer    default: 1   --  integer

Get/set the state of the "Mono Channel Output" radio buttons.

Possible values are:

0 - RGB Intensity

1 - Alpha (default)

   

RGB Channel Output Group Of Controls

<ShapeMap>.rgbOutput     Integer    default: 0   --  integer

Get/set the state of the "RGB Channel Output" radio buttons.

Possible values are:

0 - RGB (default)

1 - Alpha as Gray

   

Alpha Source Group Of Controls

<ShapeMap>.alphasource     Integer    default: 2   --  integer; Alpha_Source

Get/set the state of the "Alpha Source" radio buttons.

Possible values are:

0 - Image Alpha

1 - RGB Intensity

2 - None (Opaque) (default)

   

Shape Parameters Rollout

<ShapeMap>.shapeobject     UndefinedClass    default: undefined   --  node

Get/set the shape object used to generate the map.

Corresponds to the "Shape Object" pickbutton in the UI.

Any valid shape object is acceptable, including the legacy Text shape.

TextPlus is not a shape node - see the TextMap : TextureMap class for creating textures using the TextPlus object.

   

<ShapeMap>.usefillcolor     BooleanClass    default: true   --  boolean

Get/set the state of the "Fill Color" checkbox.

   

<ShapeMap>.fillcolor    Color    default: (color 0 0 255)   --  animatable; RGB color; Controller Scaling: ([1,1,1] : (color 255 255 255))

Get/set the value of the "Fill Color" color.

   

<ShapeMap>.outlinecolor     Color    default: (color 0 0 0)   --  animatable; RGB color; Controller Scaling: ([1,1,1] : (color 255 255 255))

Get/set the value of the "Line Color" color.

   

<ShapeMap>.bgcolor    Color    default: (color 255 255 255)   --  animatable; RGB color; Controller Scaling: ([1,1,1] : (color 255 255 255))

Get/set the value of the "Background Color" color.

   

<ShapeMap>.fillbg     BooleanClass    default: true   --  boolean

Get/set the state of the "Fill Background" checkbox.

   

Open Shapes Group Of Controls

<ShapeMap>.renderopen     BooleanClass    default: true   --  boolean

Get/set the state of the "Render" checkbox.

   

<ShapeMap>.endtype     Integer    default: 0   --  integer

Get/set the state of the "Open Shapes (End Type)" radio buttons.

Possible values are:

0 - Square Ends (default)

1 - Rounded Ends

   

Closed Shapes Group Of Controls

<ShapeMap>.filledclosed     BooleanClass    default: true   --  boolean

Get/set the state of the "Render Fill" checkbox.

   

<ShapeMap>.outlinedclosed     BooleanClass    default: false   --  boolean

Get/set the state of the "Render Outline" checkbox.

   

<ShapeMap>.stricthierarchy     BooleanClass    default: false   --  boolean

Get/set the state of the "Strict Hierarchy" checkbox.

   

Outlines Group Of Controls

<ShapeMap>.outlinewidth     Float    default: 1.0   --  animatable; float

Get/set the value of the "Width" spinner.

It defines the thickness of the outlines.

   

Hierarchies" Group Of Controls

<ShapeMap>.renderchildren     BooleanClass    default: false   --  boolean

Get/set the state of the "Render Children" checkbox.

   

<ShapeMap>.renderroot    BooleanClass    default: true   --  boolean

Get/set the state of the "Render Root" checkbox.

   

<ShapeMap>.mergeshapes     BooleanClass    default: false   --  boolean

Get/set the state of the "Merge Shapes" checkbox.

   

Map Boundary Group Of Controls

<ShapeMap>.boundstype     Integer    default: 0   --  integer; _BoundsType

Get/set the state of the "Map Boundary" radio buttons.

Possible values are:

0 - Shape Bounds (default)

1 - Manual

2 - Pick

   

<ShapeMap>.manualwidth     Float    default: 100.0   --  float

Get/set the value of the "Width" spinner.

Used only when .boundstype is set to 1 – Manual.

   

<ShapeMap>.manualheight     Float    default: 100.0   --  float; ManualHeeight

Get/set the value of the "Height" spinner.

Used only when .boundstype is set to 1 – Manual.

   

<ShapeMap>.boundsobject     UndefinedClass    default: undefined   --  node

Get/set the scene objects to define the bounds.

Used only when .boundstype is set to 2 – Pick.

   

<ShapeMap>.hwbitmapsize     Integer    default: 256   --  integer

Get/set the value of the "HW Bitmap size" slider.

Controls the size of the hardware bitmap used for viewport display.

   

Coordinates Rollout

<ShapeMap>.coords     StandardUVGen    default: MtlBase:Placement   --  maxObject; Coordinates; SubAnim

See UVGenClass class for related properties.

   

Not Exposed To The UI

<ShapeMap>.output    StandardTextureOutput    default: MtlBase:Output   --  maxObject; SubAnim

See TexOutputClass class for related properties.

ShapeMap interfaces:

Interface: IMtlRender_Compability_MtlBase

   

Properties:

   

Methods:

   

Actions:

   

EXAMPLE:

(
resetMaxFile #noprompt --reset the scene
theRadius=10.0 --base circle radius in world units
theThickness=3.0 --outline thickness in pixels
c1 = circle radius:theRadius pos:[0,0,0] adaptive:true --base circle

dist = theRadius
for i = 0 to 360 by 60 do --draw 6 circles at distance equal to the radius, and parent to the base
  c2 = circle radius:theRadius pos:[dist*(cos i),dist*(sin i),0] adaptive:true parent:c1

dist = 2*theRadius*(sin 60)
for i = 30 to 360 by 60 do --draw 6 more circles at the intersections of the previous 6, and parent to the base
  c2 = circle radius:theRadius pos:[dist*(cos i),dist*(sin i),0] adaptive:true parent:c1

dist = 2*theRadius
for i = 0 to 360 by 60 do --draw 6 circles at distance 2*radius, and parent to the base
  c2 = circle radius:theRadius pos:[dist*(cos i),dist*(sin i),0] adaptive:true parent:c1

sm = shapeMap() --create a shape map
meditMaterials[1] = sm --display it in the first slot of the material editor 
matEditor.mode = #basic --set the material editor to compact mode
matEditor.open() --open the material editor if it is not open yet
sm.shapeobject =  c1 --set the shape of the map to the base circle
sm.renderroot = true --enable both the root...
sm.renderchildren = true --...and the children of the hierarchy to render

sm.outlinecolor = yellow --set the line color to yellow
sm.bgcolor = color 0 128 255 --set the background to sky blue
sm.filledclosed = false --disable the filling of closed shapes
sm.outlinedclosed = true --enable the outlines of closed shapes
sm.outlinewidth = theThickness --set the outline thickness in pixels

sm.boundstype = 1 --switch to manual bounds
theSize = 6*theRadius --calculate the size of the bitmap as 6 times the radius
theSize+= theSize*0.01 --add 1% padding
sm.manualwidth = sm.manualheight = theSize --set the width and height to the same value

smat = standard() --create a standard material
smat.diffusemap = sm --set the shapeMap in the diffuse map slot
p = plane width:200 length:200 pos:[200,0,0] --create a plane primitive
p.material = smat --assign the material
showTextureMap smat sm true --show the map in the viewport

bm = bitmap 1024 1024 --create a bitmap
renderMap sm into:bm --render the texture into the bitmap
display bm --display the bitmap

max zoomext sel all
)