import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { Link } from 'react-router-dom'; import { connect } from 'react-redux' import util from '../../../util' import actions from '../../../actions' import * as morphActions from '../morph.actions' import * as morphTasks from '../morph.tasks' import Loading from '../../../common/loading.component' import { Select, Slider, Checkbox, Group, Button, Param, FileList, FileRow, CurrentTask, } from '../../../common' let yes_count = 0 class MorphResults extends Component { constructor(props){ super() this.state = { dataset_module: 'pix2pixhd', a: "PLACEHOLDER", b: "PLACEHOLDER", a_offset: 0, a_duration: 1, a_pos: 0, b_offset: 0, b_duration: 1, b_pos: 0, steps: 16, dilate: 2, frames: 32, padding: 3, smooth: true, mode: 'mix', } if (!props.morph.data) props.actions.load_data() } componentDidMount(){ yes_count = 0 } render(){ if (! this.props.morph.app) return const { resultsFolder, sequences, renders, files } = this.props.morph.app const sequence_options = sequences.map(sequence => [ sequence.name.split("_").slice(0, 3).join(" ") + "~ (" + sequence.count + ")", sequence.name ]) const sequenceLookup = sequences.reduce((a,b) => (a[b.name]=b,a), {}) const totalLength = this.state.frames / 25 let lengthWarning if ((this.state.steps / this.state.dilate) > 64 && this.state.mode === 'mix') { lengthWarning = (
warning, this will take a while
) } return (

Morph

this.setState({ b: key, b_duration: sequenceLookup[key].count, b_pos: 0, b_offset: 0 })} /> this.setState({ b_pos: key, b_offset: Math.floor(key * (this.state.b_duration - this.state.frames)) })} />