• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
i guess your extension uses ruby. just look for "ruby OS X plist" and you'll find some gits helping you out. though sketchup might have its own methods for it. its a simple xml which can be in binary format though.

EDIT: using 5 as a default size for the grid seems odd e.g. while modeling a 4x4 or (3x2) building. its fine for 1x1 or 3x3 buildings though.
you'll probably want an option to set the actual grid size of the building you want to model.
if we want to redraw the grid how would be remove a previously drawn grid in code?

Vp3MmF0.jpg


Code:
module TT::Plugins::CitiesSkylinesTools

  SECTOR_SIZE = 8.m
  OBJECT_TYPE = "ObjectType".freeze
  TYPE_GUIDE_GRID = "GuideGrid".freeze

  def self.create_guide_grid
  # dialog:
  prompts = ["Grid Width", "Grid Depth"]
  defaults = [ "4", "4"]
  list = [ "1|2|3|4|5|6|7|8", "1|2|3|4|5|6|7|8"]
  input = UI.inputbox(prompts, defaults, list, "Grid Dimensions")
  cells_x = Integer(input[0])
  cells_y = Integer(input[1])

  grid_lines_x = cells_x + 1
  grid_lines_y = cells_y + 1

  model = Sketchup.active_model
  model.start_operation("Guide Grid")
  group = model.entities.add_group
  # Tag this group so we can find it later.
  group.set_attribute(PLUGIN_ID, OBJECT_TYPE, TYPE_GUIDE_GRID)
  # Add guide points.
  grid_lines_x.times { |x|
  grid_lines_y.times { |y|
  group.entities.add_cpoint([x * SECTOR_SIZE, y * SECTOR_SIZE, 0])
  }
  }
  # Add guide lines.
  grid_lines_x.times { |x|
  grid_lines_y.times { |y|
  point1 = Geom::Point3d.new(x * SECTOR_SIZE, y * SECTOR_SIZE, 0)
  point2 = point1.offset(X_AXIS, SECTOR_SIZE)
  point3 = point1.offset(Y_AXIS, SECTOR_SIZE)
  group.entities.add_cline(point1, point2) unless x == cells_x
  group.entities.add_cline(point1, point3) unless y == cells_y
  }
  }
  # Center at origin.
  half_size_x = (SECTOR_SIZE * cells_x) / 2.0
  half_size_y = (SECTOR_SIZE * cells_y) / 2.0

  tr = Geom::Transformation.new([-half_size_x, -half_size_y, 0])
  group.transform!(tr)
  # Prevent it from easily being moved.
  group.locked = true
  model.commit_operation
  # Ensure the grid is visible.
  model.rendering_options["HideConstructionGeometry"] = false
  rescue Exception => error
  # model.abort_operation
  # ERROR_REPORTER.handle(error)
  end

end # module TT::Plugins::CitiesSkylinesTools
 
Last edited:

Mr Maison

Colonel
13 Badges
May 9, 2013
866
706
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Campus
  • Cities: Skylines Deluxe Edition
The 5x5 grid threw me off a bit. I didn't pay attention and thought it was 4x4 which is the maximum building grid for growables for now. So far the script is working beautifully.

ThomThom I read the article. I think the arrow points to the "front" or street side of the building. So far all buildings require road access including parks. There are many requests for an easy way to make assets that can be plopped anywhere away from roads. The following thread covers some areas we can manipulate. For the issue of placing an asset anywhere, the m_placementMode looks like something helpful http://community.simtropolis.com/to...es-compendium-please-contribute/#entry1566965
 
Last edited:

thomthom

Sergeant
8 Badges
Apr 11, 2015
50
6
www.thomthom.net
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Deluxe Edition
i guess your extension uses ruby. just look for "ruby OS X plist" and you'll find some gits helping you out. though sketchup might have its own methods for it. its a simple xml which can be in binary format though.
Yea - I know what code to use, I just need to inspect the plist structure. This is all undocumented so I need to test on a machine. I just haven't dug up my mac yet.

EDIT: using 5 as a default size for the grid seems odd e.g. while modeling a 4x4 or (3x2) building. its fine for 1x1 or 3x3 buildings though.
you'll probably want an option to set the actual grid size of the building you want to model.
if we want to redraw the grid how would be remove a previously drawn grid in code?
The number was just arbitrary - something larger that what you'd model most. Though I'm short of time I can't expend too much on fit and finish. Just unlock the grid and reposition to fit.
 

thomthom

Sergeant
8 Badges
Apr 11, 2015
50
6
www.thomthom.net
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Deluxe Edition
input = UI.inputbox(prompts, defaults, list, "Grid Dimensions")
Ah! Didn't see your code snippet there. That's great I can copy an paste that into the next release when I add the OSX support. (Pull Requests on GitHub is perfect for this btw.)
I should make sure to slap an MIT license to the repo, make sure it's all open source so people can contribute. As I mentioned earlier, I'm short of time these days. I shouldn't really be distracted by this exporter extension at all. Just had to scratch that itch over the FBX export not working.
 

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
http://pastebin.com/830PsQnn <- converted my binary plist to plain xml to help you out.
i can try to have a look at it if you want me to.
Code:
<key>Fbx Exporter</key>
        <dict>
                <key>SwapYZ</key>
                <true/>
                <key>ExportSeparateDisconnectedFaces</key>
                <false/>
                <key>ExportTextureMaps</key>
                <true/>
                <key>ExportUnits</key>
                <integer>0</integer>
                <key>ExportDoubleSidedFaces</key>
                <false/>
                <key>ExportTriangulatedFaces</key>
                <true/>
                <key>ExportSelectionSetOnly</key>
                <false/>
        </dict>
 
Last edited:
  • 1
Reactions:

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
oh just pulled request to subdivide the grid :X did it using the web interface sorry for the whitespaces and indentions that was git =/

yes the pastebin link is at root
 
Last edited:
  • 1
Reactions:

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
how do we tell the grid toolbar button to edit the grid. it will draw a new one and its kinda hard clicking a line or point for the context menu.

I guess we only want one grid in our scene

its kinda cool and handy already though. added a height grid to my git with a "first height" setting just like the asset editor

u5UYhSf.jpg
some quick example
 
Last edited:
  • 1
  • 1
Reactions:

namspopof

Second Lieutenant
45 Badges
Feb 23, 2004
189
237
www.strategium-alliance.com
  • Cities: Skylines
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Rome: Vae Victis
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis IV: El Dorado
  • Pride of Nations
  • Europa Universalis IV: Common Sense
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Knights of Honor
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Darkest Hour
  • East India Company
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Arsenal of Democracy
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
Hi ThomThom !

Just for say : Great Job !
I have test your plugin export, it's very good !

some screen , just with diffuse map (no specular, bump and Normal for the test).

Your pseudo will be located at the Pantheon of CSL ;)


In sketchup :

CSL_Atelier_Namspopof_06.jpg



In Asset Editor :

CSL_Atelier_Namspopof_02.jpg


In game :

CSL_Atelier_Namspopof_05.jpg


CSL_Atelier_Namspopof_04.jpg


Just perfect for sketchup users ! :)
 
Last edited:
  • 1
Reactions:

thomthom

Sergeant
8 Badges
Apr 11, 2015
50
6
www.thomthom.net
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Deluxe Edition
how do we tell the grid toolbar button to edit the grid. it will draw a new one and its kinda hard clicking a line or point for the context menu.
Good point - Could make it find the existing grid and edit that. Makes sense.

its kinda cool and handy already though. added a height grid to my git with a "first height" setting just like the asset editor
Oh - that's nice. I like that.
 

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
also a hide grid, lower Height Grid, and raise Heigt Grid Toolbar Button would be a awesome.
dunno how to implement this quickly though.

So that dirt road connect automatically with the pavement? That's cool. I really how this game "just works" like that. In fact - feels like it would have been a nice visualization tool for architecture and city planning. The tools I had to use in my previous job was frustrating.
Haha. it could be if one could remove all default assets :p
 
Last edited:

Mr Maison

Colonel
13 Badges
May 9, 2013
866
706
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Campus
  • Cities: Skylines Deluxe Edition
So that dirt road connect automatically with the pavement? That's cool. I really how this game "just works" like that. In fact - feels like it would have been a nice visualization tool for architecture and city planning. The tools I had to use in my previous job was frustrating.
I almost didn't buy the game because I thought I would have no time to play and focus on my viz work at the same time. Then I realized I could use this game for work and play ;) My Architect mentor loves this kind of thing for us to play with. We were gonna use SimCity4 at first but I just didn't get used to using gmax and the process of all the rendering. Now we have full 3D views right from Sketchup and we can pretty much get close to replicating an area to simulate.

-namspopof that house really looks good! I like the textures you used for the windows and doors. Most realistic I've seen so far in game.:cool:

I'm trying to understand the floor height options. What difference does it make from when we model at scale and use settings in the dialog?
 
  • 1
Reactions:

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
theres no difference i guess. it's just a workflow thing imho. though the buttons should be there and the subdivided grid should be the topmost to get the idea behind it. also the asset editor has options for first floor height and other floor height. theres an thread regarding reflective maps which picks this up.

i8M3p7L.jpg
 
Last edited:

thomthom

Sergeant
8 Badges
Apr 11, 2015
50
6
www.thomthom.net
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Deluxe Edition
also the asset editor has options for first floor height and other floor height. theres an thread regarding reflective maps which picks this up.
Huh - that's interesting. I thought it was the specular map shipped with the asset alone that affected reflection. Odd, this means that after ground floor - each floor needs to be of equal height?


I almost didn't buy the game because I thought I would have no time to play and focus on my viz work at the same time. Then I realized I could use this game for work and play ;) My Architect mentor loves this kind of thing for us to play with. We were gonna use SimCity4 at first but I just didn't get used to using gmax and the process of all the rendering. Now we have full 3D views right from Sketchup and we can pretty much get close to replicating an area to simulate.
I've been meaning to hear with my former colleagues in the architectural firm if they have tried it yet. They seemed excited. A few of them are working in the city planning department. :)

-namspopof that house really looks good! I like the textures you used for the windows and doors. Most realistic I've seen so far in game.:cool:
Nice way to save polygons. And for small buildings one can make the map manually quite easily. But I feel there could be a better way to apply the material afterwards, by defining the area of the various sub-textures so one got better grip points when mapping.
 

Shelltoe

First Lieutenant
Apr 4, 2015
235
63
Huh - that's interesting. I thought it was the specular map shipped with the asset alone that affected reflection. Odd, this means that after ground floor - each floor needs to be of equal height?.

if you want to be perfect yes. though the reflection thread is about the worst case (basically a building consisting of only windows). you won't have to care to much about it if its a small building with small windows.
 
  • 1
Reactions: