Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Environment background scale problem in MaxScript

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
716 Views, 2 Replies

Environment background scale problem in MaxScript

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:

 

meadow.jpg

 

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:

 

hose_meadow_composite00.jpg

 

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:

 

http://forums.autodesk.com/t5/3ds-max-3ds-max-design-general/environment-background-scale-problem/m-...

 

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

 

-------------------------------------------------------------------------------------------------------

2 REPLIES 2
Message 2 of 3
Swordslayer
in reply to: Anonymous
Message 3 of 3
Anonymous
in reply to: Swordslayer

Thank you very much, Swordslayer!  Your fix fully solved my problem!

 

jhegde

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report