File tree Expand file tree Collapse file tree 5 files changed +56
-9
lines changed
Integrations/Autodesk/maya2017/scripts/unityOneClick Expand file tree Collapse file tree 5 files changed +56
-9
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,24 @@ private static Object LoadModel (string fbxFileName)
112
112
return modelGO as Object ;
113
113
}
114
114
115
+ private static Bounds GetRendererBounds ( GameObject modelGO )
116
+ {
117
+ var renderers = modelGO . GetComponentsInChildren < Renderer > ( ) ;
118
+ if ( renderers . Length > 0 ) {
119
+ var bounds = renderers [ 0 ] . bounds ;
120
+ for ( int i = 1 ; i < renderers . Length ; i ++ ) {
121
+ bounds . Encapsulate ( renderers [ i ] . bounds ) ;
122
+ }
123
+ return bounds ;
124
+ }
125
+ return new Bounds ( ) ;
126
+ }
127
+
115
128
private static void FrameCameraOnModel ( GameObject modelGO )
116
129
{
117
130
// Set so camera frames model
118
131
// Note: this code assumes the model is at 0,0,0
119
- Vector3 boundsSize = modelGO . GetComponent < Renderer > ( ) . bounds . size ;
132
+ Vector3 boundsSize = GetRendererBounds ( modelGO ) . size ;
120
133
float distance = Mathf . Max ( boundsSize . x , boundsSize . y , boundsSize . z ) ;
121
134
distance /= ( 2.0f * Mathf . Tan ( 0.5f * Camera . main . fieldOfView * Mathf . Deg2Rad ) ) ;
122
135
Camera . main . transform . position = new Vector3 ( Camera . main . transform . position . x , Camera . main . transform . position . y , - distance * 2.0f ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Copyright (c) 2017 Unity Technologies. All rights reserved.
4
4
5
5
See LICENSE.txt file for full license information.
6
6
7
- **Version**: 0.0.10a
7
+ **Version**: 0.0.11a
8
8
9
9
Requirements
10
10
------------
Original file line number Diff line number Diff line change @@ -222,12 +222,19 @@ def doIt(self, args):
222
222
return
223
223
224
224
# make sure the GamePipeline and fbxmaya plugins are loaded
225
- if self .loadDependencies ():
226
- # save fbx to Assets/_safe_to_delete/
227
- savePath = unityTempSavePath
228
- maya .cmds .sysFile (savePath , makeDir = True )
229
- savePath = savePath + "/TurnTableModel.fbx"
230
- maya .mel .eval (r'file -force -options "" -typ "FBX export" -pr -es "{0}"' .format (savePath ));
225
+ if not self .loadDependencies ():
226
+ return
227
+
228
+ # select the export set for export, if it exists,
229
+ # otherwise take what is currently selected
230
+ if self .setExists (self ._exportSet ):
231
+ maya .cmds .select (self ._exportSet , r = True , ne = True )
232
+
233
+ # save fbx to Assets/_safe_to_delete/
234
+ savePath = unityTempSavePath
235
+ maya .cmds .sysFile (savePath , makeDir = True )
236
+ savePath = savePath + "/TurnTableModel.fbx"
237
+ maya .mel .eval (r'file -force -options "" -typ "FBX export" -pr -es "{0}"' .format (savePath ));
231
238
232
239
if maya .cmds .about (macOS = True ):
233
240
# Use 'open -a' to bring app to front if it has already been started.
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def versionName():
32
32
Return version string for the unityOneClick plugin
33
33
@ingroup UnityOneClickPluginVersion
34
34
"""
35
- return '0.0.10a '
35
+ return '0.0.11a '
36
36
37
37
def pluginName ():
38
38
"""
Original file line number Diff line number Diff line change 1
1
RELEASE NOTES
2
2
3
+ ** Version** : 0.0.11a
4
+
5
+ NEW FEATURES
6
+
7
+ * Maya Integration: Publish automatically writes to the same file you imported from.
8
+
9
+ On Unity->Import, store the path and filename of the imported FBX as attributes on the export set.
10
+ On Unity->Publish, if path and filename attributes are set, publish directly to this location without prompting user.
11
+
12
+ * Maya Integration: Unity->Import creates export set containing imported objects
13
+
14
+ If an export set already exists, replace its contents with newly imported objects
15
+
16
+ * Maya Integration: Unity->Publish exports what is in the export set
17
+
18
+ Export contents of export set, or if there is no export set, then the current selection will be exported.
19
+
20
+ * Maya Integration: Fbx export options are set from a file in the Unity project
21
+
22
+ Export settings stored in Integrations/Autodesk/maya2017/scripts/unityFbxExportSettings.mel are loaded into Maya before
23
+ exporting either with Unity->Review or Unity->Publish.
24
+
25
+ FIXES
26
+
27
+ * Export Settings: fix export path doesn't refresh if selectable text box selected
28
+ * Convert to Prefab: fix model added to wrong scene if multiple scenes open
29
+
3
30
** Version** : 0.0.10a
4
31
5
32
NEW FEATURES
You can’t perform that action at this time.
0 commit comments