From Test-Scratch-Wiki

DocumentInQuestion.png This page is in question to whether it is useful or not. You can discuss whether you want it deleted or not on its talk page.
SandCastleIcon.png This page has links to outside of the Scratch website or Wikipedia. Remember to stay safe when using the internet as we can't guarantee the safety of other sites.
This is the default blender GUI.

Blender is a 3D graphics editing program. It is used by Scratchers to generate 3D graphics for Scratch projects. Scratchers have created scripts to render a Blender model with the pen by importing the file into a list.[citation needed] One can also import a large number of screenshots of a Blender model and create a fluid animation that can be played in a project.

Exporting Images from Blender

To export an image from Blender, make sure that you have a 3D model, or else there will be nothing worth rendering. If you do, follow these steps:

  • Go to the Properties Panel, and select the render sub-menu. The icon for it is a camera.
  • There should now be a menu with various image properties. This is optional, but the image's properties should be changed to your needs.
  • At the top, there should be a button that says 'Render', along with 'Animation' and 'Play'. Click the 'Render' button.
  • Press F3 to export, and save the image where you'll remember it.

Importing Models to Scratch

Importing models to Scratch requires a 3D renderer project already created, and even then, it is complex to do. Here are the steps on how to do it:

  • Export your 3D model in the .obj file format.
  • Here's a sample of what it may look like:
# Blender3D v245 OBJ File: <memory>
# www.blender3d.org
mtllib cube.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
f 1 2
f 1 4
f 1 5
f 2 3
f 2 6
f 3 4
f 3 7
f 4 8
f 5 6
f 5 8
f 6 7
f 7 8
  • The o stands for object, v stands for vertex, and f stands for face.
  • Split the file into the components that you want. So if you want to import the vertices, you'll separate that into a new text file; and if you want the faces, you'll need to move that to another new document. Remember, each individual edge, vertex, or object needs its own new line.[1] Here's an example for the vertices above:
1.000000
-1.000000
-1.000000
1.000000
-1.000000
1.000000
-1.000000
-1.000000
1.000000
-1.000000
-1.000000
-1.000000
1.000000
1.000000
-1.000000
0.999999
1.000000
1.000001
-1.000000
1.000000
1.000000
-1.000000
1.000000
-1.000000
  • For this step, it is helpful to have some more code in your 3D rendering project. That code should be able to take a string like the one above and add each data point into your 3D model, though it is possible to do by hand. From here, all that needs to be done is moving the model data over to your 3D renderer.

See Also

External Links

— the Blender site

— a forum thread explaining how to import Blender models

References

Cookies help us deliver our services. By using our services, you agree to our use of cookies.