Generate mapping coords by default and assign materials automatically
March 21, 2010Is there a way in which the “Generate Mapping Coordinates” would be switch on automatically when you create objects, splines, modifications, Extrude, Sweep and etc.?
For example on VrayMtl:
global dmat
fn defaultmat=(
(
mybitmap=“Path to your bitmap file”
mytexmap=BitmapTexture filename:mybitmap filtering:1
dmat=VRayMtl Name:”White” Diffuse:(color 210 210 210) reflection_subdivs:16 reflection_fresnel:on texmap_bump:mytexmap effectsChannel:8
showTextureMap dmat mytexmap true
)
)
calbScr=”if objects.count!=0 then (newNode=objects[objects.count]\n”
calbScr+=”dmat=sceneMaterials[\"White\"]\n”
calbScr+=”if (newNode.material==undefined) do (\n”
calbScr+=”if dmat==undefined or (classof dmat != VRayMtl) do (defaultmat())\n”
calbScr+=”newNode.material=dmat\n))\n”callbacks.addScript #filePostOpen “dmat=sceneMaterials[\"White\"];if dmat==undefined do defaultmat()” id:#VGCreate
callbacks.addScript #sceneNodeAdded calbScr id:#VGCreate
Place text in Notepad with extension “ms” and save to directory scripts\startup





