You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to perform data import (.shp with BlenderGIS) through the scripting interface?
How to Reproduce
I'm working on a project in which I automate the conversion of building footprints and floor plans (shapefiles) into 3D building models using Blender. Currently, I import the shapefiles manually, but I also want to automate this step.
Thank you in advance!
Error message
The text was updated successfully, but these errors were encountered:
I actually ran into a similar need of batch-importing rasters a few days ago. I found a solution from issue #754
Likewise, you can simply call the bpy.ops.importgis.shapefile operator from your script, just like this:
importbpyshp_files= [#List of shp file paths]forpathinshp_files:
bpy.ops.importgis.shapefile(filepath=path)
Note that you need to use keyword arguments (i.e. filepath= is mandatory). The filepath parameter is the minimal requirement to import a shapefile. You could use the below parameters as needed:
filepath="", # Shapefile path.
shpCRS="", # CRS of the shapefile.
elevSource="GEOM", # Determine the source of elevation. Can be None, "GEOM", "OBJ", "FIELD"
objElevName="", # If elevSource == "OBJ", the object name used for elevation.
fieldElevName="", # If elevSource == "FIELD", the attribute field to determine elevation.
fieldExtrudeName="", # The field name of the attribute used to extrude the faces. Leave blank if extrusion is not needed.
fieldObjName="", # If separateObjects == True, the attribute field to name the generated objects.
extrusionAxis='Z', # Extrusion direction. Can be "NORMAL", "Z"
separateObjects=False # Import features as separate objects.
Blender and OS versions
Blender 3.2.1 Windows 10
Describe the bug
Is it possible to perform data import (.shp with BlenderGIS) through the scripting interface?
How to Reproduce
I'm working on a project in which I automate the conversion of building footprints and floor plans (shapefiles) into 3D building models using Blender. Currently, I import the shapefiles manually, but I also want to automate this step.
Thank you in advance!
Error message
The text was updated successfully, but these errors were encountered: