Batch export of many building models, using one model file per building

08-21-2012 11:52 AM
New Contributor
When I export a selection of multiple modeled buildings to Wavefront OBJ or Collada DAE format, all of the buildings get lumped together into a single OBJ or DAE.

For our application, we would like to be able to export a large number of buildings at once, and use a separate OBJ or DAE for each building model.  Is this possible in CityEngine?  We do not want to have to manually select and export the buildings one at a time.
0 Kudos
15 Replies
Frequent Contributor
aah, somebody did not look at the manual first .. 🙂

just change the Exporter's Granularity setting from "Use file size limit" to "Create one file per shape".
0 Kudos
New Contributor
Okay, thanks!  I missed that.

However, I'm running into another issue.  I exported a couple of CGA-generated buildings to OBJ format, but not all of the textures were exported.  Only the roof textures got written out.  The generated .MTL file (goes with the .OBJ files) actually references texture files for the parking lot and floors, but those files are missing.  So, when I attempt to import the models into another program like ArcGlobe, they show up with blank walls.
0 Kudos
Frequent Contributor
hi !

did you check the 'Collect Textures' checkbox in the Materials tab of the Exporter ?

btw.. there's export presets on the very top of the Exporter window which should set everything correctly.

let me know ! 🙂
0 Kudos
New Contributor
Yes, "Collect Textures" was checked by default.  The roof textures exported fine, just not the side/wall textures.
0 Kudos
Frequent Contributor
then I assume you have invalid characters in the file names.

check them for any spaces or anything 'non-letter' or 'non-number'. 🙂

let me know ..
0 Kudos
New Contributor
No, the filenames contained no spaces nor special characters.

Actually, the problem of missing files when exporting to OBJ seems to be intermittent.  In some cases that I've observed when exporting multiple models, no .MTL file gets written, but all of the texture images are there.
0 Kudos
Frequent Contributor

do you see any regularity in this behavior ? what does the export log say ?

can you test this with one of the downloadable Example cities ?

did you find a reproduction procedure for this ?

please let me know !
0 Kudos
New Contributor
Sorry for reactivating this old thread, but i have exactly the same problem.

I try to export the Modern Street example with the one file par shape option. I got a file for every shape and every texture, but only one Material-File which has only two materials (Pavement_141, Curbs_123). (Same Problem with any other model)

The export log:
export started at: Tue Feb 25 18:16:30 2014
export completed at: Tue Feb 25 18:17:22 2014
export duration: 52.0 seconds

    format:                default
    location:              C:\Users\Test\CityEngine\Example_Modern_Streets__2012_1\models
    base name:             ModernStreets
    export content:        1 (0 = models only, 1 = fallback to shape, 2 = shapes only)
    file granularity:      1 (0 = single file (or split by file budget), 1 = file per initial shape)
    file size budget:      524288000
    mesh granularity:      1 (0 = as generated, 1 = mesh per material, 2 = use instances of inserted assets) 
    vertex precision:      0.00100
    normal precision:      0.00100
    texcoord precision:    0.00010
    merge vertices:        1
    merge normals:         1
    merge texcoords:       1
    triangulate:           1
    reproject texcoords:   0
    vertex indexing:       0 (0 = allow shared vertices, 1 = force separate vertices)
    normals type:          0 (0 = use vertex normals, 1 = use face normals (flat))
    normals indexing:      0 (0 = allow shared normals, 1 = force separate normals)
    write texcoords:       1 (0 = no texcoords, 1 = first layer, 2 = all layers)
    write materials:       1
    collect textures:      1
    file type:             0 (0 = ascii, 1 = binary)
    embed textures:        0
    write master file:     0
    master group name:     CityEngineSceneRoot
    write cam data:        1
    batch behavior:        0 (0 = normal, 1 = skip existing files, 2 = dry run)

    number of initial shapes      = 1012
    number of generated shapes    = 26150
    number of generated meshes    = 26175
    number of generated materials = 26175

    written files: 1012
    written materials: 3846
    written meshes (total polygons): 3846 (630407)
    mesh names (polygons):

Any suggestions?
0 Kudos
Frequent Contributor

try using the export dialog's preset 'default' settings and retry ..

lemme know.

0 Kudos