Author Topic: Guide to importing models into Skyscraper  (Read 508 times)

Offline eventhorizon

  • Administrator
  • Contributor Level II
  • *****
  • Posts: 389
  • Location: Chicago, IL
    • View Profile
    • Ryan Thoryk's Website
Guide to importing models into Skyscraper
« on: September 29, 2022, 03:23:52 am »
These instructions were made for the current 2022 builds (Ogre 1.13)
If you want to use the models for older builds, you'll have to tell the Ogre utilities to downgrade the mesh format of the resulting mesh to Ogre 1.9.



Tonight I decided to ditch the old Sketchup model importer for Skyscraper and use Blender instead, since that's mainly what Ogre supports.
This guide will show you how to convert models into Skyscraper (actually Ogre) models.

First, download Blender from https://www.blender.org/

Then, download my utility called OgreConvert, for your system here:
Windows: https://www.skyscrapersim.net/downloads/support/ogreconvert_win64.zip
Mac: https://www.skyscrapersim.net/downloads/support/ogreconvert_macos.tar.bz2
Linux: https://www.skyscrapersim.net/downloads/support/ogreconvert_linux_x64.tar.bz2

OgreConvert is intended to make this very easy.  Extract the package somewhere on your system, such as your home directory.  (These instructions are mostly from the Ogre site)
-Inside the package folder, go into the Blender folder and copy the io_ogre folder into Blender's /scripts/addons folder, on my Linux system it's in /usr/share/blender/scripts/addons.  You should also be able to import that folder from inside Blender, by choosing Edit->Preferences->Addons->Install.
-Enable the addon in Blender: Edit menu > Preferences > Add-ons. Search for 'ogre' and click the box up the top left.
-Configure the plugin prior to the first run:

The plugin will want to point to Ogre's utilities.  Those are in the package you downloaded.  The first is called OgreXMLConverter, so in Blender's plugin preferences, click the Browse button and point it to that program.  Also point it to Ogre's mesh upgrader, called OgreMeshUpgrader.

If you're using Linux, you'll have to point both of those to the run scripts instead, so instead of OgreXMLConverter and OgreMeshUpgrader, point them to run_xml_converter.sh and run_mesh_upgrader.sh respectively.

The Ogre instructions are here, which are a little more detailed:
https://github.com/OGRECave/blender2ogre#readme



In Blender, create a model, or test it out by using the default cube model.  Choose File->Export->Ogre3D and save the model.  You can uncheck the "Export Scene" box if you want.  I'm not sure yet about the Swap Axis setting, but I'll experiment and update this page with info.  For me, the model saved as Cube.mesh and Material.material.  The material needs to be the same name as the mesh, so name it Cube.material.  I put both of those files into Skyscraper's Data folder.  I then edited the Simple building, and changed one of the couch models to use Cube.mesh instead of couch.mesh, and ran Skyscraper.  It'll load Cube.material by default.  If you enable physics on the cube, then you will be able to push and move the cube.  When I ran the app, this was the result:



So hopefully this will help people on the forum import advanced 3D models into Skyscraper.
« Last Edit: September 29, 2022, 03:49:19 am by eventhorizon »

Share on Facebook Share on Twitter

Like Like x 1 View List

Offline NothingCanStopMe357

  • Contributor Level I
  • *
  • Posts: 172
  • Contributor to SSF. Innovation is key to success.
  • Location: Multiple places. Usually Scratchland and Skyscrapersimcity
    • View Profile
    • My Scratch Account
Re: Guide to importing models into Skyscraper
« Reply #1 on: October 20, 2022, 04:51:44 pm »
Great! We could possibly use it to add furniture of some sorts.
Together, we can innovate Skyscrapersim in many ways that has never been seen before. Just bring up an idea and we can implement it!