Problem with convert and import models

I got a scene in 3d max 2012 with objects, please give me advice, how to load it to jme3 for use it like an array contains objects with textures, positions and other object’s properties?



In my case I want to load scene, make a different actions like a rotation, move and others with some big and little objects in it.

try MaxToOgre script :slight_smile: .

1 Like

Has ony one example of usage few objects after they are loaded with assetManager.registerLocator?

1 Like

What exactly is it that you want to do? After you have loaded it with the assetManager you can manipulate it then attach it to the scene, I guess





[java]

Node model = (Node) assetManager.loadModel("Models/whatever/model.j3o);

model.setLocalTranslation(5,15,-6);

model.setLocalScale(7,1.9f,20);

rootNode.attachChild(model);

[/java]



You need to go through the documentation if you don’t know this https://wiki.jmonkeyengine.org/legacy/doku.php/jme3#tutorials_for_beginners

:slight_smile:

1 Like

I read it today again, but I don’t understand, uhm, if I load like a node, so I can get childs, thanks a lot, will try later. One more question, i found 2 plugins for import to ogre xml, install them, and now got in 3d max 2 import variant (ogre and ogrexml) with different settings, try both, work - no errors, install xmls and they loading in my program with parse errors. Also I have checked true to import xml too, but parse error still coming to log…



Can some-body write here or in wiki how he do it himself?

1 Like

Can you post the error?

If you post the error then we can help you

1 Like

[java]

INFO: Child (Pyramid001) attached to this node (Scenes/Test/Simple-scene_node)

06.11.2012 8:48:02 com.jme3.scene.plugins.ogre.SceneLoader startElement

WARNING: Cannot locate Scenes/Test/Pyramid001.mesh.xml for scene Scenes/Test/Simple.scene

06.11.2012 8:48:02 com.jme3.scene.Node attachChild

INFO: Child (placeholder) attached to this node (Pyramid001-entity)

06.11.2012 8:48:02 com.jme3.scene.Node attachChild

INFO: Child (Pyramid001-entity) attached to this node (Pyramid001)

06.11.2012 8:48:02 com.jme3.scene.Node attachChild

INFO: Child (Plane001) attached to this node (Scenes/Test/Simple-scene_node)

06.11.2012 8:48:02 com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

com.jme3.asset.AssetLoadException: An exception has occured while loading asset: Scenes/Test/Simple.scene

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:275)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:408)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:418)

at ru.mirdryzey.Simulator.simpleInitApp(Simulator.java:201)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:231)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)

at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: Error while parsing Ogre3D dotScene

at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:458)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:273)

… 7 more

Caused by: org.xml.sax.SAXException: dotScene parse error: Expected parent node to be light

at com.jme3.scene.plugins.ogre.SceneLoader.checkTopNode(SceneLoader.java:105)

at com.jme3.scene.plugins.ogre.SceneLoader.startElement(SceneLoader.java:356)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:449)

… 8 more[/java]

here is some log from application’s start, I create a zip archieve with different models, try a tutorials, and all were fine, but when I try to load 3d max scene I found a problem “How to manipulate different objects from my 3d max scene?” so I go here for help.


  1. I create a simple 3d max scene with box, tube and others objects (figures)
  2. I download and install ogre plugin and .dll for 3d max 2012
  3. I export 3d max scene to ogre xml scene
  4. I got a few files like .mesh, .material, .scene
  5. I put it into my zip
  6. assetManager.registerLocator(“Objects.zip”, ZipLocator.class);
  7. add light (DirectionalLight)
  8. Node simple = (Node) assetManager.loadModel(“Scenes/Test/Simple.scene”); rootNode.attachChild(simple);

Are you using RC2? The line numbers in the trace don’t match the latest jME3 version.

From all I can tell this is an Eclipse/maven setup with the inherent setup issues. Wheres those maven guys anyway? We should close that repo as its not being updated.

Yes, I use Eclipse + maven, I found example in google, with next code:



[xml]<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">



<properties>

<jmonkey.version>3.0.0-SNAPSHOT</jmonkey.version>

</properties>



<!-- The core library -->

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-core</artifactId>

<version>${jmonkey.version}</version>

</dependency>



<!-- LWJGL stuff -->

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-lwjgl</artifactId>

<version>${jmonkey.version}</version>

</dependency>



<repositories>

<repository>

<id>Apache Nexus</id>

<url>Index of /repositories/snapshots</url>

<releases>

<enabled>false</enabled>

</releases>

<snapshots>

<enabled>true</enabled>

</snapshots>

</repository>

<repository>

<id>sonatype-public</id>

<name>sonatype public</name>

<url>https://oss.sonatype.org/content/groups/public/</url>

</repository>

</repositories>

</project>

[/xml]



That is the latest version of jme? And did you know actual repository?

@bobson said:
That is the latest version of jme? And did you know actual repository?


That's probably not the latest. The JME developers do not maintain the maven version nor did we setup the repository, etc.. So I don't think we know what version it actually is and I don't remember who set it up or whether they are still paying attention. Hopefully if they are then they will respond here.

Load from svn, or the nightlys, the maven stuff is outdated.

http://code.google.com/p/jmonkeyengine/source/checkout

I configure local a jme3 jars, but still got some error, here is the scrren

http://www.rcpp.ru/images/printscreen.jpg



I think that I do some-thing wrong, but what?

Seems like maybe something is wrong with the ogre file you are trying to load.

Yes, it is a pity, but I had a problem with export from 3d max 2012. Try to export to obj, but have in log “WARNING: Unknown statement in MTL! tf”

I try different various and got problem with export my 3d max scene to ogre xml, seems like .scene + .material + .mesh.xml not compatible with jme3

@bobson said:
I try different various and got problem with export my 3d max scene to ogre xml, seems like .scene + .material + .mesh.xml not compatible with jme3

Sorry, if you choose to use a completely outdated version of jme theres nothing we can do for you.

Today I try a latest version and have a same errors, can you write which version of ogremax plugin do you use?

You are aware that your model still needs to be game compatible, that is no extended material settings can be exported from the editor? Only meshes and uv maps for textures. So you cannot set a “shiny material” in the editor, it will not translate.