Import Batch Collada files to CityEngine/ArcGIS?

3089
2
12-17-2014 07:39 AM
IsaacSCSanchez
New Contributor

Hi everbody, someone Knows how to import Collada files with textures ( *jpg) from  a  a directory to City Engine or ArcGIS in a batch process?

Thx

0 Kudos
2 Replies
by Anonymous User
Not applicable

I have a Python script that does this for KML, not Collada, but I bet it would just be a quick change in the code to make it work with Collada. Check the CE Help Docs in the Python Reference. Tell me, if you've not run scripts in CityEngine before and I'll show. Let me know if you have problems.

from scripting import *
import glob


# get a CityEngine instance
ce = CE()


# Turn off User Interface updates, or script might take forever.
@noUIupdate
def main():
    # Change this to an absolute path that points to your KML files.
    pathname = "C:/YourWorkSpace/YourProject/assets/AnyFurtherFolders/*.kml"
    # use glob to get list of all files for batch import. (I think it is a list type...) 
    files = glob.glob(pathname)
    # KMLImportSettings is part of CityEngine.
    settings = KMLImportSettings()
    # Process each file individually.
    for file in files:
        # Send file and settings to ce.importFile.
        ce.importFile(file, settings)
        # You don't have to print unless you want to audit the batch process.
        print ("Imported: " + str(file))


if __name__ == '__main__':
    print("Started!")
    main()
    print("Done!")






IsaacSánchez_Castro
Esri Contributor

So many thanks Chris, Im gonna try just now and I'll tell you

0 Kudos