Skip to content

Commit c382861

Browse files
committed
CR changes
1 parent f389d7e commit c382861

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ class Integrations
1313
private const string VERSION_FIELD = "**Version**";
1414
private const string VERSION_TAG = "{Version}";
1515
private const string PROJECT_TAG = "{UnityProject}";
16+
private const string INTEGRATION_TAG = "{UnityIntegrationsPath}";
1617

17-
private const string FBX_EXPORT_SETTINGS_PATH = "FbxExporters/Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel";
18+
private const string FBX_EXPORT_SETTINGS_PATH = "/Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel";
1819

1920
private const string MAYA_INSTRUCTION_FILENAME = "_safe_to_delete/_temp.txt";
2021

@@ -131,7 +132,7 @@ public static string GetFullMayaInstructionPath()
131132
/// <returns>The export settings path.</returns>
132133
public static string GetExportSettingsPath()
133134
{
134-
return FBX_EXPORT_SETTINGS_PATH;
135+
return INTEGRATION_FOLDER_PATH + FBX_EXPORT_SETTINGS_PATH;
135136
}
136137

137138
public static string GetPackageVersion()
@@ -338,7 +339,8 @@ public static bool InstallMaya(bool verbose = false)
338339
Dictionary<string,string> Tokens = new Dictionary<string,string>()
339340
{
340341
{VERSION_TAG, GetPackageVersion() },
341-
{PROJECT_TAG, GetProjectPath() }
342+
{PROJECT_TAG, GetProjectPath() },
343+
{INTEGRATION_TAG, INTEGRATION_FOLDER_PATH },
342344
};
343345

344346
// parse template, replace "{UnityProject}" with project path

Assets/FbxExporters/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (c) 2017 Unity Technologies. All rights reserved.
44

55
See LICENSE.txt file for full license information.
66

7-
**Version**: build20170921001 build20170921001 0.0.14a
7+
**Version**: 0.0.14a
88

99
Requirements
1010
------------

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,16 @@ def scriptCmd(cls):
268268
return
269269

270270
def doIt(self, args):
271+
def integrationBinPath():
272+
head, tail = os.path.split(maya.cmds.pluginInfo("unityOneClickPlugin", q=True, path=True))
273+
head, tail = os.path.split(head)
274+
return head
271275

272276
unityAppPath = maya.cmds.optionVar(q='UnityApp')
273277
unityProjectPath = maya.cmds.optionVar(q='UnityProject')
274278
unityTempSavePath = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityTempSavePath'))
275279
unityCommand = "FbxExporters.Review.TurnTable.LastSavedModel"
280+
276281
if maya.cmds.optionVar(exists='UnityInstructionPath'):
277282
instructionFile = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityInstructionPath'))
278283
else:
@@ -316,7 +321,7 @@ def doIt(self, args):
316321

317322
elif maya.cmds.about(windows=True):
318323
melCommand = r'system("start \"{0}\" \"{1}\" \"{2}\" \"-projectPath {3} -executeMethod {4}\"");'\
319-
.format(unityProjectPath + "/Assets/FbxExporters/Integrations/BringToFront.exe",
324+
.format(integrationBinPath() + "/BringToFront.exe",
320325
os.path.basename(unityProjectPath), unityAppPath,
321326
unityProjectPath, unityCommand)
322327

Assets/Integrations/Autodesk/maya/unityoneclick.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
#
1414
########################################################################
1515

16-
+ unityoneclick {Version} {UnityProject}/Assets/FbxExporters/Integrations/Autodesk/maya
16+
+ unityoneclick {Version} {UnityIntegrationsPath}/Integrations/Autodesk/maya

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ set(FBXSDK_PACKAGE_TARGET import_fbxsdk)
7777
add_custom_target(
7878
${FBXSDK_PACKAGE_TARGET}
7979
COMMAND "${UNITY_EDITOR_PATH}" -projectPath "${CMAKE_SOURCE_DIR}" -importPackage ${FBXSDK_PACKAGE_PATH} -quit
80-
COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_SOURCE_DIR}/Assets/FbxSdk" "${CMAKE_SOURCE_DIR}/Assets/FbxExporters/FbxSdk"
8180
)
8281

82+
IF(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/Assets/FbxSdk")
83+
file(RENAME "${CMAKE_SOURCE_DIR}/Assets/FbxSdk" "${CMAKE_SOURCE_DIR}/Assets/FbxExporters/FbxSdk")
84+
ELSE()
85+
message("Error failed to install FbxSdk")
86+
ENDIF()
87+
8388
###########################################################################
8489
# TODO: Add target to replace the version number in README.txt
8590

@@ -92,7 +97,9 @@ set(MAYA_INTEGRATION_ZIP_NAME "unityoneclick_for_maya.zip")
9297
file(REMOVE "${CMAKE_SOURCE_DIR}/Assets/FbxExporters/${MAYA_INTEGRATION_ZIP_NAME}")
9398
# remove .pyc files that we don't want to ship
9499
file(GLOB PYC_FILES "${CMAKE_SOURCE_DIR}/Assets/Integrations/Autodesk/maya/scripts/unityOneClick/*.pyc")
95-
file(REMOVE ${PYC_FILES})
100+
IF( PYC_FILES )
101+
file(REMOVE ${PYC_FILES})
102+
ENDIF()
96103

97104
add_custom_command(OUTPUT ${MAYA_INTEGRATION_ZIP_NAME}
98105
COMMAND ${CMAKE_COMMAND} -E tar "cfv" ${CMAKE_SOURCE_DIR}/Assets/FbxExporters/${MAYA_INTEGRATION_ZIP_NAME} --format=zip

0 commit comments

Comments
 (0)