Skip to content

Instantly share code, notes, and snippets.

View 3dAsmol79's full-sized avatar

Felix 3dAsmol79

  • Freelancer
  • Australia
View GitHub Profile
@3dAsmol79
3dAsmol79 / Apply UVW Map Modifier with Real World Scale Box.ms
Last active June 30, 2018 14:26
MaxScript: Apply UVW Map Modifier with Real World Scale Box
(
UvwRws = Uvwmap()
UvwRwsObjs = selection as array
for i = 1 to UvwRwsObjs.count do
(
addModifier UvwRwsObjs[i] (UvwRws)
UvwRwsObjs[i].modifiers[#UVW_Map].maptype = 4
UvwRwsObjs[i].modifiers[#UVW_Map].realWorldMapSize = on
UvwRwsObjs[i].modifiers[#UVW_Map].utile = 1
UvwRwsObjs[i].modifiers[#UVW_Map].vtile = 1
@3dAsmol79
3dAsmol79 / MaxScript - Mesh Collapse.ms
Last active July 2, 2018 15:50
MaxScript - Collaspe Imported Mesh to reduce Non-Smooth faces and Reset UVW Map Scaling. Also adds Centred Pivot to Base
(
MeshColSmoothMod = SmoothModifier()
MeshCollobjs = selection as array
for i = 1 to MeshCollobjs.count do
(
ConvertToMesh MeshCollobjs[i]
addModifier MeshCollobjs[i] (MeshColSmoothMod)
MeshCollobjs[i].modifiers[#Smooth].autoSmooth = False
MeshCollobjs[i].modifiers[#Smooth].preventIndirect = False
ConvertToMesh MeshCollobjs[i]
@3dAsmol79
3dAsmol79 / MaxScript - Attach Selection .ms
Last active July 2, 2018 15:50
MaxScript - Attach Selected - modified from Blur scripts to have centred pivot at base and zoom selected.
(
if selection.count >= 2 then
(
objs = for i in selection collect i
disableSceneRedraw()
try
(
main_obj = objs[1]
convertTo main_obj TriMeshGeometry
progressStart "Make Unique"
@3dAsmol79
3dAsmol79 / MaxScript - Random Wire Color to Selection.ms
Created July 2, 2018 15:41
MaxScript - Makes the current selections Wire Color Random - Easy to differentiate objects from imported models
on btn_RandomWireColour pressed do
(
RanWireObjs = selection as array
for i = 1 to RanWireObjs.count do
RanWireObjs[i].wirecolor = color (random 0 255) (random 0 255) (random 0 255)
)
@3dAsmol79
3dAsmol79 / MaxScript - Make a new layer and make it current.ms
Last active July 11, 2018 07:01
MaxScript - Make a new layer and make it current
if LayerManager.getLayerFromName layerName0001SiteContext == undefined then
layer = LayerManager.newLayerFromName "0001_Site_Context"
lpi = layerManager.getLayerFromName "0001_Site_Context"
lpi.current = true