Showing posts from January, 2010

Blender to OGRE Perl Script

Complex scenes hold lots of meshes (in xml format after you export to ogre meshes from blender). You need to convert it one by one. But I have written a script that converts all mesh.xml files into ogre meshes and save them to desired directories.



print "Looking for: $directoryName\n";

chdir($directoryName) or die "Cant chdir to $directoryName !";

opendir(DIR, ".");
@xmlFiles = grep(/\.xml$/,readdir(DIR));

foreach $file (@xmlFiles) {
print "$file\n";
system("OgreXMLConverter $file");

opendir(DIR, ".");
@meshFiles = grep(/\.mesh$/,readdir(DIR));

printf "Meshes: $outputMesh\n";
printf "Materials: $outputMat\n";

foreach $file (@meshFiles) {
system("cp $file $outputMesh");

opendir(DIR, ".");
@material = grep(/\.material$/,readdir(DIR));

foreach $file (@material) {

Blender To Ogre

This is a small tutorial on how to use the Blender Exporter script to use your textured models created with Blender in Ogre. This document works with Ogre 1.06 and newer and Blender 2.49b. The procedure will be same on any Operating System because all programs used are cross-platform.
In Blender In Blender scale up your cube. Make wall, fort or anything. Select the cube, and press TAB to enter EDIT mode. Move your cursor to the upper boundary till you see a two sided arrow. Right click, left klick on Split Area and afterwards determine the size of the second window by another left click. Now select UV/ImageEditor mode in the second window. Image → Open and Load(MMB) any texture from your ogrenew/samples/media/material/texture directory. Within the 3d view Edit window, press UKEY and Select Cube Projection or anything that suits you. Unwrap (smart projections) is often the best option. Change the Select mode in the 3D view Edit window to FACE Select a single face in the EDIT windo…

Simple& Quick mysql commands

$ mysql --user=your-user-name --password=your-passwordmysql> show databases;mysql> use thedatabaseyouwantoselect;mysql> show tables;

How to get event numbers

$ ls /dev/input/by-id

$ ls /dev/input/by-id -l

$ file /dev/input/by-id/usb-045e_Microsoft_Natural_Keyboard_Pro-event-kbd

/dev/input/by-id/usb-045e_Microsoft_Natural_Keyboard_Pro-event-kbd: symbolic
link to `../event1'