miauu's Script Pack vol.2


#61

Nice!


#62

Thank you.


#63

miauu’s Script Pack vol.2 version 6.1 is available.

Changelog:

  • added “Extrude each edge separately along the spline” to Extrude Open Edges script.

#64

miauu’s Script Pack vol.2 version 6.2 is available.

Changelog:

Changelog:

  • New script is added: “miauu’s Align To Axis”. It allows you to select an edge and then to align the whole object to world X, Y, Z axis matching that edge.

#65

miauu’s Script Pack vol.2 version 6.5 is available

Changelog:

  • Inset Pro: fixed a bug when verts are off the face’s plane

#66

miauu’s Script Pack vol.2 version 6.6 is available

Changelog:

  • Easy Peel: fixed a bug when Use Map channel is set to other than 1.

#67

Hi Miaa, quick question about your viewport grab script.

(
local grab_viewpBMP
local defaultVbkgColor
local grab_alphaBMP
local tempBMP
local viewport_name
local mfn
local gct
local bmp_name
local winSizeX = gw.getWinSizeX() as float
local winSizeY = gw.getWinSizeY() as float
local ratio = (winSizeX/winSizeY)
(
–//// credits to Borislav “Bobo” Petrov (MaxScript reference)
– get viewport name
viewport_name = viewport.GetType() as string
– cut the string
viewport_name = substring viewport_name 6 (viewport_name.count-5)
if viewport_name == “camera” then – if the remaining string is “camera”
(
gac = getActiveCamera() – get the camera
viewport_name = gac.name – get the name of the camera
)
– get max file name
mfn = MaxFileName
if mfn == “” then – if there is no name
mfn = “Untitled” – use “Untitled”
else
mfn = getFileNameFile mfn – use the file name without .MAX extension
– build the output file name
bmp_name = mfn +"" +viewport_name
– Display file save dialog
outputDir = maxfilepath
Prefix = “.jpg”
bmp_name = (outputDir + mfn +"
" + viewport_name + Prefix)
– bmp_name = getSaveFileName caption:“Save Viewport to:” filename:bmp_name
– types:“JPG(.jpg)|.jpg|PNG(.png)|.png|BMP(.bmp)|.bmp|”
–////
if bmp_name != undefined then – if user has confirmed / entered a valid name
(
– store the viewport height and width
curVPheight = gw.getWinSizeY()
curVPwidth = gw.getWinSizeX()
– expand the viewport
forcecompleteredraw dodisabled:true
theHold.begin()
– grab the viewport
grab_viewpBMP = gw.getViewportDib()
– make all visible objects white
for o in objects where not o.isHidden do
(
o.displayByLayer = false
o.showVertexColors = true
)
– save the default viewport color
defaultVbkgColor = GetUIColor 41
– set the viewport color to pure black
SetUIColor 41 ((color 0 0 0) as Point4)
colorMan.repaintUI #repaintAll
– grab the bitmap that will be used as alpha channel
grab_alphaBMP = gw.getViewportDib()
theHold.cancel()
SetUIColor 41 defaultVbkgColor
colorMan.repaintUI #repaintAll
–//// credits to DaveWortley.
–create new temporary bitmap
tempBMP = bitmap grab_viewpBMP.width grab_viewpBMP.height
for i = 1 to grab_viewpBMP.height do
(
AR_thepixels_A = Getpixels grab_viewpBMP [0,i] grab_viewpBMP.width
AR_thepixels_B = Getpixels grab_alphaBMP [0,i] grab_alphaBMP.width
for j = 1 to AR_thepixels_A.count do
(
alfaVal = 0.0
if AR_thepixels_B[j] == (color 0 0 0) do
(
swap AR_thepixels_A[j].a alfaVal
)
)
setpixels tempBMP [0,i] AR_thepixels_A
)
–close the original images so we can overwrite them
close grab_viewpBMP
close grab_alphaBMP
–////
tempBMP.filename = bmp_name – set output name to the one entered in the save file dialog
save tempBMP
Close tempBMP
grab_viewpBMP = undefined
grab_alphaBMP = undefined
tempBMP = undefined
----- open folder
process = dotNetObject “System.Diagnostics.Process”
process.EnableRaisingEvents = false
process.StartInfo.FileName = “explorer”
process.StartInfo.Arguments = outputDir
process.Start()
)
freeSceneBitmaps()
gc()
– restore the viewport
gw.setPos 0 0 curVPwidth curVPheight
forcecompleteredraw dodisabled:true
)
)

Is there a way for screenshots to be saved incrementally instead of overwriting the previous filename? Sometimes Im taking 3 screengrabs but have to rename the previous on first as to not overwrite it. Thank you


#68

Visit the scriptspot page of the script: http://www.scriptspot.com/3ds-max/scripts/grab-viewport-with-alpha-channel
and download version 1.2. It will add the year, month, day, hour, minute, second as a suffix to the name of the created image.


#69

Thank you so much. :slight_smile: