starting KF Editor
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<style>
|
||||
canvas[data-output="kfeCanvas"]{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<canvas data-output="kfeCanvas"></canvas>
|
||||
@@ -0,0 +1,50 @@
|
||||
class KeyframeView extends EICDomContent {
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
Object.assign(this, app.helpers.activeAttributes)
|
||||
//this.tileMarkup = app.Assets.Store.html['/app/assets/html/mailing/tile.html']
|
||||
}
|
||||
|
||||
DOMContentFocused(options) {
|
||||
if(this.wasBlured){ // Avoid 2nd refesh on DomContentLoaded
|
||||
//this.refreshyoustuff()
|
||||
}
|
||||
this.wasBlured = false
|
||||
}
|
||||
|
||||
DOMContentBlured(options) { this.wasBlured = true }
|
||||
|
||||
DOMContentLoaded(options) {
|
||||
this.windowPrefsId = `editors.keyframeview.${options.mode}`
|
||||
for(let model in options.models) this[model] = options.models[model]
|
||||
this.kfe = options.kfe
|
||||
const components = ui.eicfy(this.el)
|
||||
this.setupTriggers(components)
|
||||
this.setupRefs(components)
|
||||
this.renderingEngine = this.kfe.startRendering(this.outputs.kfeCanvas, options.mode)
|
||||
this.output('settingsMenu',app.Assets.Store.html.sapceViewSetting)
|
||||
this.outputs.settingsMenu.querySelectorAll('input[type="toggler"]').forEach(el => {
|
||||
const tog = new InputToggler(el)
|
||||
if(this.kfe[tog._el.name].layers){
|
||||
tog.value = this.renderingEngine.camera.layers.test(this.kfe[tog._el.name].layers) ? 'yes' : 'no'
|
||||
}
|
||||
tog.onToggle = this.settingsToggle.bind(this)
|
||||
})
|
||||
}
|
||||
|
||||
settingsToggle(value, object){
|
||||
if(['grid','axes'].includes(object._el.name)){
|
||||
const layerId = {'grid':1,'axes':2}[object._el.name]
|
||||
if(value=='yes'){
|
||||
this.renderingEngine.camera.layers.enable(layerId)
|
||||
} else {
|
||||
this.renderingEngine.camera.layers.disable(layerId)
|
||||
}
|
||||
}
|
||||
//TODO save & restore in prefs
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
app.registerClass('KeyframeView', KeyframeView)
|
||||
@@ -1,9 +1,4 @@
|
||||
<style>
|
||||
article.mainDashboard{ height:100%; }
|
||||
article.mainDashboard>section:first-of-type{
|
||||
height:100%;
|
||||
background-color: #333;
|
||||
}
|
||||
canvas[data-output="ttbCanvas"]{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user