Skip to content

Commit 8c662f3

Browse files
authored
Merge pull request #161 from Unity-Technologies/Uni-26629-remove-preview
Uni-26629-remove-preview
2 parents 2ce4c1d + d890833 commit 8c662f3

File tree

5 files changed

+17
-182
lines changed

5 files changed

+17
-182
lines changed
Binary file not shown.

Assets/FbxExporters/Integrations/Autodesk/maya/scripts/unityOneClick/commands.py

Lines changed: 2 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -238,108 +238,6 @@ def invoke(cls):
238238
strCmd = '{0};'.format(cls.kCmdName)
239239
maya.mel.eval(strCmd) # @UndefinedVariable
240240

241-
class previewCmd(BaseCommand):
242-
"""
243-
Preview Model in Unity Window
244-
245-
@ingroup UnityCommands
246-
"""
247-
kIconPath = "preview.png"
248-
kLabel = 'Preview Model in Unity window'
249-
kShortLabel = 'Preview'
250-
kCmdName = "{}Preview".format(version.pluginPrefix())
251-
kScriptCommand = 'import maya.cmds;maya.cmds.{0}()'.format(kCmdName)
252-
kRuntimeCommand = "UnityOneClickPreview"
253-
254-
def __init__(self):
255-
super(self.__class__, self).__init__()
256-
257-
@classmethod
258-
def creator(cls):
259-
return OpenMayaMPx.asMPxPtr(cls())
260-
261-
@classmethod
262-
def syntaxCreator(cls):
263-
syntax = OpenMaya.MSyntax()
264-
return syntax
265-
266-
@classmethod
267-
def scriptCmd(cls):
268-
return
269-
270-
def doIt(self, args):
271-
272-
unityAppPath = maya.cmds.optionVar(q='UnityApp')
273-
unityProjectPath = maya.cmds.optionVar(q='UnityProject')
274-
unityTempSavePath = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityTempSavePath'))
275-
unityCommand = "FbxExporters.Review.TurnTable.LastSavedModel"
276-
if maya.cmds.optionVar(exists='UnityInstructionPath'):
277-
instructionFile = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityInstructionPath'))
278-
else:
279-
self.displayError("Missing Unity instruction file path, please re-install integration.")
280-
return
281-
282-
# make sure the GamePipeline and fbxmaya plugins are loaded
283-
if not self.loadDependencies():
284-
return
285-
286-
if not self.loadUnityFbxExportSettings():
287-
return
288-
289-
# select the export set for export, if it exists,
290-
# otherwise take what is currently selected
291-
origSelection = maya.cmds.ls(sl=True)
292-
if self.setExists(self._exportSet):
293-
maya.cmds.select(self._exportSet, r=True, ne=True)
294-
295-
# save fbx to Assets/_safe_to_delete/
296-
savePath = unityTempSavePath
297-
maya.cmds.sysFile(savePath, makeDir=True)
298-
savePath = os.path.join(savePath, "TurnTableModel.fbx")
299-
savePath = os.path.abspath(savePath)
300-
301-
maya.cmds.file(savePath, force=True, options="", typ="FBX export", pr=True, es=True)
302-
303-
# create temp file in _safe_to_delete/
304-
with open(instructionFile,"w+") as f:
305-
pass
306-
307-
if maya.cmds.about(macOS=True):
308-
# Use 'open -a' to bring app to front if it has already been started.
309-
# Note that the unity command will not get called.
310-
melCommand = r'system("open -a \"{0}\" --args -projectPath \"{1}\" -executeMethod {2}");'\
311-
.format(unityAppPath, unityProjectPath, unityCommand)
312-
313-
elif maya.cmds.about(linux=True):
314-
melCommand = r'system("\"{0}\" -projectPath \"{1}\" -executeMethod {2}");'\
315-
.format(unityAppPath, unityProjectPath, unityCommand)
316-
317-
elif maya.cmds.about(windows=True):
318-
melCommand = r'system("start \"{0}\" \"{1}\" \"{2}\" \"-projectPath {3} -executeMethod {4}\"");'\
319-
.format(unityProjectPath + "/Assets/FbxExporters/Integrations/BringToFront.exe",
320-
os.path.basename(unityProjectPath), unityAppPath,
321-
unityProjectPath, unityCommand)
322-
323-
else:
324-
raise NotImplementedError("missing platform implementation for {0}".format(maya.cmds.about(os=True)))
325-
326-
self.displayDebug('doIt({0})'.format(melCommand))
327-
328-
maya.mel.eval(melCommand)
329-
330-
if origSelection:
331-
maya.cmds.select(cl=True)
332-
maya.cmds.select(origSelection, add=True, ne=True)
333-
334-
@classmethod
335-
def invoke(cls):
336-
"""
337-
Invoke command using mel so that it is executed and logged to script editor log
338-
@return: void
339-
"""
340-
strCmd = '{0};'.format(cls.kCmdName)
341-
maya.mel.eval(strCmd) # @UndefinedVariable
342-
343241
class exportCmd(BaseCommand):
344242
"""
345243
Export Model to Unity
@@ -407,62 +305,14 @@ def invoke(cls):
407305
strCmd = '{0};'.format(cls.kCmdName)
408306
maya.mel.eval(strCmd) # @UndefinedVariable
409307

410-
class configureCmd(BaseCommand):
411-
"""
412-
Configure Maya Scene for previewing and exporting to Unity
413-
414-
@ingroup UnityCommands
415-
"""
416-
kLabel = 'Configure Maya to preview and export to a Unity Project'
417-
kShortLabel = 'Configure'
418-
kCmdName = "{}Configure".format(version.pluginPrefix())
419-
kScriptCommand = 'import maya.cmds;maya.cmds.{0}()'.format(kCmdName)
420-
kRuntimeCommand = "UnityOneClickConfigure"
421-
422-
def __init__(self):
423-
super(self.__class__, self).__init__()
424-
425-
@classmethod
426-
def creator(cls):
427-
return OpenMayaMPx.asMPxPtr(cls())
428-
429-
@classmethod
430-
def syntaxCreator(cls):
431-
syntax = OpenMaya.MSyntax()
432-
return syntax
433-
434-
@classmethod
435-
def scriptCmd(cls):
436-
return
437-
438-
def doIt(self, args):
439-
# make sure the GamePipeline plugin is loaded
440-
if not self.loadDependencies():
441-
return
442-
443-
strCmd = 'SendToUnitySetProject'
444-
self.displayDebug('doIt {0}'.format(strCmd))
445-
maya.mel.eval(strCmd)
446-
447-
@classmethod
448-
def invoke(cls):
449-
"""
450-
Invoke command using mel so that it is executed and logged to script editor log
451-
@return: void
452-
"""
453-
strCmd = '{0};'.format(cls.kCmdName)
454-
maya.mel.eval(strCmd) # @UndefinedVariable
455-
456308
def register(pluginFn):
457309
"""
458310
Register commands for plugin
459311
@param pluginFn (MFnPlugin): plugin object passed to initializePlugin
460312
"""
461313
pluginFn.registerCommand(importCmd.kCmdName, importCmd.creator, importCmd.syntaxCreator)
462-
pluginFn.registerCommand(previewCmd.kCmdName, previewCmd.creator, previewCmd.syntaxCreator)
463314
pluginFn.registerCommand(exportCmd.kCmdName, exportCmd.creator, exportCmd.syntaxCreator)
464-
pluginFn.registerCommand(configureCmd.kCmdName, configureCmd.creator, configureCmd.syntaxCreator)
465-
315+
466316
return
467317

468318
def unregister(pluginFn):
@@ -471,9 +321,7 @@ def unregister(pluginFn):
471321
@param pluginFn (MFnPlugin): plugin object passed to uninitializePlugin
472322
"""
473323
pluginFn.deregisterCommand(importCmd.kCmdName)
474-
pluginFn.deregisterCommand(previewCmd.kCmdName)
475324
pluginFn.deregisterCommand(exportCmd.kCmdName)
476-
pluginFn.deregisterCommand(configureCmd.kCmdName)
477325
return
478326

479327
#===============================================================================
@@ -502,23 +350,13 @@ class importCmdTestCase(BaseCmdTest):
502350
"""
503351
__cmd__ = importCmd
504352

505-
class previewCmdTestCase(BaseCmdTest):
506-
"""UnitTest for testing the previewCmd command
507-
"""
508-
__cmd__ = previewCmd
509-
510353
class exportCmdTestCase(BaseCmdTest):
511354
"""UnitTest for testing the exportCmd command
512355
"""
513356
__cmd__ = exportCmd
514357

515-
class configureCmdTestCase(BaseCmdTest):
516-
"""UnitTest for testing the configureCmd command
517-
"""
518-
__cmd__ = configureCmd
519-
520358
# NOTE: update this for test discovery
521-
test_cases = (importCmdTestCase, previewCmdTestCase, exportCmdTestCase, configureCmdTestCase,)
359+
test_cases = (importCmdTestCase, exportCmdTestCase,)
522360

523361
def load_tests(loader, tests, pattern):
524362
suite = unittest.TestSuite()

Assets/FbxExporters/Integrations/Autodesk/maya/scripts/unityOneClick/ui.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,7 @@ def installMenu():
9595
command=commands.importCmd.kScriptCommand,
9696
image=commands.importCmd.iconPath(),
9797
version=whatsNewVersion())
98-
maya.cmds.menuItem(parent=kMenuName,
99-
label=commands.previewCmd.kShortLabel,
100-
annotation=commands.previewCmd.kLabel,
101-
command=commands.previewCmd.kScriptCommand,
102-
image=commands.previewCmd.iconPath(),
103-
version=whatsNewVersion())
104-
maya.cmds.menuItem(parent=kMenuName,
98+
maya.cmds.menuItem(parent=kMenuName,
10599
label=commands.exportCmd.kShortLabel,
106100
annotation=commands.exportCmd.kLabel,
107101
command=commands.exportCmd.kScriptCommand,

Assets/FbxExporters/Integrations/Autodesk/maya/scripts/unityOneClick/version.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@defgroup UnityOneClickPluginVersion Plugin Version
2020
@ingroup UnityOneClickPlugin
2121
"""
22+
VERSION = '1.0.0a1-sprint27'
2223

2324
def pluginPrefix():
2425
"""
@@ -32,14 +33,14 @@ def versionName():
3233
Return version string for the unityOneClick plugin
3334
@ingroup UnityOneClickPluginVersion
3435
"""
35-
return '0.0.14a'
36+
return VERSION
3637

3738
def pluginName():
3839
"""
3940
Return name of unityOneClick plugin
4041
@ingroup UnityOneClickPluginVersion
4142
"""
42-
return '{}.unityOneClick'.format(pluginPrefix())
43+
return 'UnityOneClick'
4344

4445
def vendorName():
4546
"""

Assets/FbxExporters/README.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
# FbxExporters
1+
FbxExporters Package
2+
====================
23

34
Copyright (c) 2017 Unity Technologies. All rights reserved.
45

56
See LICENSE.txt file for full license information.
67

7-
VERSION: sprint26
8+
VERSION: 1.0.0a1-sprint27
89

910
Requirements
1011
------------
1112

12-
* [FBX SDK C# Bindings](https://github.com/Unity-Technologies/FbxSharp)
13+
The Unity Integration for Maya is designed to work with Maya 2017 or later.
1314

14-
Installing Maya Integration
15-
--------------------------------------------
15+
Please note that MayaLT is not supported at this time.
1616

17-
The easiest way to install the Maya integration is from the menu option in Unity.
17+
Installing Unity Integration for Maya
18+
-------------------------------------
1819

19-
FbxExporters -> Install Maya Integration
20+
The easiest way to install the Unity integration For Maya is from the FbxExports Settings panel in Unity.
21+
22+
MenuBar -> Edit -> Project Settings -> Fbx Export -> Install Unity Integration
2023

2124
This menu item locates and uses the most recent version of Maya installed. If you want
22-
to specify a custom version or location then set your MAYA_LOCATION environment
23-
before running Unity.
25+
to specify a custom version or location you can browse and locate your version.
2426

2527
Alternately, you can install the package and integrations from the command-line
2628
using a script, an example of which can be found in the scripts folder of the

0 commit comments

Comments
 (0)