_settings.file_format = 'PNG'Ĭam.rotation_euler = mathutils.Euler((0, 0, 0)) import bpyĬam_data = ('SkyBoxCamera')Ĭam = ('SkyBoxCamera', cam_data)īpy._x = imageSizeīpy._y = imageSize You can set destination folder and image size right in the script. Then assign each of the textures to the corresponding slots, and you're done.Īfter visiting this page I made a small python script that creates the camera and renders all 6 images. Then, create a new Material asset, and in the inspector, set the Shader to "Skybox/6 Sided". Bring up each texture in the inspector, and make sure that Texture Type is set to Texture, and that Wrap Mode is set to Clamp. Import each of the textures (which should be named according to direction). Then rotate the camera 180 degrees to point downwards (exact rotation is 0,0,0) and render that as the "Down" texture.Īfter that, fire up the Unit圓D editor. Rotate the camera 90 degrees to point upwards (exact rotation should be 180,0,0), and render that as the "Up" texture. Rotate 90 degrees counterclockwise again, and then you're back at the starting position. Rotate 90 degrees counterclockwise again, and render that as the "Left" texture. Rotate 90 degrees counterclockwise again, and render that as the "Back" texture. Then rotate 90 degrees counterclockwise, and render as the "Right" texture (even though the camera is facing left). Then render, and save it as the Front texture. Once the environment or scene is set up and ready to capture, the first step is to open the camera object's properties, and just below the Perspective/Orthographic/Panoramic selectors, you change the Lens Units from Millimeters to Field of View, and then set the field on the left to 90 degrees.Īfter that, set the camera's position to the center of the grid (0,0,0 coords), and set its rotation so that it is facing straight forward (rotation 90,0,0). Once that is done, you set resolution of the render to a square texture, preferably with a power-of-two size (I set it to 1024). Prior to beginning, you must have set up an Environment material to render, or have set up a surrounding scene to capture. I managed to figure this out on my own, based on what I had noted above.
0 Comments
Leave a Reply. |