Platform:
Language:
Scene Contents
Learn how to use the CreativeEditor SDK's CreativeEngine to explore scene contents through the scene
API.
Setup#
This example uses the headless CreativeEngine. See the Setup article for a detailed guide.
To get started right away, you can also access the block
API within a running CE.SDK instance via cesdk.engine.block
.
Check out the APIs Overview to see that illustrated in more detail.
Functions#
getPages(): number[]
returns an array with the sorted ids of the pages in the scene.
setDesignUnit(unit: 'Pixel' | 'Millimeter' | 'Inch'): void
converts all length values in the scene such as sizes and positions to the new design unit.
getDesignUnit(): 'Pixel' | 'Millimeter' | 'Inch'
returns the currently used design unit of the scene.
File:
const pages = engine.scene.getPages();engine.scene.setDesignUnit('Pixel');/* Now returns 'Pixel' */engine.scene.getDesignUnit();