Jump to content

Scene import from 3dsmax, etc.


photo

Recommended Posts

Greetings

My suggestion is to create an export script (plugin?) for 3dsmax to generate .world/.node/.mesh files from whole scene, with auto reference resolving, groups, etc.

You could ask why do we ever need this when there is great Unigne Editor tool? The problem is in lack of needed level-design functionality alike aligning, grid snapping, rear/front/top views, grouping, etc; worlds created with it often have weak hierarchy, low precision and lots of small bugs and intersections.

Link to comment

You can export all static geometry in one mesh with different surfaces.

Dynamic nodes should be exported separately. However, materials should be assigned in the editor, after the export is done, as Unigine has its own material system.

Unfortunately due to severe differences in material systems of Unigine and 3D content creation tools like 3ds Max/Maya it's very hard to make efficient automatic conversion of the whole scene data.

So we recommend you to adjust materials in UnigineEditor since you'll have better performance in run time with this approach.

 

As for grid snapping, you can create this feature manually, please, see the code sample:

namespace Editor {

namespace EditorGrid {

	void update() {
		if(engine.visualizer.isEnabled()) {
			Property grid_property = engine.properties.findProperty("PathFind");
			if(grid_property!= NULL) {
				float step_x = Game::getParameterFloat("grid_step_x",grid_property);
				float step_y = Game::getParameterFloat("grid_step_y",grid_property);
				float step_z = Game::getParameterFloat("grid_z",grid_property);
				int grid_size = floor(Game::getParameterInt("grid_size",grid_property) * 0.5);

				forloop(int i = -grid_size; grid_size + 1) {
					engine.visualizer.renderLine3D(vec3(i * step_x,grid_size * step_y,step_z), vec3(i * step_x,-grid_size * step_y,step_z), vec4(1.0,1.0,1.0,1.0));
					engine.visualizer.renderLine3D(vec3(grid_size * step_x,i * step_y,step_z), vec3(-grid_size * step_x,i * step_y,step_z), vec4(1.0,1.0,1.0,1.0));
				}
			}
		}
	}
};
}; 

 

To provide a differ scene views (rear/front/top views), please, use the WidgetSpriteRender

class: you have to set proper projection matrix and model view matrix,

see the following sample samples/objects/gui_02.cpp and documentation:

Programming/Unigine Library/GUI-Related Classes/WidgetSpriteRender Class.

Link to comment

Exporting whole scene as a big mesh is really bad idea - it would be huge and all references would be converted to surfaces, duplicating the geometry, removing pivot points and freezing the whole scene. That is really not the right way of exporting.

Of course, materials should be moved separately, but that is not as important as scene export..

 

Grid snapping is not "grid drawing" but "automatic aligning of elements to grid", "привязка к сетке" in Russian. So your code only draws the grid but real snapping is impossible without intrusion to editor code.

 

I know how to code different RenderSprites in Unigine, but those will "float" above the main window, ignoring the clicks, etc. It is acceptable for minimaps or in-game cameras, while level designing requires fully-functional workspaces as in UDK, 3dsmax, etc.

Link to comment

Greetings

My suggestion is to create an export script (plugin?) for 3dsmax to generate .world/.node/.mesh files from whole scene, with auto reference resolving, groups, etc.

You could ask why do we ever need this when there is great Unigne Editor tool? The problem is in lack of needed level-design functionality alike aligning, grid snapping, rear/front/top views, grouping, etc; worlds created with it often have weak hierarchy, low precision and lots of small bugs and intersections.

 

Hello,

 

Just check the attached file. Follow the steps.

 

1] Rename the file to editor.7z. [it was not permitting to add .7z files]

2] Extract the files

3] Back up your editor script located at data\core\editor

4] Copy my files - editor_controls.h, editor_grid_control.h, editor_isometric_views.h and editor.cpp to editor script. [dont worry you have already backed up]

5] Run editor.

 

You will see some buttons at bottom. and if visualizer is on then simple grid. I did it to help the content creators with unigine editor. Now I have future plans to use sprite renderers for multiple views. Just make sure that you select any node. The script is using already existing scripts so selection of any node is mandatory and then the clicks of buttons will give you different views around the selected node.

 

In future I will update parallel projected views too.

 

If having any problem just drop the reply.

 

Thanks and Regards,

Rohit Gonsalves.

editor.txt

Link to comment
×
×
  • Create New...