Hi Everyone,
I have a MaxScript problem (in 3DS max 2017), where the background keeps getting resized. I’m simply trying to render a foreground object composited against the viewport background (a bitmap). In the MaxScript script example shown below, the background is this bitmap:
The foreground object is 3D model of a horse (read from a .OBJ file). I want the horse to be rendered against the meadow with no change in the background. Instead, the background keeps getting resized like this:
I am mindful that this problem may be because the Environment Map is set to some value other than ‘screen’. I tried to set the Environment Map to ‘screen’ manually in 3DS Max as described here:
The manual setting itself seems to go fine, but when I run the MaxScript script, the background keeps getting resized. On the other hand, I was not able to find any way of setting the Environment Map value to 'screen' within MaxScript itself.
Can someone please help?
Thank you very much,
Jay
---------------------- MaxScript Script Example ---------------------------------------------
resetMaxFile #noPrompt
importFile "c:/test/horse-obj.obj" #noPrompt
environmentMap = bitmapTexture filename:"c:/test/meadow.jpg"
cam=Targetcamera pos:[10,-600,0] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [-10,-10,0]))
savefile = ("c:/test/hose_meadow_composite.jpg")
render camera:cam outputFile:savefile rendSimplifyAreaLights: true vfb:off
-------------------------------------------------------------------------------------------------------
Solved! Go to Solution.
Solved by Swordslayer. Go to Solution.
Oh well, here you go:
environmentMap.coordinates.mappingType = 1 environmentMap.coordinates.mapping = 3
Thank you very much, Swordslayer! Your fix fully solved my problem!
jhegde