Print at Sep 15, 2019 10:56:12 PM View all posts in this thread on one page
Posted by digitaltrails at Apr 3, 2019 9:33:35 PM
CameraBagPlugin Export/Import Points of View as CSV
I've written a plugin that can export and import a model's named points of view (its cameras) to a CSV file (hence camera bag, a bag of cameras). The plugin adds Export Cameras and Import Cameras menu items to the tools menu. When invoked via the menu, the plugin pops up an appropriate file selection dialog, defaulting to cameras.csv.

The ability to export/import provides you some ability to work around the current 50 points of view limit set in SH3D. Plus it provides you with the ability to generate points of view in bulk.

For example, say I need to create 30 images from the same point of view over a 3 month period. Rather than pointing and clicking to create 30 points of view, I can just export a single point of view and them use a spreadsheet or column oriented editor to generate the 29 other points of view, and then import all 30 back into SH3D.

The exported CSV looks something like:
#name,x,y,z,pitch,yaw,fov,time,cameraType,viewType,observerSizeType
Overview,13527.723,8459.4375,5482.206,42.0,-359.0,63.0,2018-05-04T12:00+12:00[Pacific/Auckland],PINHOLE,observer,variableSize
Fence,19926.076,9641.014,2976.5076,31.0,-315.0,63.0,2018-06-21T15:30:00.242+12:00[Pacific/Auckland],PINHOLE,topview,variableSize

Names with commas in them will be exported with the commas replaced by spaces.

The date will be exported in the time zone of the model's compass. Yaw, pitch, and fov angles are in degrees. For the moment x, y, z are internal metric only.

The cameraTypes are internal names that correspond to the Lens setting in the create photo panel as follows:
  • PINHOLE - Default
  • NORMAL - Depth of field
  • FISHEYE - Fisheye
  • SPHERICAL - Spherical
The viewType can be observer (virtual visitor) or topview (aerialview).

The observerSizeType is internal and determines some of the format of tooltips in some circumstances, it would normally be variableSize for both observer and topview cameras, but if the cameraType is observer, it may be fixedSize (perhaps just copy what's been exported).

The plugin has been uploaded to the sourceforge SH3D plugins contrib:
https://sourceforge.net/p/sweethome3d/plug-ins/25/

Posted by digitaltrails at Apr 3, 2019 10:32:40 PM
Re: CameraBagPlugin Export/Import Points of View as CSV
I put up a new version of this plugin to deal with a bug that got into the release where exports with the variableSize column couldn't be imported.

It also highlighted the need for some additional error messages which I will deal with later.

Posted by digitaltrails at Apr 8, 2019 5:08:58 AM
CameraBagPlugin v1.5 now allows more than 50 cameras
I've uploaded version 1.5 to sourceforge:
https://sourceforge.net/p/sweethome3d/plug-ins/25/
(and scroll to the bottom)

In version 1.5 I added error checking and reporting on unparsable times, numbers, and the wrong number of fields.

I also added the ability to have more than 50 cameras. SH3D normally limits the number of cameras to 50. If more than 50 cameras are imported, the importer will pop up a dialog and ask if the limit should be ignored. The other choice is that the importer enforces the limit and truncates the import. If you subsequently ask SH3D to store a location, it will truncate the list back to 50 and you will then have to reimport to restore any in excess of the limit.

I added the limit override because I need to do several timelapse sequences to analyse sunlight and shading over autumn, winter and spring. It's a bit easier if I don't have to break it down into 50 images at a time.