Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 1-Jun-2011 13:58:03

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Blender 2.57 exporter

Hi everybody,

Here the steps to install Ogre mesh exporter for Blender version 2.5x (this exporter is not officially supported by Ogre's team, but it seems that it's a lot better!).
First, you will have to download blender2ogre (this link is for v0.3.6 of the exporter, check if there's a new version ^^) , and extract the file "io_export_ogreDotScene.py" contained in this zip to Blender's addons directory (in my case it's "C:\Users\Jeff\AppData\Roaming\Blender Foundation\Blender\2.57\scripts\addons").
Next, to activate the Ogre3D render preview in Blender, download the blender2ogre dependencies package, and extract the content of "OgreMeshy" directory to "C:\OgreMeshy". It must be this target directory, otherwise, it wont work!
Finally, download Ogre command line tools 1.8 (do not download Ogre's official ones, neither use those provided in the blender2ogre dependencies package, cause it's not the same version of Ogre!) from our website, and extract the content of this zip file to "C:\OgreCommandLineTools", same remark as above, if you install them on another directory target, the exporter will not work properly.
Pfwwww... simple, no?

To encourage you to try it, I made a little video tutorial, that mimic the blender 2.4x export video tutorial:

Flash required

Offline

#2 10-Jun-2011 10:56:31

MrMask
Member
Registered: 10-Jun-2011
Posts: 1

Re: Blender 2.57 exporter

Hello,

My OgreMeshy doesn't work, can you help me please ?
I have extracted my archive in the folder like you indicate but I can't see the render preview in Blender.

Thanks for help.

Offline

#3 10-Jun-2011 15:53:14

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

You have to extract only the content of "OgreMeshy" directory (in the zip) to "C:\OgreMeshy", not the whole zip to "C:\OgreMeshy".

Offline

#4 29-Jun-2011 16:34:51

slavavs
Member
Registered: 9-Apr-2011
Posts: 137
Website

Re: Blender 2.57 exporter

do as you describe. No render preview in Blender smile
it should automatically appear?

Offline

#5 4-Jul-2011 15:32:44

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

Hi,
Sorry for the late response, but I had no web connection last week.
I think that to render the preview, you have to click on a button on the top left of blender's window (as far as I remember).

Offline

#6 4-Jul-2011 15:36:29

slavavs
Member
Registered: 9-Apr-2011
Posts: 137
Website

Re: Blender 2.57 exporter

buttons no smile It should appear there herself, or her need to somehow insert?

Offline

#7 5-Jul-2011 08:42:26

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

Hi,

First, the screenshots below were made with Blender2Ogre's last version (v0.4.4), check blender2ogre's website for updates.
You'll just have to overwrite the file named "io_export_ogreDotScene.py" in the good location, nothing more...

The two following images show you where to click to launch OgreMeshy viewer:
50419233.th.png 71366405.th.png

If you do not have those buttons, please check that you do not have an error at Blender start.
To check this, toggle the Blender's console on (you should have something like the image below):
74467789.th.png

@MrMask did you succeed to use the (basic) ogre viewer?

Offline

#8 29-Aug-2011 06:36:51

roctedd
Member
Registered: 29-Aug-2011
Posts: 4

Re: Blender 2.57 exporter

Hello:) Help me, please!

I have such problem: at export textured mesh from Blender (and its further import in OpenSpace 3D) a normals map instead of carrying out the function simply mixes up with the basic texture, adding it a violet shade. Certainly, the effect of a material vanishes. From here two questions:
1) whether probably somehow it to correct?
2) And whether it is possible in general, without additional manipulations to make so that the normals map carried out the function, simply having imported it together with object?

Thank you

Offline

#9 29-Aug-2011 09:39:23

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

Hum, OpenSpace3D is a real-time engine, and uses shaders to render this kind of information. Look at the "bump" example, to see how the "fond_piscine_normal.jpg" normal map is used in the material script:

material fond_piscine
{
	lod_distances 0 10
	technique Map#36
	{
	  lod_index 1
		pass Map#37
		{
			ambient 0.356863 0.356863 0.356863 1
			diffuse 0.603922 0.603922 0.603922 1
			specular 0.898039 0.898039 0.898039 1 80

			vertex_program_ref ambient_vs
			{
			}

			fragment_program_ref ambient_ps
			{
			}

			texture_unit Map#38
			{
				texture_alias Map#38
				texture examples/media/bitmap/fond_piscine_diff.jpg
				filtering linear linear linear
			}

			texture_unit Map#304
			{
				texture_alias Map#304
				texture examples/media/bitmap/fond_piscine_spec.jpg
				filtering linear linear linear
			}
		}

		pass Map#305
		{
			iteration once_per_light
			ambient 0.356863 0.356863 0.356863 1
			diffuse 0.603922 0.603922 0.603922 1
			specular 0.898039 0.898039 0.898039 1 80
			scene_blend add
			illumination_stage per_light

			vertex_program_ref diffuse_vs
			{
			}

			fragment_program_ref diffuse_ps
			{
			}

			texture_unit Map#38
			{
				texture_alias Map#38
				texture examples/media/bitmap/fond_piscine_diff.jpg
				filtering linear linear linear
			}

			texture_unit Map#304
			{
				texture_alias Map#304
				texture examples/media/bitmap/fond_piscine_spec.jpg
				filtering linear linear linear
			}

			texture_unit Map#306
			{
				texture_alias Map#306
				texture examples/media/bitmap/fond_piscine_normal.jpg
				filtering linear linear linear
			}
		}

	}

	technique Texture#332
	{
	  lod_index 2
		pass Map#37
		{
			ambient 0.356863 0.356863 0.356863 1
			diffuse 0.603922 0.603922 0.603922 1
			specular 0.898039 0.898039 0.898039 1 80

			texture_unit Map#38
			{
				texture_alias Map#38
				texture examples/media/bitmap/fond_piscine_diff.jpg
				filtering linear linear linear
			}
		}
	}

}

In a nut case, this material contains two technique, one with shaders, the second for graphic cards that does not supports the shader profile (ambient_vs is vs_1_1/arbvp1 shader, so it is supported by almost all the cards, but ambient_ps is ps_2_0/arbfp1 so may not be supported by <very> older cards).
The best technique is automatically selected by the engine, so, let assume that your PC supports the first one. It had two pass, "Map#37" and "Map#305" (as a side note, ugly names generated by 3DS, do not hesitate to rename them), the first pass takes two texture units, diffuse and specular maps, the second takes three maps, diffuse specular and normals, in this order.
Do not forget to add all the needed resources to your project (.material, .program and .cg).
Let me know if you need further informations.
PS: please do not use automatic translation without check it before posting, it makes things very difficult to me to understand what's your problem was really about!

Last edited by Nodrev (29-Aug-2011 13:29:54)

Offline

#10 29-Aug-2011 09:44:24

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

And I know that this exporter supports shader edition, and exports basic shaders like bump, althought i did not manipulate it enought to explain it nor make a tutorial for this part of the exporter. Maybe you could have a look to it and give us your feedback.

Offline

#11 29-Aug-2011 11:28:27

roctedd
Member
Registered: 29-Aug-2011
Posts: 4

Re: Blender 2.57 exporter

Thanks for a quickly reply! Experiments with scripts yet have not given results. But I will continue:)

I have learnt that many designers and artists have faced this problem from Russian community OpenSpace 3D. Probably, your forum a unique ray of hope:)

Also excuse me for automatic translation - I not the professional in English.

Offline

#12 29-Aug-2011 13:54:47

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

If you need more information about the script system, check this page:
http://www.ogre3d.org/docs/manual/manual_14.html#SEC23

If you need a special effect (a material or a shader), you may search on the Ogre forum if someone ever created it:
http://www.ogre3d.org/forums/

I know that we have lots of russian users, but a few comes here... That's a shame, cause we can't help them if they stay on the russian forums. I choose to not respond in English on those forums as I think it shall be unwelcome... And also cause I'm not sure that there's lot of english speakers... I went to Slovakia last summer, and was surprised that the first foreign language they learnt was not english, but russian. People here in western europe often assume that english is the universal language that every people in the world should know, but it's far from being a reality hmm
So, do not hesitate to inform other users of those russian forums to ask their questions here when they can. This way, they can translate our responses and let non-english speaking people to have them too, that's how a community works, giving to other things we know smile

No problem with automatic translation, just check it, as I know russian/english google translate is not very efficient hmm ... I use it often to check what peoples says on some russian site (gcup.ru for example). What I was asking is to have a look at the translation before posting, nothing more  wink

Offline

#13 29-Aug-2011 14:28:47

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Blender 2.57 exporter

roctedd wrote:

(...) I not the professional in English.

me too ! big_smile
don't worry !

Offline

#14 29-Aug-2011 14:57:48

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

Indeed, you should have say: "me neither" tongue

Offline

#15 29-Aug-2011 15:01:14

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,024
Website

Re: Blender 2.57 exporter

... be happy cool

Offline

#16 29-Aug-2011 15:43:57

roctedd
Member
Registered: 29-Aug-2011
Posts: 4

Re: Blender 2.57 exporter

I have written the on an example of the offered script. The result has turned out unexpected:) But to add in the project a normals map it has not turned out. Textures or are not present absolutely, or they still mix up. Very much it was pleasant to me OpenSpace 3D for its fantastic possibilities!!! But I not the professional programmer. I am the CG artist. Probably, I at all should not concern this question:(

Excuse me for anxiety. Thanks for the help!

If there will be questions from other associates, I will necessarily give them the link to your forum.

It is my script

(Guys, how to attach a screenshot to a post if it is in folder "My Documents"? Just also to add the link?)

material cube_material.018
{
    technique cube_technick
    {
        pass cube_pass
        {
            ambient 0.356863 0.356863 0.356863 1
            diffuse 0.603922 0.603922 0.603922 1
            specular 0.898039 0.898039 0.898039 1 80
            scene_blend add
            illumination_stage per_light
           
vertex_program_ref ambient_vs
            {
            }
           
            fragment_program_ref ambient_ps
            {
            }
           
            texture_unit Map#38
            {
                texture_alias Map#38
                texture Cube/floor04_diff.png
                filtering liner liner liner
            }
           
            texture_unit Map#304
            {
                texture_alias Map#304
                texture Cube/floor04_spec.png
                filtering liner liner liner
            }
           
            texture_unit Map#306
            {
                texture_alias Map#306
                texture Cube/floor04_normal.png
                filtering liner liner liner
            }
        }

    }

    technique Texture#332
    {
     lod_index 2
        pass Map#37
        {
            ambient 0.356863 0.356863 0.356863 1
            diffuse 0.603922 0.603922 0.603922 1
            specular 0.898039 0.898039 0.898039 1 80

            texture_unit Map#38
            {
                texture_alias Map#38
                texture Cube/floor04_diff.png
                filtering linear linear linear
            }
        }
    }

}

Offline

#17 30-Aug-2011 10:51:19

Nodrev
Scol Language & OS3D developer
From: Nantes, France
Registered: 29-Dec-2009
Posts: 197

Re: Blender 2.57 exporter

You can upload an image to an free online host like http://imageshack.us/, should be ok.
Your material script is not good at all!!! You only have one pass on the first technique, instead of 2... and the "ambient_ps" shader does not require 3 texture units, but two, it's the "diffuse_ps" shader (which is normally on the second pass) that requires 3!
This script shall be better, I clean it up so there's only minimal stuff for the bump shader (I do not try it, so check in the log if there's syntax errors):

// This is a comment

// Our material had two techniques, one is a shader bump effect, and one "backup" technique with no shader for PC that does not support the shaders used.
material cube_material.018
{
    technique cube_technique_bump   // Technique "name" is optionnal
    {
        pass cube_ambient_pass          // Pass "name" is optionnal
        { 
            vertex_program_ref ambient_vs
            {
            }
           
            fragment_program_ref ambient_ps
            {
            }
           
            texture_unit                        // Texture_unit "name" is optionnal too, automatically generated here
            {
                texture Cube/floor04_diff.png
                filtering liner liner liner
            }
           
            texture_unit
            {
                texture Cube/floor04_spec.png
                filtering liner liner liner
            }
        }

        pass cube_diffuse_pass
        {
            iteration once_per_light
	    scene_blend add
	    illumination_stage per_light

            vertex_program_ref diffuse_vs
	    {
	    }

	    fragment_program_ref diffuse_ps
	    {
	    }

	    texture_unit
	    {
	        texture Cube/floor04_diff.png
                filtering linear linear linear
            }

            texture_unit
            {
                texture Cube/floor04_spec.png
                filtering linear linear linear
            }

            texture_unit
            {
                texture Cube/floor04_normal.png
                filtering liner liner liner
            }
        }
    }

    technique cube_technique_no_shaders
    {
        pass cube_diffuse_pass
        {
            ambient 0.356863 0.356863 0.356863 1
            diffuse 0.603922 0.603922 0.603922 1
            specular 0.898039 0.898039 0.898039 1 80

            texture_unit
            {
                texture Cube/floor04_diff.png
                filtering linear linear linear
            }
        }
    }
}

And also, check that you added the "example\media\program\general.cg" and "examples\media\program\general.program" files to you project resources BEFORE loading your material script (they are where the vertex_program_ref and fragment_program_ref references are defined).

Last edited by Nodrev (2-Sep-2011 10:18:00)

Offline

Board footer

Powered by FluxBB