Skip to content

Commit c545a32

Browse files
authored
UT-3483 Changed label name for strip custom namespace option. (#528)
Changed label for specific namespace and namespace checkbox. Update doc with new labels and images.
1 parent 0fd2706 commit c545a32

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

Integrations/Autodesk/maya/scripts/unityCommands.mel

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ global string $UnityFbxFilePathAttr = "unityFbxModelFilePath";
22
global string $UnityFbxFileNameAttr = "unityFbxModelFileName";
33
global string $UnityFbxAnimFilePathAttr = "unityFbxAnimFilePath";
44
global string $UnityFbxAnimFileNameAttr = "unityFbxAnimFileName";
5-
global string $UnityFbxStripNamespaceAttr = "unityFbxStripNamespaces";
6-
global string $UnityFbxNamespaceAttr = "unityFbxNamespace";
5+
global string $UnityFbxStripNamespaceAttr = "unityFbxStripNamespace";
6+
global string $UnityFbxNamespaceAttr = "unityFbxStripSpecificNamespace";
7+
global string $UnityFbxNamespaceAttrNiceName = "Strip Specific Namespace";
78
global string $UnityExportSetNameFormat = "^1s_UnityExportSet";
89

910
global string $UnityModuleName = "UnityFbxForMaya";
@@ -154,10 +155,15 @@ proc storeBoolAttribute(string $node, string $attr, int $attrValue){
154155
setAttr ($node+"."+$attr) $attrValue;
155156
}
156157

157-
proc storeStringAttribute(string $node, string $attr, string $attrValue){
158+
proc storeStringAttribute(string $node, string $attr, string $attrValue, string $niceName){
158159
$attrType = "string";
159160
if (!attributeExists($attr, $node)){
160-
addAttr -shortName $attr -storable true -dataType $attrType $node;
161+
if ($niceName != ""){
162+
addAttr -shortName $attr -niceName $niceName -storable true -dataType $attrType $node;
163+
}
164+
else {
165+
addAttr -shortName $attr -storable true -dataType $attrType $node;
166+
}
161167
}
162168
setAttr ($node+"."+$attr) -type $attrType $attrValue;
163169
}
@@ -319,6 +325,7 @@ proc setExportSetAttributes(
319325
global string $UnityFbxAnimFileNameAttr;
320326
global string $UnityFbxStripNamespaceAttr;
321327
global string $UnityFbxNamespaceAttr;
328+
global string $UnityFbxNamespaceAttrNiceName;
322329

323330
global int $UnityFbxFilePathIndex;
324331
global int $UnityFbxFileNameIndex;
@@ -336,24 +343,24 @@ proc setExportSetAttributes(
336343
lockNode -lock false $unityExportSet;
337344

338345
if ((!$isAnimFile || ($isAnimFile && $setCreated)) && $exportDir != ""){
339-
storeStringAttribute($unityExportSet, $UnityFbxFilePathAttr, $exportDir);
346+
storeStringAttribute($unityExportSet, $UnityFbxFilePathAttr, $exportDir, "");
340347
}
341348

342349
if ((!$isAnimFile || ($isAnimFile && $setCreated)) && $exportFileName != ""){
343-
storeStringAttribute($unityExportSet,$UnityFbxFileNameAttr,$exportFileName);
350+
storeStringAttribute($unityExportSet,$UnityFbxFileNameAttr,$exportFileName, "");
344351
}
345352

346353
if($exportAnimDir != ""){
347-
storeStringAttribute($unityExportSet,$UnityFbxAnimFilePathAttr,$exportAnimDir);
354+
storeStringAttribute($unityExportSet,$UnityFbxAnimFilePathAttr,$exportAnimDir, "");
348355
}
349356

350357
if($exportAnimFileName != ""){
351-
storeStringAttribute($unityExportSet,$UnityFbxAnimFileNameAttr,$exportAnimFileName);
358+
storeStringAttribute($unityExportSet,$UnityFbxAnimFileNameAttr,$exportAnimFileName, "");
352359
}
353360

354361
storeBoolAttribute($unityExportSet, $UnityFbxStripNamespaceAttr, $stripNamespaces);
355362

356-
storeStringAttribute($unityExportSet, $UnityFbxNamespaceAttr, "");
363+
storeStringAttribute($unityExportSet, $UnityFbxNamespaceAttr, "", $UnityFbxNamespaceAttrNiceName);
357364

358365
$stripNamespaceAttrName = ($unityExportSet + "." + $UnityFbxStripNamespaceAttr);
359366
setAttr -lock (!$stripNamespaces) $stripNamespaceAttrName;
@@ -442,8 +449,8 @@ proc importFile(string $filePathStr){
442449

443450
if(!$isAnimFile){
444451
// reset attribute values, in case import fails
445-
storeStringAttribute($unityExportSet, $UnityFbxFilePathAttr, "");
446-
storeStringAttribute($unityExportSet, $UnityFbxFileNameAttr, "");
452+
storeStringAttribute($unityExportSet, $UnityFbxFilePathAttr, "", "");
453+
storeStringAttribute($unityExportSet, $UnityFbxFileNameAttr, "", "");
447454
}
448455

449456
if(`namespaceInfo -cur -an` != $targetNamespace){
@@ -1097,4 +1104,4 @@ global proc unityExportModelAnim(){
10971104
global proc unityCreateExportSet(){
10981105
global int $UnityExportModelAnim;
10991106
createExportSetDialog($UnityExportModelAnim);
1100-
}
1107+
}
39.6 KB
Loading

com.unity.formats.fbx/Documentation~/integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,16 @@ on the set. In order to do so, select the set, go to the Attribute Editor, and m
165165

166166
> **NOTE:** If Arnold is installed, the attributes may appear in the Attribute Editor under __Arnold__ > __Extra Attributes__
167167
168-
![](images/FBXExporter_MayaExportSetAttributes.PNG)
168+
![](images/FBXExporter_MayaExportSetAttributes_Updated.png)
169169

170170
| Property: | Function: |
171171
| :---------------------------- | :----------------------------------------------------------- |
172172
| __Unity Fbx Model File Path__ | The file path to export to when calling __File__ > __Unity__ > __Export__ and __File__ > __Unity__ > __Export Model Only__. |
173173
| __Unity Fbx Model File Name__ | The file name to export to when calling __File__ > __Unity__ > __Export__ and __File__ > __Unity__ > __Export Model Only__. |
174174
| __Unity Fbx Anim File Path__ | The file path to export to when calling __File__ > __Unity__ > __Export Animation Only__. |
175175
| __Unity Fbx Anim File Name__ | The file name to export to when calling __File__ > __Unity__ > __Export Animation Only__. |
176-
| __Unity Fbx Strip Namespaces__ | Check this option to automatically strip the most common namespace in the set on export (e.g. if most objects are in namespace `model:`, then `model:` will be stripped on export). |
177-
| __Unity Fbx Namespace__ | (Optional) Specify a custom namespace to strip on export. If the `Unity Fbx Strip Namespaces` checkbox is checked and the Namespace field is empty, then it will find the most common namespace to strip. Otherwise, if the checkbox is checked and the namespace field is not empty, then the namespace specified in this field will be stripped. |
176+
| __Unity Fbx Strip Namespace__ | Check this option to automatically strip the most common namespace in the set on export (e.g. if most objects are in namespace `model:`, then `model:` will be stripped on export). |
177+
| __Strip Specific Namespace__ | (Optional) Specify a custom namespace to strip on export. When the `Unity Fbx Strip Namespace` checkbox is checked, the namespace in `Strip Specific Namespace` will be stripped; otherwise the most common namespace will be stripped if `Strip Specific Namespace` is left empty.|
178178

179179
## Working with Autodesk® 3ds Max® 2017+
180180

0 commit comments

Comments
 (0)