1
1
import * as EVENTS from '../constants/events'
2
2
import { format , format as modelFormat } from '../modelFormat'
3
+ import { settings } from '../settings'
3
4
import { bus } from '../util/bus'
4
- import { wrapNumber } from '../util/misc'
5
+ import { safeFunctionName } from '../util/replace'
6
+ import * as pathjs from 'path'
7
+ import { normalizePath } from '../util/misc'
5
8
6
9
const oldConvertFunc = ModelFormat . prototype . convertTo
7
10
@@ -17,6 +20,9 @@ ModelFormat.prototype.convertTo = function convertTo() {
17
20
if ( Format . id === format . id ) {
18
21
Project . UUID = guid ( )
19
22
}
23
+ // Set project name
24
+ settings . animatedJava . projectName = safeFunctionName ( Project . name )
25
+
20
26
// Box UV
21
27
if ( ! this . optional_box_uv ) Project . box_uv = this . box_uv
22
28
@@ -133,7 +139,8 @@ ModelFormat.prototype.convertTo = function convertTo() {
133
139
Cube . all . forEach ( ( cube ) => {
134
140
if ( ! cube . rotation . allEqual ( 0 ) ) {
135
141
var axis =
136
- ( cube . rotation_axis && getAxisNumber ( cube . rotation_axis ) ) ||
142
+ ( cube . rotationAxis ( ) &&
143
+ getAxisNumber ( cube . rotation_axis ) ) ||
137
144
0
138
145
var angle = limitNumber (
139
146
Math . round ( cube . rotation [ axis ] / 22.5 ) * 22.5 ,
@@ -150,6 +157,14 @@ ModelFormat.prototype.convertTo = function convertTo() {
150
157
if ( ! Format . animation_mode && old_format . animation_mode ) {
151
158
Animator . animations . length = 0
152
159
}
160
+
161
+ Project . saved = false
162
+ hideDialog ( )
163
+
164
+ let file = pathjs . parse ( Project . save_path )
165
+ Project . export_path = normalizePath ( `${ file . dir } .${ Project . format . codec . extension } ` )
166
+ // Project.format.codec.export()
167
+
153
168
Canvas . updateAllPositions ( )
154
169
Canvas . updateAllBones ( )
155
170
Canvas . updateAllFaces ( )
0 commit comments