Bonjour,
Je voudrais encapsuler et ouvrir un fichier .blend dans une JFrame. Donc, j'ai crée un programme qui permet dans un premier temps de créer un fichier .blend, et ensuite j'ai crée une frame.
Maintenant, je voudrais ouvrir le fichier .blend dans la frame. Pouvez-vous m'aider à faire ça?
Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import static org.blender.utils.BlenderFactory.*;
 
import java.io.File;
import java.io.IOException;
 
import javax.swing.JFrame;
 
import org.blender.utils.MainLib;
import org.cakelab.blender.io.BlenderFile;
 
public class Test {
 
	public static void main(String[] args) throws IOException {
		BlenderFile blend = newBlenderFile(new File("V3.blend"));
		//
		// create a main library to manage references on data in blender file.
		//
		MainLib main = new MainLib(blend);
		// ..
		//
		// write new file to disk.
		//
		blend.write();
		//
		JFrame f = new JFrame("Lecteur Blend");
        f.setSize(512,512);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        //f.getContentPane()(blend);
	}
}