graph to city

helloo

i must create a script that read some data from a xml file that represent a graph
for this i think use xml.dom

after, with those data in blender i must create a city
each node will be a building or a place
each arc a road

any idea or suggestion about how i can do?
tanks in advance

There are two python scripts which can build cities in blender: Beast and City_Block. More information can be found at this link:

https://blenderartists.org/forum/viewtopic.php?t=16217&start=0&postdays=0&postorder=asc&highlight=

Hi

I’ve been unofficially rewriting cityblock.
Essentially I wanted to create a tool
where you can build a variety of textured
buildings from “lego” blocks. Each
block is a floor or a roof.

Take this file

http://picard.ups-tlse.fr/~mcshane/skyscrapers.blend

There’s a module mkB.py
which contains code for building mesh “blocks”

There’s another script makeCity.
A class for “wall” for making different textured floors.
A class “building” for making a whole building

There are a couple of hacks to get the names
for objects that should be rewritten using iterators

between lines 47 and 174 there’s
a slightly tiidied up cityBlock code.

on line 184 I create a list of different buildings.
when the “create” button is pressed these are
chosen at random and their “put” method is called
to place them in the scene.

Have fun.

Here’s a script that builds an entire city
It takes a while (2 minutes on XP2000+)
so don’t worry if it looks as if blender is hung.

http://picard.ups-tlse.fr/~mcshane/city.gz

Render as usual with F12.
This also takes forever as (antialiasing lots of fine textures,
particles in unified render, mist) but I think the result
is worth it.

hey macbuse

script loaded here under half a minute and rendering with the default setting also less then a minute.

very nicely done. when you take shots from different angles, it really is a nice hazy atmosphere (ok, so my english isn’t perfet duh! :wink: )

In my view, most of the tall buildings should have flat rooftops (skyskrapers), or very spiky ones (churches)

I’m planning on hand mondelling a city, it will be a long term project for my own personal enjoyment, unless someone of the coders wants (i know they can) to code something like greeble for max

greets

Actually, I have been interested in a Greeble type plugin for Blender as well, so as my first script I wanted to make something similar. It is still fairly incomplete (the version name is even wacko :slight_smile: ), but you can try it out if you want.

Webpage is http://evan.nerdsofparadise.com/programs/discombobulator/index.html

I’m wondering if I should make a thread on this for feedback and info on how Greeble really works (I’ve been going by renders from it and the city with greeble tutorial :expressionless: ), but I don’t know if it should be in WIP because it isn’t finished, or in Blender Python & Plugins.

Enjoy (for what it is so far) :smiley: .

macbuse: omg! :o this is so cool! this is just what i wanted! and it’s so bloody fast (even on my slooow little machine!) :smiley:

thanks for this script!

Macbuse: The .blend you provided kills Blender on my machine. Any idea why?

Funny. It runs in secons on mine :slight_smile:

Stefano

Holly happy stuff! iBook 1 gig city built in 20 secs. Render takes a while , no matter…

An idea, could tehre be a method to create patches of different city areas? Not all cities have hundreds of sky scrappers. Some have parks in them to and stuff like that…

Oh you know what would be cool to. Normal maps or bump maps on the buildings.

Sigh I which the game physics engine couldget jammed into blender :frowning:

No I don’t know why the script kills your Blender.

What version of python are you using?

I tested the script on OS X python 2.3
and Win 2K python 2.3 and it works OK.
I guess it won’t work with python <2.2
because oof the way it handles lists.
I buiilt a couple of cities that were about
4M of geometry and had no problem.

Of course with all the texture mapping
and the antialiasing when you render
it takes upwards of a minute per frame).
I wrote this essentially to make a
spiderman movie for my kid.
Haven’t got round to making any
aniimations since the rendertime is
soooooo long.

Anyone got a hack to get round this
(oher than the obvious render big
without anti-alias and rescale with
PIL or Gimp )?

Should I just get better textures?

Good city. Wow. Have to take a closer look to see if it’s usable (for me).
One thing, when I look at the objects list, the Outliner just crawls (Render times are at half a minute). I was wondering if particles would speed up render times but I can’t find an emiter. And if I press Shift-F4 for the full list the window shows a small tome which will take some time to read. I wonder if it would be possible to Join some of the meshes. That would certainly speed data browsing and it might help with rendering too, but that’s a guess.
Excellent script. Thanks for sharing it around.

by default get ridd of mist it is ugly and just to heavy for what it gives. Other than that I have no clue, the render engine is suppose to improve by a leap and bound next release.