how can I set the resolution of snapshot in CityEngine script?

284
1
Jump to solution
05-30-2022 08:08 PM
jerry_kk
New Contributor

I would like to know how to set the resolution of snapshot. Having read the doc of snapshot function, it doesn't look like there is a place to set the resolution parameter.

By the way, how to debug in CityEngine? Can I import the lib in PyCharm?

0 Kudos
1 Solution

Accepted Solutions
ElliotHartley
Occasional Contributor

Resolution in the interface is dealt with by adjusting size in the dialogue box for snapshots.  Resolution for snapshots in python is achieved by using pixel width/height so it code might look like this: 
imgwidth = 1920
imgheight = 1080


view = ce.get3DViews()[0]
view.snapshot(ce.toFSPath('images')+"/filepath/filename.png",imgwidth,imgheight)

Hope this helps.

View solution in original post

0 Kudos
1 Reply
ElliotHartley
Occasional Contributor

Resolution in the interface is dealt with by adjusting size in the dialogue box for snapshots.  Resolution for snapshots in python is achieved by using pixel width/height so it code might look like this: 
imgwidth = 1920
imgheight = 1080


view = ce.get3DViews()[0]
view.snapshot(ce.toFSPath('images')+"/filepath/filename.png",imgwidth,imgheight)

Hope this helps.

0 Kudos