将.fbx文件中的UV更改合并回Maya

时间:2019-07-09 05:16:07

标签: python maya mel

我正在尝试导出a。来自Maya的FBX模型,在外部修改某些UV,然后将其重新导入Maya,仅替换已更改的部分。

要导出:

class AnalyticsFilterBackend(generic_filters.BaseFilterBackend): def filter_queryset(self, request, queryset, view): predicate = request.query_params # or request.data for POST if predicate.get('from_date', None) is not None and predicate.get('to_date', None) is not None: queryset = queryset.filter(your_date__range=(predicate['from_date'], predicate['to_date'])) if predicate.get('from_date', None) is not None and predicate.get('to_date', None) is None: queryset = queryset.filter(your_date__gte=predicate['from_date']) if predicate.get('to_date', None) is not None and predicate.get('from_date', None) is None: queryset = queryset.filter(your_date__lte=predicate['to_date']) return queryset

要导入:

cmds.file(myFile, type='FBX', exportSelected=True, lf=False, f=True)

但是,运行命令后,场景内没有任何变化。如何使用新的更改合并和覆盖当前场景?

1 个答案:

答案 0 :(得分:0)

代替此:

import maya.cmds as cmds

cmds.file(myFile, typ='FBX', es=True, lf=False, f=True)

如果您使用的是Python,则需要通过MEL评估传递您的选项:

import maya.mel as mel

mel.eval('FBXResetExport; 
          FBXExportInputConnections -v false; 
          FBXExportBakeComplexAnimation -v true; 
          FBXExportLights -v false; 
          FBXExportCameras -v false; 
          FBXExportInAscii -v true; 
          FBXExportFileVersion FBX201200; 
          FBXExportSmoothingGroups -v false; 
          FBXExportSmoothMesh -v false; 
          FBXExportApplyConstantKeyReducer -v false; 
          FBXExportBakeComplexAnimation -v true;  
          FBXExportBakeComplexStep -v 1;  
          FBXExportCameras -v false;’
        )

P.S。这是一个示例,代码看起来像