Hi, i just installed max 2024 and some scripts aren't working anymore. I wanted to try and use chatgpt to help me create scripts, but it struggles with the coronabitmap and physmaterial. Has something changed in regards to maxscript in corona v11 and where can I find documentation for what the different things are called in maxscript?
I have tried enabling macro recorder and running stuff in max that should do things with coronabitmaps (like the converter), but sadly it doesn't show anything. Also tried google and chaos doc here, but it's not as complete as I had hoped:
https://docs.chaos.com/display/CRMAX/MAXScriptWanted a script like the image plane maker / plane plus scripts, but with some tweaks and having it work in 2024 (none of them does for me, but worked fine in 2023). So I tried this, but it gives errors regarding the coronabitmap and coronaphys material:
-- Function to create a plane from a bitmap's dimensions
fn createPlaneFromBitmap bitmap_file =
(
-- Load the bitmap to get its dimensions
local theBitmap = openBitmap bitmap_file
-- Create a new plane with exact dimensions as the bitmap
local newPlane = Plane width:theBitmap.width length:theBitmap.height name:(getFilenameFile bitmap_file) position:[0,0,0] isSelected:true
-- Segmentation of the plane - You may comment out or delete these lines if you don't need segments
newPlane.widthsegs = 1 -- No segmentation based on your requirement
newPlane.lengthsegs = 1
-- Setup Corona Physical Material with the bitmap as a diffuse map
local coronaPhysicalMtl = CoronaPhysicalMtl()
local correBitmap = CoronaBitmap texmap:theBitmap.filename realWorldMapSize:true
coronaPhysicalMtl.diffusemap = correBitmap
-- Close the bitmap as we no longer need it open
close theBitmap
-- Assign material to the plane
newPlane.material = coronaPhysicalMtl
-- Select only the newly created plane
select newPlane
-- Zoom Extents Selected in active viewport
actionMan.executeAction 0 "40021"
newPlane -- return the plane object
)
-- Function to prompt the user to select a bitmap file and create a plane
fn loadBitmapAndCreatePlane =
(
local bitmapFilePath = getOpenFileName caption:"Load Bitmap File" types:"Image Files|*.bmp;*.jpg;*.jpeg;*.png;*.tif;*.tiff;*.gif|All Files|*.*||"
if bitmapFilePath != undefined do
(
createPlaneFromBitmap bitmapFilePath
)
)
-- Run the function to load bitmap and create plane
loadBitmapAndCreatePlane()