├── ImportScene
├── en.lproj
│ └── InfoPlist.strings
├── DisplayLink.cxx
├── DisplayMesh.cxx
├── DisplayNurb.cxx
├── DisplayCommon.cxx
├── DisplayAnimation.cxx
├── DisplayHierarchy.cxx
├── DisplayGenericInfo.h
├── DisplayCache.h
├── DisplayMesh.h
├── DisplayNurb.h
├── DisplayLight.h
├── DisplayPatch.h
├── DisplayPose.h
├── DisplayLink.h
├── DisplayMarker.h
├── DisplayLodGroup.h
├── DisplayShape.h
├── DisplaySkeleton.h
├── DisplayMaterial.h
├── DisplayPivotsAndLimits.h
├── DisplayUserProperties.h
├── DisplayAnimation.h
├── DisplayHierarchy.h
├── DisplayTexture.h
├── DisplayGlobalSettings.h
├── Common.h
├── AppDelegate.h
├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── MetadataViewController.h
├── SceneFilesController.h
├── main.m
├── GenericViewController.h
├── ImportScene-Prefix.pch
├── FileStructureController.h
├── DisplayCamera.h
├── DisplayCommon.h
├── NSFbxObject.h
├── main.h
├── DisplaySkeleton.cxx
├── DisplayGlobalSettings.cxx
├── ImportScene-Info.plist
├── NSFbxObject.mm
├── DisplayLight.cxx
├── DisplayLodGroup.cxx
├── DisplayMarker.cxx
├── DisplayPatch.cxx
├── DisplayShape.cxx
├── AppDelegate.m
├── SceneFilesController.mm
├── DisplayPose.cxx
├── MetadataViewController.mm
├── GenericViewController.mm
├── FileStructureController.mm
├── DisplayUserProperties.cxx
├── DisplayGenericInfo.cxx
├── DisplayCache.cxx
├── DisplayPivotsAndLimits.cxx
├── DisplayTexture.cxx
├── Common.cxx
├── main.cxx
├── DisplayCamera.cxx
├── DisplayMaterial.cxx
└── Base.lproj
│ └── Main_iPad.storyboard
├── ImportSceneTests
├── en.lproj
│ └── InfoPlist.strings
├── ImportSceneTests-Info.plist
└── ImportSceneTests.m
├── Samples
├── humanoid.fbx
└── FBX_ASCII_TEXTURE
├── ImportScene.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── cyrille.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── ImportScene.xccheckout
└── xcuserdata
│ └── cyrille.xcuserdatad
│ ├── xcschemes
│ ├── xcschememanagement.plist
│ └── ImportScene.xcscheme
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
├── .gitignore
├── README.md
└── LICENSE
/ImportScene/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/ImportSceneTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Samples/humanoid.fbx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/Samples/humanoid.fbx
--------------------------------------------------------------------------------
/ImportScene/DisplayLink.cxx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene/DisplayLink.cxx
--------------------------------------------------------------------------------
/ImportScene/DisplayMesh.cxx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene/DisplayMesh.cxx
--------------------------------------------------------------------------------
/ImportScene/DisplayNurb.cxx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene/DisplayNurb.cxx
--------------------------------------------------------------------------------
/Samples/FBX_ASCII_TEXTURE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/Samples/FBX_ASCII_TEXTURE
--------------------------------------------------------------------------------
/ImportScene/DisplayCommon.cxx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene/DisplayCommon.cxx
--------------------------------------------------------------------------------
/ImportScene/DisplayAnimation.cxx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene/DisplayAnimation.cxx
--------------------------------------------------------------------------------
/ImportScene/DisplayHierarchy.cxx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene/DisplayHierarchy.cxx
--------------------------------------------------------------------------------
/ImportScene.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ImportScene.xcodeproj/project.xcworkspace/xcuserdata/cyrille.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyrillef/FBX-iOS-ImportScene/HEAD/ImportScene.xcodeproj/project.xcworkspace/xcuserdata/cyrille.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # CocoaPods
2 | #
3 | # We recommend against adding the Pods directory to your .gitignore. However
4 | # you should judge for yourself, the pros and cons are mentioned at:
5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control?
6 | #
7 | # Pods/
8 | [Bb]uild
9 |
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | FBX SDK iOS ImportScene example
3 | ===================
4 |
5 | This example illustrates how to detect if a scene is password
6 | protected, import and browse the scene to access node and animation
7 | information. It displays the content of the FBX file.
8 | You can try it with the various FBX / OBJ files.
9 |
10 |
11 |
12 | To get instructions and comments on this example, read this [article](http://around-the-corner.typepad.com/adn/2014/07/an-fbx-sdk-ios-quick-tutorial.html)
13 |
14 | -
--------------------------------------------------------------------------------
/ImportScene/DisplayGenericInfo.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_GENERIC_INFO_H_
13 | #define _DISPLAY_GENERIC_INFO_H_
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayGenericInfo(FbxScene* pScene);
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/ImportScene/DisplayCache.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_CACHE_H
13 | #define _DISPLAY_CACHE_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayCache(FbxGeometry* pGeometry);
18 |
19 | #endif // #ifndef _DISPLAY_CACHE_H
20 |
--------------------------------------------------------------------------------
/ImportScene/DisplayMesh.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_MESH_H
13 | #define _DISPLAY_MESH_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayMesh(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_MESH_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayNurb.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_NURB_H
13 | #define _DISPLAY_NURB_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayNurb(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_NURB_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayLight.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_LIGHT_H
13 | #define _DISPLAY_LIGHT_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayLight(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_LIGHT_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayPatch.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_PATCH_H
13 | #define _DISPLAY_PATCH_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayPatch(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_PATCH_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayPose.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_POSE_H
13 | #define _DISPLAY_POSE_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayPose(FbxScene* pScene);
18 |
19 | #endif // #ifndef _DISPLAY_POSE_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayLink.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_LINK_H
13 | #define _DISPLAY_LINK_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayLink(FbxGeometry* pGeometry);
18 |
19 | #endif // #ifndef _DISPLAY_LINK_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayMarker.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_MARKER_H
13 | #define _DISPLAY_MARKER_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayMarker(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_MARKER_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayLodGroup.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_LODGROUP_H
13 | #define _DISPLAY_LODGROUP_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayLodGroup(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_LODGROUP_H
20 |
21 |
--------------------------------------------------------------------------------
/ImportScene/DisplayShape.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_SHAPE_H
13 | #define _DISPLAY_SHAPE_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayShape(FbxGeometry* pGeometry);
18 |
19 | #endif // #ifndef _DISPLAY_SHAPE_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplaySkeleton.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_SKELETON_H
13 | #define _DISPLAY_SKELETON_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplaySkeleton(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_SKELETON_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayMaterial.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_MATERIAL_H
13 | #define _DISPLAY_MATERIAL_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayMaterial(FbxGeometry* pGeometry);
18 |
19 | #endif // #ifndef _DISPLAY_MATERIAL_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene.xcodeproj/xcuserdata/cyrille.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ImportScene.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | E63B24891966AA0200595E90
16 |
17 | primary
18 |
19 |
20 | E63B24AD1966AA0200595E90
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ImportScene/DisplayPivotsAndLimits.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_PIVOTS_AND_LIMITS_H
13 | #define _DISPLAY_PIVOTS_AND_LIMITS_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayPivotsAndLimits(FbxNode* pNode);
18 |
19 | #endif // #ifndef _DISPLAY_PIVOTS_AND_LIMITS_H
20 |
21 |
--------------------------------------------------------------------------------
/ImportScene/DisplayUserProperties.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_USER_PROPERTIES_H
13 | #define _DISPLAY_USER_PROPERTIES_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayUserProperties(FbxObject* pObject);
18 |
19 | #endif // #ifndef _DISPLAY_USER_PROPERTIES_H
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ImportScene/DisplayAnimation.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_ANIMATION_H
13 | #define _DISPLAY_ANIMATION_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayAnimation(FbxScene* pScene);
18 | void DisplayDefaultAnimation(FbxNode* pNode);
19 |
20 | #endif // #ifndef _DISPLAY_ANIMATION_H
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ImportScene/DisplayHierarchy.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_HIERARCHY_H
13 | #define _DISPLAY_HIERARCHY_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayHierarchy(FbxScene* pScene);
18 | void DisplayHierarchy(FbxNode* pNode, int pDepth);
19 |
20 | #endif // #ifndef _DISPLAY_HIERARCHY_H
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ImportSceneTests/ImportSceneTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.autodesk.adn.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ImportScene/DisplayTexture.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_TEXTURE_H
13 | #define _DISPLAY_TEXTURE_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void FindAndDisplayTextureInfoByProperty(FbxProperty pProperty, bool& pDisplayHeader, int pMaterialIndex);
18 | void DisplayTexture(FbxGeometry* pGeometry);
19 | void DisplayTextureInfo(FbxTexture* pTexture, int pBlendMode);
20 |
21 | #endif // #ifndef _DISPLAY_TEXTURE_H
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ImportScene/DisplayGlobalSettings.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_GLOBAL_SETTINGS_H
13 | #define _DISPLAY_GLOBAL_SETTINGS_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayGlobalLightSettings(FbxGlobalSettings* pGlobalSettings);
18 | void DisplayGlobalCameraSettings(FbxGlobalSettings* pGlobalSettings);
19 | void DisplayGlobalTimeSettings(FbxGlobalSettings* pGlobalSettings);
20 |
21 | #endif // #ifndef _DISPLAY_GLOBAL_SETTINGS_H
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ImportScene/Common.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 | #ifndef _COMMON_H
12 | #define _COMMON_H
13 |
14 | #include
15 |
16 | void InitializeSdkObjects(FbxManager*& pManager, FbxScene*& pScene);
17 | void DestroySdkObjects(FbxManager* pManager, bool pExitStatus);
18 | void CreateAndFillIOSettings(FbxManager* pManager);
19 |
20 | bool SaveScene(FbxManager* pManager, FbxDocument* pScene, const char* pFilename, int pFileFormat=-1, bool pEmbedMedia=false);
21 | bool LoadScene(FbxManager* pManager, FbxDocument* pScene, const char* pFilename);
22 |
23 | #endif // #ifndef _COMMON_H
24 |
25 |
26 |
--------------------------------------------------------------------------------
/ImportScene/AppDelegate.h:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import
21 |
22 | @interface AppDelegate : UIResponder
23 |
24 | @property (strong, nonatomic) UIWindow *window ;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/ImportScene/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "29x29",
21 | "scale" : "1x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "29x29",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "40x40",
31 | "scale" : "1x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "40x40",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "76x76",
41 | "scale" : "1x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "76x76",
46 | "scale" : "2x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/ImportScene/MetadataViewController.h:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #pragma once
21 |
22 | #import
23 | #import "NSFbxObject.h"
24 |
25 | @interface MetadataViewController : UIViewController
26 |
27 | @property (strong, nonatomic) NSFbxObject *_fbxObject ;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/ImportScene/SceneFilesController.h:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #pragma once
21 |
22 | #import
23 |
24 | @interface SceneFilesController : UITableViewController
25 |
26 | @property (strong, nonatomic) NSMutableArray *_fbx ;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ImportScene/main.m:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import
21 |
22 | #import "AppDelegate.h"
23 |
24 | int main (int argc, char *argv []) {
25 | @autoreleasepool {
26 | return (UIApplicationMain (argc, argv, nil, NSStringFromClass ([AppDelegate class]))) ;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ImportScene/GenericViewController.h:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import
21 | #import "NSFbxObject.h"
22 |
23 | @interface GenericViewController : UIViewController
24 |
25 | @property (strong, nonatomic) NSFbxObject *_fbxObject ;
26 | @property (nonatomic) NSInteger _what ;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ImportScene/ImportScene-Prefix.pch:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import
21 |
22 | #ifndef __IPHONE_5_0
23 | #warning "This project uses features only available in iOS SDK 5.0 and later."
24 | #endif
25 |
26 | #ifdef __OBJC__
27 | #import
28 | #import
29 | #endif
30 |
--------------------------------------------------------------------------------
/ImportScene/FileStructureController.h:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #pragma once
21 |
22 | #import
23 | #import "NSFbxObject.h"
24 |
25 | @interface FileStructureController : UITableViewController
26 |
27 | @property (strong, nonatomic) NSString *_filename ;
28 | @property (strong, nonatomic) NSMutableArray *_fbxStructure ;
29 | @property (strong, nonatomic) NSFbxObject *_fbxObject ;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Autodesk, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 | Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
24 | http://www.autodesk.com/joinadn
25 | July 2nd, 2014
26 |
--------------------------------------------------------------------------------
/ImportScene/DisplayCamera.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_CAMERA_H
13 | #define _DISPLAY_CAMERA_H
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayCamera(FbxNode* pNode);
18 | void DisplayCamera(FbxCamera* pCamera, char* pName, FbxNode* pTargetNode = NULL, FbxNode* pTargetUpNode = NULL);
19 | void DisplayDefaultAnimationValues(FbxCamera* pCamera);
20 | void DisplayRenderOptions(FbxCamera* pCamera);
21 | void DisplayCameraViewOptions(FbxCamera* pCamera);
22 | void DisplayBackgroundProperties(FbxCamera* pCamera);
23 | void DisplayApertureAndFilmControls(FbxCamera* pCamera);
24 | void DisplayViewingAreaControls(FbxCamera* pCamera);
25 | void DisplayCameraPositionAndOrientation(FbxCamera* pCamera, FbxNode* pTargetNode, FbxNode* pUpTargetNode);
26 |
27 | #endif // #ifndef _DISPLAY_CAMERA_H
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ImportScene/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
--------------------------------------------------------------------------------
/ImportScene/DisplayCommon.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _DISPLAY_COMMON_H
13 | #define _DISPLAY_COMMON_H
14 |
15 | #include
16 |
17 | void DisplayMetaDataConnections(FbxObject* pNode);
18 | void DisplayString(const char* pHeader, const char* pValue = "", const char* pSuffix = "");
19 | void DisplayBool(const char* pHeader, bool pValue, const char* pSuffix = "");
20 | void DisplayInt(const char* pHeader, int pValue, const char* pSuffix = "");
21 | void DisplayDouble(const char* pHeader, double pValue, const char* pSuffix = "");
22 | void Display2DVector(const char* pHeader, FbxVector2 pValue, const char* pSuffix = "");
23 | void Display3DVector(const char* pHeader, FbxVector4 pValue, const char* pSuffix = "");
24 | void DisplayColor(const char* pHeader, FbxColor pValue, const char* pSuffix = "");
25 | void Display4DVector(const char* pHeader, FbxVector4 pValue, const char* pSuffix = "");
26 |
27 |
28 | #endif // #ifndef _DISPLAY_COMMON_H
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ImportScene/NSFbxObject.h:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #pragma once
21 |
22 | #import
23 |
24 | #import "fbxsdk.h"
25 | #import "main.h"
26 | //#import "Common.h"
27 |
28 | #define PropToTextCtrl(ctrl,fst,st) \
29 | ctrl.text =[[NSString alloc] initWithFormat:fst, st.Buffer ()] ;
30 |
31 | @interface NSFbxObject : NSObject {
32 | @public
33 | FbxManager *_sdkManager ;
34 | FbxScene *_scene ;
35 | }
36 |
37 | - (id)init ;
38 | - (id)initWithFile:(NSString *)filename ;
39 | - (void)dealloc ;
40 |
41 | //- (void)Initialize ;
42 | //- (void)Terminate ;
43 |
44 | - (BOOL)LoadScene:(NSString *)filename ;
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/ImportScene/main.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #ifndef _MAIN_H
13 | #define _MAIN_H
14 |
15 | extern bool gVerbose ;
16 |
17 | int xx__main__xx (FbxString &lFilePath) ;
18 | void DisplayMetaData (FbxScene *pScene) ;
19 | void DisplayContent (FbxScene *pScene) ;
20 | void DisplayContent (FbxNode *pNode) ;
21 | void DisplayTarget (FbxNode *pNode) ;
22 | void DisplayTransformPropagation (FbxNode *pNode) ;
23 | void DisplayGeometricTransform (FbxNode *pNode) ;
24 |
25 | #include "DisplayCommon.h"
26 | #include "DisplayHierarchy.h"
27 | #include "DisplayAnimation.h"
28 | #include "DisplayMarker.h"
29 | #include "DisplaySkeleton.h"
30 | #include "DisplayMesh.h"
31 | #include "DisplayNurb.h"
32 | #include "DisplayPatch.h"
33 | #include "DisplayLodGroup.h"
34 | #include "DisplayCamera.h"
35 | #include "DisplayLight.h"
36 | #include "DisplayGlobalSettings.h"
37 | #include "DisplayPose.h"
38 | #include "DisplayPivotsAndLimits.h"
39 | #include "DisplayUserProperties.h"
40 | #include "DisplayGenericInfo.h"
41 |
42 | #endif // #ifndef _MAIN_H
43 |
44 |
--------------------------------------------------------------------------------
/ImportSceneTests/ImportSceneTests.m:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import
21 |
22 | @interface ImportSceneTests : XCTestCase
23 |
24 | @end
25 |
26 | @implementation ImportSceneTests
27 |
28 | - (void)setUp
29 | {
30 | [super setUp];
31 | // Put setup code here. This method is called before the invocation of each test method in the class.
32 | }
33 |
34 | - (void)tearDown
35 | {
36 | // Put teardown code here. This method is called after the invocation of each test method in the class.
37 | [super tearDown];
38 | }
39 |
40 | - (void)testExample
41 | {
42 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ImportScene/DisplaySkeleton.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplaySkeleton(FbxNode* pNode)
17 | {
18 | FbxSkeleton* lSkeleton = (FbxSkeleton*) pNode->GetNodeAttribute();
19 |
20 | DisplayString("Skeleton Name: ", (char *) pNode->GetName());
21 | DisplayMetaDataConnections(lSkeleton);
22 |
23 | const char* lSkeletonTypes[] = { "Root", "Limb", "Limb Node", "Effector" };
24 |
25 | DisplayString(" Type: ", lSkeletonTypes[lSkeleton->GetSkeletonType()]);
26 |
27 | if (lSkeleton->GetSkeletonType() == FbxSkeleton::eLimb)
28 | {
29 | DisplayDouble(" Limb Length: ", lSkeleton->LimbLength.Get());
30 | }
31 | else if (lSkeleton->GetSkeletonType() == FbxSkeleton::eLimbNode)
32 | {
33 | DisplayDouble(" Limb Node Size: ", lSkeleton->Size.Get());
34 | }
35 | else if (lSkeleton->GetSkeletonType() == FbxSkeleton::eRoot)
36 | {
37 | DisplayDouble(" Limb Root Size: ", lSkeleton->Size.Get());
38 | }
39 |
40 | DisplayColor(" Color: ", lSkeleton->GetLimbNodeColor());
41 | }
42 |
--------------------------------------------------------------------------------
/ImportScene/DisplayGlobalSettings.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 | #include "DisplayCamera.h"
16 |
17 | void DisplayGlobalLightSettings(FbxGlobalSettings* pGlobalSettings)
18 | {
19 | DisplayColor("Ambient Color: ", pGlobalSettings->GetAmbientColor());
20 | DisplayString("");
21 | }
22 |
23 |
24 | void DisplayGlobalCameraSettings(FbxGlobalSettings* pGlobalSettings)
25 | {
26 | DisplayString("Default Camera: ", pGlobalSettings->GetDefaultCamera());
27 | DisplayString("");
28 | }
29 |
30 |
31 | void DisplayGlobalTimeSettings(FbxGlobalSettings* pGlobalSettings)
32 | {
33 | char lTimeString[256];
34 |
35 | DisplayString("Time Mode : ", FbxGetTimeModeName(pGlobalSettings->GetTimeMode()));
36 |
37 | FbxTimeSpan lTs;
38 | FbxTime lStart, lEnd;
39 | pGlobalSettings->GetTimelineDefaultTimeSpan(lTs);
40 | lStart = lTs.GetStart();
41 | lEnd = lTs.GetStop();
42 | DisplayString("Timeline default timespan: ");
43 | DisplayString(" Start: ", lStart.GetTimeString(lTimeString, FbxUShort(256)));
44 | DisplayString(" Stop : ", lEnd.GetTimeString(lTimeString, FbxUShort(256)));
45 |
46 | DisplayString("");
47 | }
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ImportScene.xcodeproj/project.xcworkspace/xcshareddata/ImportScene.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | CD85BE89-DE61-44B4-9780-3876F4355B97
9 | IDESourceControlProjectName
10 | ImportScene
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 80E7F04C-35BD-4F19-8648-34095DB087F2
14 | https://github.com/cyrillef/FBX-iOS-ImportScene.git
15 |
16 | IDESourceControlProjectPath
17 | ImportScene.xcodeproj/project.xcworkspace
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 80E7F04C-35BD-4F19-8648-34095DB087F2
21 | ../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/cyrillef/FBX-iOS-ImportScene.git
25 | IDESourceControlProjectVersion
26 | 110
27 | IDESourceControlProjectWCCIdentifier
28 | 80E7F04C-35BD-4F19-8648-34095DB087F2
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 80E7F04C-35BD-4F19-8648-34095DB087F2
36 | IDESourceControlWCCName
37 | FBX-iOS-ImportScene
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ImportScene/ImportScene-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.autodesk.adn.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | Main_iPhone
29 | UIMainStoryboardFile~ipad
30 | Main_iPad
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ImportScene/NSFbxObject.mm:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import "NSFbxObject.h"
21 | #import "Common.h"
22 |
23 | @implementation NSFbxObject
24 |
25 | - (id)init {
26 | if ( (self =[super init]) ) {
27 | [self Initialize] ;
28 | }
29 | return (self) ;
30 | }
31 |
32 | - (id)initWithFile:(NSString *)filename {
33 | if ( (self =[super init]) ) {
34 | [self Initialize] ;
35 | [self LoadScene:filename] ;
36 | }
37 | return (self) ;
38 | }
39 |
40 | - (void)dealloc {
41 | [self Terminate] ;
42 | //[super dealloc] ;
43 | }
44 |
45 | - (void)Initialize {
46 | // Prepare the FBX SDK.
47 | InitializeSdkObjects (_sdkManager, _scene) ;
48 | }
49 |
50 | - (void)Terminate {
51 | bool bResult ;
52 | DestroySdkObjects (_sdkManager, bResult) ;
53 | }
54 |
55 | - (BOOL)LoadScene:(NSString *)filename {
56 | FbxString fbxSt ([filename cStringUsingEncoding:[NSString defaultCStringEncoding]]) ;
57 | bool bResult =LoadScene (_sdkManager, _scene, fbxSt.Buffer ()) ;
58 | return (bResult) ;
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/ImportScene/DisplayLight.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include "DisplayLight.h"
13 |
14 | void DisplayDefaultAnimationValues(FbxLight* pLight);
15 |
16 | void DisplayLight(FbxNode* pNode)
17 | {
18 | FbxLight* lLight = (FbxLight*) pNode->GetNodeAttribute();
19 |
20 | DisplayString("Light Name: ", (char *) pNode->GetName());
21 | DisplayMetaDataConnections(lLight);
22 |
23 | const char* lLightTypes[] = { "Point", "Directional", "Spot" };
24 |
25 | DisplayString(" Type: ", lLightTypes[lLight->LightType.Get()]);
26 | DisplayBool(" Cast Light: ", lLight->CastLight.Get());
27 |
28 | if (!(lLight->FileName.Get().IsEmpty()))
29 | {
30 | DisplayString(" Gobo");
31 |
32 | DisplayString(" File Name: \"", lLight->FileName.Get().Buffer(), "\"");
33 | DisplayBool(" Ground Projection: ", lLight->DrawGroundProjection.Get());
34 | DisplayBool(" Volumetric Projection: ", lLight->DrawVolumetricLight.Get());
35 | DisplayBool(" Front Volumetric Projection: ", lLight->DrawFrontFacingVolumetricLight.Get());
36 | }
37 |
38 | DisplayDefaultAnimationValues(lLight);
39 | }
40 |
41 |
42 | void DisplayDefaultAnimationValues(FbxLight* pLight)
43 | {
44 | DisplayString(" Default Animation Values");
45 |
46 | FbxDouble3 c = pLight->Color.Get();
47 | FbxColor lColor(c[0], c[1], c[2]);
48 | DisplayColor(" Default Color: ", lColor);
49 | DisplayDouble(" Default Intensity: ", pLight->Intensity.Get());
50 | DisplayDouble(" Default Outer Angle: ", pLight->OuterAngle.Get());
51 | DisplayDouble(" Default Fog: ", pLight->Fog.Get());
52 | }
53 |
54 |
55 |
--------------------------------------------------------------------------------
/ImportScene/DisplayLodGroup.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayLodGroup(FbxNode* pNode)
17 | {
18 | const char* lDisplayLevels[] = { "UseLOD", "Show", "Hide" };
19 |
20 | DisplayString("LodGroup Name: ", (char *) pNode->GetName());
21 |
22 | DisplayInt(" ", pNode->GetChildCount(), " Geometries");
23 | for (int i = 0; i < pNode->GetChildCount(); i++)
24 | {
25 | FbxNode* lChildNode = pNode->GetChild(i);
26 | DisplayString(" ", lChildNode->GetName());
27 | }
28 |
29 | FbxLODGroup *lLodGroupAttr = (FbxLODGroup*)pNode->GetNodeAttribute();
30 | DisplayBool(" MinMaxDistance Enabled: ", lLodGroupAttr->MinMaxDistance.Get());
31 | if (lLodGroupAttr->MinMaxDistance.Get())
32 | {
33 | DisplayDouble(" Min Distance: ", lLodGroupAttr->MinDistance.Get());
34 | DisplayDouble(" Max Distance: ", lLodGroupAttr->MaxDistance.Get());
35 | }
36 | DisplayBool(" Is World Space: ", lLodGroupAttr->WorldSpace.Get());
37 |
38 | DisplayString(" Thresholds ");
39 | for (int i = 0; i < lLodGroupAttr->GetNumThresholds(); i++)
40 | {
41 | FbxDistance lThreshVal;
42 | if (lLodGroupAttr->GetThreshold(i, lThreshVal))
43 | DisplayDouble(" ", lThreshVal.value());
44 | }
45 |
46 | DisplayString(" DisplayLevels");
47 | for (int i = 0; i < lLodGroupAttr->GetNumDisplayLevels(); i++)
48 | {
49 | FbxLODGroup::EDisplayLevel lLevel;
50 | if (lLodGroupAttr->GetDisplayLevel(i, lLevel))
51 | DisplayString(" ", lDisplayLevels[lLevel]);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/ImportScene/DisplayMarker.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayMarker(FbxNode* pNode)
17 | {
18 | FbxMarker* lMarker = (FbxMarker*)pNode->GetNodeAttribute();
19 | FbxString lString;
20 |
21 | DisplayString("Marker Name: ", (char *) pNode->GetName());
22 | DisplayMetaDataConnections(lMarker);
23 |
24 | // Type
25 | lString = " Marker Type: ";
26 | switch (lMarker->GetType())
27 | {
28 | case FbxMarker::eStandard: lString += "Standard"; break;
29 | case FbxMarker::eOptical: lString += "Optical"; break;
30 | case FbxMarker::eEffectorIK: lString += "IK Effector"; break;
31 | case FbxMarker::eEffectorFK: lString += "FK Effector"; break;
32 | }
33 | DisplayString(lString.Buffer());
34 |
35 | // Look
36 | lString = " Marker Look: ";
37 | switch (lMarker->Look.Get())
38 | {
39 | default:
40 | break;
41 | case FbxMarker::eCube: lString += "Cube"; break;
42 | case FbxMarker::eHardCross: lString += "Hard Cross"; break;
43 | case FbxMarker::eLightCross: lString += "Light Cross"; break;
44 | case FbxMarker::eSphere: lString += "Sphere"; break;
45 | }
46 | DisplayString(lString.Buffer());
47 |
48 | // Size
49 | lString = FbxString(" Size: ") + FbxString(lMarker->Size.Get());
50 | DisplayString(lString.Buffer());
51 |
52 | // Color
53 | FbxDouble3 c = lMarker->Color.Get();
54 | FbxColor color(c[0], c[1], c[2]);
55 | DisplayColor(" Color: ", color);
56 |
57 | // IKPivot
58 | Display3DVector(" IKPivot: ", lMarker->IKPivot.Get());
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/ImportScene/DisplayPatch.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include "DisplayPatch.h"
13 |
14 | #include "DisplayTexture.h"
15 | #include "DisplayMaterial.h"
16 | #include "DisplayLink.h"
17 | #include "DisplayShape.h"
18 |
19 | void DisplayPatch(FbxNode* pNode)
20 | {
21 | FbxPatch* lPatch = (FbxPatch*) pNode->GetNodeAttribute();
22 |
23 | DisplayString("Patch Name: ", (char *) pNode->GetName());
24 | DisplayMetaDataConnections(lPatch);
25 |
26 | const char* lSurfaceModes[] = { "Raw", "Low No Normals", "Low", "High No Normals", "High" };
27 |
28 | DisplayString(" Surface Mode: ", lSurfaceModes[lPatch->GetSurfaceMode()]);
29 |
30 | int i, lControlPointsCount = lPatch->GetControlPointsCount();
31 | FbxVector4* lControlPoints = lPatch->GetControlPoints();
32 |
33 | for (i = 0; i < lControlPointsCount; i++)
34 | {
35 | DisplayInt(" Control Point ", i);
36 | Display3DVector(" Coordinates: ", lControlPoints[i]);
37 | DisplayDouble(" Weight: ", lControlPoints[i][3]);
38 | }
39 |
40 | const char* lPatchTypes[] = { "Bezier", "Bezier Quadric", "Cardinal", "B-Spline", "Linear" };
41 |
42 | DisplayString(" Patch U Type: ", lPatchTypes[lPatch->GetPatchUType()]);
43 | DisplayInt(" U Count: ", lPatch->GetUCount());
44 | DisplayString(" Patch V Type: ", lPatchTypes[lPatch->GetPatchVType()]);
45 | DisplayInt(" V Count: ", lPatch->GetVCount());
46 | DisplayInt(" U Step: ", lPatch->GetUStep());
47 | DisplayInt(" V Step: ", lPatch->GetVStep());
48 | DisplayBool(" U Closed: ", lPatch->GetUClosed());
49 | DisplayBool(" V Closed: ", lPatch->GetVClosed());
50 | DisplayBool(" U Capped Top: ", lPatch->GetUCappedTop());
51 | DisplayBool(" U Capped Bottom: ", lPatch->GetUCappedBottom());
52 | DisplayBool(" V Capped Top: ", lPatch->GetVCappedTop());
53 | DisplayBool(" V Capped Bottom: ", lPatch->GetVCappedBottom());
54 |
55 | DisplayString("");
56 |
57 | DisplayTexture(lPatch);
58 | DisplayMaterial(lPatch);
59 | DisplayLink(lPatch);
60 | DisplayShape(lPatch);
61 | }
62 |
63 |
64 |
--------------------------------------------------------------------------------
/ImportScene/DisplayShape.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayShape(FbxGeometry* pGeometry)
17 | {
18 | int lBlendShapeCount, lBlendShapeChannelCount, lTargetShapeCount;
19 | FbxBlendShape* lBlendShape;
20 | FbxBlendShapeChannel* lBlendShapeChannel;
21 | FbxShape* lShape;
22 |
23 | lBlendShapeCount = pGeometry->GetDeformerCount(FbxDeformer::eBlendShape);
24 |
25 | for (int lBlendShapeIndex = 0; lBlendShapeIndex < lBlendShapeCount; ++lBlendShapeIndex)
26 | {
27 | lBlendShape = (FbxBlendShape*) pGeometry->GetDeformer(lBlendShapeIndex, FbxDeformer::eBlendShape);
28 | DisplayString(" BlendShape ", (char *) lBlendShape->GetName());
29 |
30 | lBlendShapeChannelCount = lBlendShape->GetBlendShapeChannelCount();
31 | for(int lBlendShapeChannelIndex = 0; lBlendShapeChannelIndex < lBlendShapeChannelCount; ++lBlendShapeChannelIndex)
32 | {
33 | lBlendShapeChannel = lBlendShape->GetBlendShapeChannel(lBlendShapeChannelIndex);
34 | DisplayString(" BlendShapeChannel ", (char *) lBlendShapeChannel->GetName());
35 | DisplayDouble(" Default Deform Value: ", lBlendShapeChannel->DeformPercent.Get());
36 |
37 | lTargetShapeCount = lBlendShapeChannel->GetTargetShapeCount();
38 | for (int lTargetShapeIndex = 0; lTargetShapeIndex < lTargetShapeCount; ++lTargetShapeIndex)
39 | {
40 | lShape = lBlendShapeChannel->GetTargetShape(lTargetShapeIndex);
41 | DisplayString(" TargetShape ", (char *) lShape->GetName());
42 |
43 | int j, lControlPointsCount = lShape->GetControlPointsCount();
44 | FbxVector4* lControlPoints = lShape->GetControlPoints();
45 | FbxLayerElementArrayTemplate* lNormals = NULL;
46 | bool lStatus = lShape->GetNormals(&lNormals);
47 |
48 | for(j = 0; j < lControlPointsCount; j++)
49 | {
50 | DisplayInt(" Control Point ", j);
51 | Display3DVector(" Coordinates: ", lControlPoints[j]);
52 |
53 | if (lStatus && lNormals && lNormals->GetCount() == lControlPointsCount)
54 | {
55 | Display3DVector(" Normal Vector: ", lNormals->GetAt(j));
56 | }
57 | }
58 |
59 | DisplayString("");
60 | }
61 | }
62 | }
63 | }
64 |
65 |
66 |
--------------------------------------------------------------------------------
/ImportScene/AppDelegate.m:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import "AppDelegate.h"
21 |
22 | @implementation AppDelegate
23 |
24 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
25 | // Override point for customization after application launch.
26 | return (YES) ;
27 | }
28 |
29 | - (void)applicationWillResignActive:(UIApplication *)application {
30 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
31 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
32 | }
33 |
34 | - (void)applicationDidEnterBackground:(UIApplication *)application {
35 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
37 | }
38 |
39 | - (void)applicationWillEnterForeground:(UIApplication *)application {
40 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
41 | }
42 |
43 | - (void)applicationDidBecomeActive:(UIApplication *)application {
44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
45 | }
46 |
47 | - (void)applicationWillTerminate:(UIApplication *)application {
48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/ImportScene/SceneFilesController.mm:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import "SceneFilesController.h"
21 | #import "FileStructureController.h"
22 |
23 | @interface SceneFilesController ()
24 |
25 | @end
26 |
27 | @implementation SceneFilesController
28 |
29 | @synthesize _fbx =__fbx ;
30 |
31 | - (void)viewDidLoad {
32 | [super viewDidLoad] ;
33 | // Add Bundle default file
34 | self._fbx =[[NSMutableArray alloc] init] ;
35 | [self._fbx addObject:@"humanoid.fbx"] ;
36 | // Add any other we installed on the device
37 |
38 | NSFileManager *fileManager =[[NSFileManager alloc] init] ;
39 | NSArray *paths =NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) ;
40 | NSString *documentsPath =[paths objectAtIndex:0] ;
41 | NSDirectoryEnumerator *fileEnumerator =[fileManager enumeratorAtPath:documentsPath] ;
42 | for ( NSString *filename in fileEnumerator ) {
43 | if ( [[filename pathExtension] isEqualToString:@"fbx"] == YES
44 | || [[filename pathExtension] isEqualToString:@"obj"] == YES
45 | ) {
46 | [self._fbx addObject:filename] ;
47 | }
48 | }
49 | }
50 |
51 | - (void)viewDidAppear:(BOOL)animated {
52 | [super viewDidAppear:animated] ;
53 | }
54 |
55 | - (void)didReceiveMemoryWarning {
56 | [super didReceiveMemoryWarning] ;
57 | // Dispose of any resources that can be recreated.
58 | }
59 |
60 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
61 | if ( [[segue identifier] isEqualToString:@"FileStructureSegues"] ) {
62 | FileStructureController *vc =[segue destinationViewController] ;
63 | NSIndexPath *ip =[self.tableView indexPathForSelectedRow] ;
64 | vc._filename =[self._fbx objectAtIndex:ip.row] ;
65 | }
66 | }
67 |
68 | #pragma mark - Table View
69 |
70 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
71 | return (1) ;
72 | }
73 |
74 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
75 | return (self._fbx.count) ;
76 | }
77 |
78 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
79 | static NSString *cellIdentifier = @"SectionCell" ;
80 | UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:cellIdentifier] ;
81 | NSString *sceneName =[self._fbx objectAtIndex:indexPath.row] ;
82 | [cell.textLabel setText:sceneName] ;
83 | //[cell.detailTextLabel setText:@"???"] ;
84 | return (cell) ;
85 | }
86 |
87 | @end
88 |
--------------------------------------------------------------------------------
/ImportScene/DisplayPose.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include "DisplayPose.h"
13 |
14 | void DisplayPose(FbxScene* pScene)
15 | {
16 | int i,j,k,lPoseCount;
17 | FbxString lName;
18 |
19 | lPoseCount = pScene->GetPoseCount();
20 |
21 | for (i = 0; i < lPoseCount; i++)
22 | {
23 | FbxPose* lPose = pScene->GetPose(i);
24 |
25 | lName = lPose->GetName();
26 | DisplayString("Pose Name: ", lName.Buffer());
27 |
28 | DisplayBool(" Is a bind pose: ", lPose->IsBindPose());
29 |
30 | DisplayInt(" Number of items in the pose: ", lPose->GetCount());
31 |
32 | DisplayString("","");
33 |
34 | for (j=0; jGetCount(); j++)
35 | {
36 | lName = lPose->GetNodeName(j).GetCurrentName();
37 | DisplayString(" Item name: ", lName.Buffer());
38 |
39 | if (!lPose->IsBindPose())
40 | {
41 | // Rest pose can have local matrix
42 | DisplayBool(" Is local space matrix: ", lPose->IsLocalMatrix(j));
43 | }
44 |
45 | DisplayString(" Matrix value: ","");
46 |
47 | FbxString lMatrixValue;
48 |
49 | for (k=0; k<4; k++)
50 | {
51 | FbxMatrix lMatrix = lPose->GetMatrix(j);
52 | FbxVector4 lRow = lMatrix.GetRow(k);
53 | char lRowValue[1024];
54 |
55 | FBXSDK_sprintf(lRowValue, 1024, "%9.4f %9.4f %9.4f %9.4f\n", lRow[0], lRow[1], lRow[2], lRow[3]);
56 | lMatrixValue += FbxString(" ") + FbxString(lRowValue);
57 | }
58 |
59 | DisplayString("", lMatrixValue.Buffer());
60 | }
61 | }
62 |
63 | lPoseCount = pScene->GetCharacterPoseCount();
64 |
65 | for (i = 0; i < lPoseCount; i++)
66 | {
67 | FbxCharacterPose* lPose = pScene->GetCharacterPose(i);
68 | FbxCharacter* lCharacter = lPose->GetCharacter();
69 |
70 | if (!lCharacter) break;
71 |
72 | DisplayString("Character Pose Name: ", lCharacter->GetName());
73 |
74 | FbxCharacterLink lCharacterLink;
75 | FbxCharacter::ENodeId lNodeId = FbxCharacter::eHips;
76 |
77 | while (lCharacter->GetCharacterLink(lNodeId, &lCharacterLink))
78 | {
79 | FbxAMatrix& lGlobalPosition = lCharacterLink.mNode->EvaluateGlobalTransform(FBXSDK_TIME_ZERO);
80 |
81 | DisplayString(" Matrix value: ","");
82 |
83 | FbxString lMatrixValue;
84 |
85 | for (k=0; k<4; k++)
86 | {
87 | FbxVector4 lRow = lGlobalPosition.GetRow(k);
88 | char lRowValue[1024];
89 |
90 | FBXSDK_sprintf(lRowValue, 1024, "%9.4f %9.4f %9.4f %9.4f\n", lRow[0], lRow[1], lRow[2], lRow[3]);
91 | lMatrixValue += FbxString(" ") + FbxString(lRowValue);
92 | }
93 |
94 | DisplayString("", lMatrixValue.Buffer());
95 |
96 | lNodeId = FbxCharacter::ENodeId(int(lNodeId) + 1);
97 | }
98 | }
99 | }
100 |
101 |
102 |
--------------------------------------------------------------------------------
/ImportScene/MetadataViewController.mm:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import "MetadataViewController.h"
21 |
22 | @interface MetadataViewController () {
23 | IBOutlet UILabel *_title ;
24 | IBOutlet UILabel *_subject ;
25 | IBOutlet UILabel *_author ;
26 | IBOutlet UILabel *_keywords ;
27 | IBOutlet UILabel *_revision ;
28 | IBOutlet UILabel *_comment ;
29 | IBOutlet UISwitch *_thumbnail ;
30 | IBOutlet UILabel *_rgbMode ;
31 | IBOutlet UILabel *_size ;
32 | }
33 |
34 | @end
35 |
36 | @implementation MetadataViewController
37 |
38 | @synthesize _fbxObject =__fbxObject ;
39 |
40 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
41 | if ( (self =[super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) {
42 | // Custom initialization
43 | }
44 | return (self) ;
45 | }
46 |
47 | - (void)viewDidLoad {
48 | [super viewDidLoad] ;
49 |
50 | FbxScene *pScene =self._fbxObject->_scene ;
51 | DisplayMetaData (pScene) ;
52 |
53 | FbxDocumentInfo *sceneInfo =pScene->GetSceneInfo () ;
54 | if ( sceneInfo ) {
55 | _title.text =[[NSString alloc] initWithFormat:@"Title: %s", sceneInfo->mTitle.Buffer ()] ;
56 | //PropToTextCtrl (_title, @"Title: %s", sceneInfo->mTitle) ;
57 | PropToTextCtrl (_subject, @"Subject: %s", sceneInfo->mSubject) ;
58 | PropToTextCtrl (_author, @"Author: %s", sceneInfo->mAuthor) ;
59 | PropToTextCtrl (_keywords, @"Keywords: %s", sceneInfo->mKeywords) ;
60 | PropToTextCtrl (_revision, @"Revision: %s", sceneInfo->mRevision) ;
61 | PropToTextCtrl (_comment, @"Comment: %s", sceneInfo->mComment) ;
62 |
63 | FbxThumbnail *thumbnail =sceneInfo->GetSceneThumbnail () ;
64 | [_thumbnail setOn:NO] ;
65 | if ( thumbnail ) {
66 | [_thumbnail setOn:YES] ;
67 | switch ( thumbnail->GetDataFormat () ) {
68 | case FbxThumbnail::eRGB_24:
69 | _rgbMode.text =@"RGB" ;
70 | break ;
71 | case FbxThumbnail::eRGBA_32:
72 | _rgbMode.text =@"RGBA" ;
73 | break ;
74 | }
75 | switch ( thumbnail->GetSize () ) {
76 | default:
77 | _size.text =@"" ;
78 | break ;
79 | case FbxThumbnail::eNotSet:
80 | _size.text =[[NSString alloc] initWithFormat:@"no dimensions specified (%ld bytes)", thumbnail->GetSizeInBytes ()] ;
81 | break ;
82 | case FbxThumbnail::e64x64:
83 | _size.text =[[NSString alloc] initWithFormat:@"64 x 64 pixels (%ld bytes)", thumbnail->GetSizeInBytes ()] ;
84 | break ;
85 | case FbxThumbnail::e128x128:
86 | _size.text =[[NSString alloc] initWithFormat:@"128 x 128 pixels (%ld bytes)", thumbnail->GetSizeInBytes ()] ;
87 | break ;
88 | }
89 | }
90 | }
91 | }
92 |
93 | - (void)didReceiveMemoryWarning {
94 | [super didReceiveMemoryWarning] ;
95 | // Dispose of any resources that can be recreated.
96 | }
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/ImportScene/GenericViewController.mm:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import "GenericViewController.h"
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | @interface GenericViewController () {
27 | IBOutlet UITextView *_text ;
28 | }
29 |
30 | @end
31 |
32 | @implementation GenericViewController
33 |
34 | @synthesize _fbxObject =__fbxObject ;
35 | @synthesize _what =__what ;
36 |
37 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
38 | if ( (self =[super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) {
39 | // Custom initialization
40 | }
41 | return (self) ;
42 | }
43 |
44 | - (void)viewDidLoad {
45 | [super viewDidLoad] ;
46 |
47 | NSArray *paths =NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) ;
48 | NSString *documentsPath =[paths objectAtIndex:0] ;
49 | NSString *filename =[NSString stringWithFormat:@"%@/output.txt", documentsPath] ;
50 | FILE *fp =freopen ([filename cStringUsingEncoding:[NSString defaultCStringEncoding]], "w", stdout) ;
51 |
52 | switch ( __what ) {
53 | case 1: // Global Light Settings
54 | DisplayGlobalLightSettings (&(self._fbxObject->_scene)->GetGlobalSettings ());
55 | break ;
56 | case 2: // Global Camera Settings
57 | DisplayGlobalCameraSettings (&(self._fbxObject->_scene)->GetGlobalSettings ()) ;
58 | break ;
59 | case 3: // Global Time Settings
60 | DisplayGlobalTimeSettings (&(self._fbxObject->_scene)->GetGlobalSettings ()) ;
61 | break ;
62 | case 4: // Hierarchy
63 | DisplayHierarchy (self._fbxObject->_scene) ;
64 | break ;
65 | case 5: // Node Content
66 | DisplayContent (self._fbxObject->_scene) ;
67 | break ;
68 | case 6: // Pose
69 | DisplayPose (self._fbxObject->_scene) ;
70 | break ;
71 | case 7: // Animation
72 | DisplayAnimation (self._fbxObject->_scene) ;
73 | break ;
74 | case 8: // Generic Information
75 | DisplayGenericInfo (self._fbxObject->_scene) ;
76 | break ;
77 | }
78 | fclose (fp) ;
79 |
80 | std::ifstream txtFile ([filename cStringUsingEncoding:[NSString defaultCStringEncoding]]) ;
81 | std::string contents ((std::istreambuf_iterator(txtFile)), std::istreambuf_iterator()) ;
82 | _text.text =[NSString stringWithCString:contents.data () encoding:NSUTF8StringEncoding] ;
83 | }
84 |
85 | - (void)didReceiveMemoryWarning {
86 | [super didReceiveMemoryWarning] ;
87 | // Dispose of any resources that can be recreated.
88 | }
89 |
90 | /*
91 | #pragma mark - Navigation
92 |
93 | // In a storyboard-based application, you will often want to do a little preparation before navigation
94 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
95 | {
96 | // Get the new view controller using [segue destinationViewController].
97 | // Pass the selected object to the new view controller.
98 | }
99 | */
100 |
101 | @end
102 |
--------------------------------------------------------------------------------
/ImportScene.xcodeproj/xcuserdata/cyrille.xcuserdatad/xcschemes/ImportScene.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/ImportScene/FileStructureController.mm:
--------------------------------------------------------------------------------
1 | // (C) Copyright 2014 by Autodesk, Inc.
2 | //
3 | // Permission to use, copy, modify, and distribute this software in
4 | // object code form for any purpose and without fee is hereby granted,
5 | // provided that the above copyright notice appears in all copies and
6 | // that both that copyright notice and the limited warranty and
7 | // restricted rights notice below appear in all supporting
8 | // documentation.
9 | //
10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
14 | // UNINTERRUPTED OR ERROR FREE.
15 |
16 | //- Written by Cyrille Fauvel, Autodesk Developer Network (ADN)
17 | //- http://www.autodesk.com/joinadn
18 | //- July 2nd, 2014
19 | //
20 | #import "FileStructureController.h"
21 | #import "MetadataViewController.h"
22 | #import "GenericViewController.h"
23 |
24 | @interface FileStructureController () {
25 | NSIndexPath *_selectedRowIndex ;
26 | }
27 |
28 | @end
29 |
30 | @implementation FileStructureController
31 |
32 | @synthesize _filename =__filename ;
33 | @synthesize _fbxStructure =__fbxStructure ;
34 | @synthesize _fbxObject =__fbxObject ;
35 |
36 | - (void)viewDidLoad {
37 | [super viewDidLoad] ;
38 | self._fbxStructure =[[NSMutableArray alloc] initWithObjects:
39 | @"Meta Data",
40 | @"Global Light Settings",
41 | @"Global Camera Settings",
42 | @"Global Time Settings",
43 | @"Hierarchy",
44 | @"Node Content",
45 | @"Pose",
46 | @"Animation",
47 | @"Generic Information",
48 | nil] ;
49 | }
50 |
51 | - (void)viewDidAppear:(BOOL)animated {
52 | [super viewDidAppear:animated] ;
53 |
54 | NSString *st =self._filename ;
55 | if ( ![[NSFileManager defaultManager] fileExistsAtPath:st] )
56 | st =[[NSBundle mainBundle] pathForResource:[[self._filename lastPathComponent] stringByDeletingPathExtension] ofType:[self._filename pathExtension]] ;
57 | self._fbxObject =[[NSFbxObject alloc] initWithFile:st] ;
58 |
59 | //FbxString fbxSt ([st cStringUsingEncoding:[NSString defaultCStringEncoding]]) ;
60 | //xx__main__xx (fbxSt) ;
61 | }
62 |
63 | - (void)didReceiveMemoryWarning {
64 | [super didReceiveMemoryWarning] ;
65 | // Dispose of any resources that can be recreated.
66 | }
67 |
68 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
69 | //NSIndexPath *ip =[self.tableView indexPathForCell:sender] ;
70 | if ( [[segue identifier] isEqualToString:@"MetadataSegues"] ) {
71 | MetadataViewController *vc =[segue destinationViewController] ;
72 | vc._fbxObject =self._fbxObject ;
73 | }
74 | if ( [[segue identifier] isEqualToString:@"GenericSegues"] ) {
75 | GenericViewController *vc =[segue destinationViewController] ;
76 | vc._fbxObject =self._fbxObject ;
77 | vc._what =_selectedRowIndex.row ;
78 | }
79 | }
80 |
81 | #pragma mark - Table View
82 |
83 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
84 | return (1) ;
85 | }
86 |
87 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
88 | return (self._fbxStructure.count) ;
89 | }
90 |
91 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
92 | static NSString *cellIdentifier = @"StructureCell" ;
93 | UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:cellIdentifier] ;
94 | NSString *sectionName =[self._fbxStructure objectAtIndex:indexPath.row] ;
95 | [cell.textLabel setText:sectionName] ;
96 | //[cell.detailTextLabel setText:@"???"] ;
97 | return (cell) ;
98 | }
99 |
100 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
101 | _selectedRowIndex =indexPath ;
102 | if ( indexPath.row == 0 )
103 | [self performSegueWithIdentifier:@"MetadataSegues" sender:self._fbxObject] ;
104 | else
105 | [self performSegueWithIdentifier:@"GenericSegues" sender:self._fbxObject] ;
106 | }
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/ImportScene/DisplayUserProperties.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include "DisplayUserProperties.h"
13 |
14 | void DisplayUserProperties(FbxObject* pObject)
15 | {
16 | int lCount = 0;
17 | FbxString lTitleStr = " Property Count: ";
18 |
19 | FbxProperty lProperty = pObject->GetFirstProperty();
20 | while (lProperty.IsValid())
21 | {
22 | if (lProperty.GetFlag(FbxPropertyFlags::eUserDefined))
23 | lCount++;
24 |
25 | lProperty = pObject->GetNextProperty(lProperty);
26 | }
27 |
28 | if (lCount == 0)
29 | return; // there are no user properties to display
30 |
31 | DisplayInt(lTitleStr.Buffer(), lCount);
32 |
33 | lProperty = pObject->GetFirstProperty();
34 | int i = 0;
35 | while (lProperty.IsValid())
36 | {
37 | if (lProperty.GetFlag(FbxPropertyFlags::eUserDefined))
38 | {
39 | DisplayInt(" Property ", i);
40 | FbxString lString = lProperty.GetLabel();
41 | DisplayString(" Display Name: ", lString.Buffer());
42 | lString = lProperty.GetName();
43 | DisplayString(" Internal Name: ", lString.Buffer());
44 | DisplayString(" Type: ", lProperty.GetPropertyDataType().GetName());
45 | if (lProperty.HasMinLimit()) DisplayDouble(" Min Limit: ", lProperty.GetMinLimit());
46 | if (lProperty.HasMaxLimit()) DisplayDouble(" Max Limit: ", lProperty.GetMaxLimit());
47 | DisplayBool (" Is Animatable: ", lProperty.GetFlag(FbxPropertyFlags::eAnimatable));
48 |
49 | FbxDataType lPropertyDataType=lProperty.GetPropertyDataType();
50 |
51 | // BOOL
52 | if (lPropertyDataType.GetType() == eFbxBool)
53 | {
54 | DisplayBool(" Default Value: ", lProperty.Get());
55 | }
56 | // REAL
57 | else if (lPropertyDataType.GetType() == eFbxDouble || lPropertyDataType.GetType() == eFbxFloat)
58 | {
59 | DisplayDouble(" Default Value: ", lProperty.Get());
60 | }
61 | // COLOR
62 | else if (lPropertyDataType.Is(FbxColor3DT) || lPropertyDataType.Is(FbxColor4DT))
63 | {
64 | FbxColor lDefault;
65 | char lBuf[64];
66 |
67 | lDefault = lProperty.Get();
68 | FBXSDK_sprintf(lBuf, 64, "R=%f, G=%f, B=%f, A=%f", lDefault.mRed, lDefault.mGreen, lDefault.mBlue, lDefault.mAlpha);
69 | DisplayString(" Default Value: ", lBuf);
70 | }
71 | // INTEGER
72 | else if (lPropertyDataType.GetType() == eFbxInt)
73 | {
74 | DisplayInt(" Default Value: ", lProperty.Get());
75 | }
76 | // VECTOR
77 | else if(lPropertyDataType.GetType() == eFbxDouble3 || lPropertyDataType.GetType() == eFbxDouble4)
78 | {
79 | FbxDouble3 lDefault;
80 | char lBuf[64];
81 |
82 | lDefault = lProperty.Get();
83 | FBXSDK_sprintf(lBuf, 64, "X=%f, Y=%f, Z=%f", lDefault[0], lDefault[1], lDefault[2]);
84 | DisplayString(" Default Value: ", lBuf);
85 | }
86 | // LIST
87 | else if (lPropertyDataType.GetType() == eFbxEnum)
88 | {
89 | DisplayInt(" Default Value: ", lProperty.Get());
90 | }
91 | // UNIDENTIFIED
92 | else
93 | {
94 | DisplayString(" Default Value: UNIDENTIFIED");
95 | }
96 | i++;
97 | }
98 |
99 | lProperty = pObject->GetNextProperty(lProperty);
100 | }
101 | }
102 |
103 |
--------------------------------------------------------------------------------
/ImportScene/DisplayGenericInfo.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayProperties(FbxObject* pObject);
17 | void DisplayGenericInfo(FbxNode* pNode, int pDepth);
18 | void DisplayGenericInfo(FbxScene* pScene)
19 | {
20 | int i;
21 | FbxNode* lRootNode = pScene->GetRootNode();
22 |
23 | for( i = 0; i < lRootNode->GetChildCount(); i++)
24 | {
25 | DisplayGenericInfo(lRootNode->GetChild(i), 0);
26 | }
27 |
28 | //Other objects directly connected onto the scene
29 | for( i = 0; i < pScene->GetSrcObjectCount(); ++i )
30 | {
31 | DisplayProperties(pScene->GetSrcObject(i));
32 | }
33 | }
34 |
35 |
36 | void DisplayGenericInfo(FbxNode* pNode, int pDepth)
37 | {
38 | FbxString lString;
39 | int i;
40 |
41 | for(i = 0; i < pDepth; i++)
42 | {
43 | lString += " ";
44 | }
45 |
46 | lString += pNode->GetName();
47 | lString += "\n";
48 |
49 | DisplayString(lString.Buffer());
50 |
51 | //Display generic info about that Node
52 | DisplayProperties(pNode);
53 | DisplayString("");
54 | for(i = 0; i < pNode->GetChildCount(); i++)
55 | {
56 | DisplayGenericInfo(pNode->GetChild(i), pDepth + 1);
57 | }
58 | }
59 |
60 | void DisplayProperties(FbxObject* pObject)
61 | {
62 |
63 | DisplayString("Name: ", (char *)pObject->GetName());
64 |
65 | // Display all the properties
66 | int i, lCount = 0;
67 | FbxProperty lProperty = pObject->GetFirstProperty();
68 | while (lProperty.IsValid())
69 | {
70 | lCount++;
71 | lProperty = pObject->GetNextProperty(lProperty);
72 | }
73 |
74 | FbxString lTitleStr = " Property Count: ";
75 |
76 | if (lCount == 0)
77 | return; // there are no properties to display
78 |
79 | DisplayInt(lTitleStr.Buffer(), lCount);
80 |
81 | i=0;
82 | lProperty = pObject->GetFirstProperty();
83 | while (lProperty.IsValid())
84 | {
85 | // exclude user properties
86 |
87 | FbxString lString;
88 | DisplayInt(" Property ", i);
89 | lString = lProperty.GetLabel();
90 | DisplayString(" Display Name: ", lString.Buffer());
91 | lString = lProperty.GetName();
92 | DisplayString(" Internal Name: ", lString.Buffer());
93 | lString = lProperty.GetPropertyDataType().GetName();
94 | DisplayString(" Type: ",lString.Buffer());
95 | if (lProperty.HasMinLimit()) DisplayDouble(" Min Limit: ", lProperty.GetMinLimit());
96 | if (lProperty.HasMaxLimit()) DisplayDouble(" Max Limit: ", lProperty.GetMaxLimit());
97 | DisplayBool (" Is Animatable: ", lProperty.GetFlag(FbxPropertyFlags::eAnimatable));
98 |
99 |
100 | switch (lProperty.GetPropertyDataType().GetType())
101 | {
102 | case eFbxBool:
103 | DisplayBool(" Default Value: ", lProperty.Get());
104 | break;
105 |
106 | case eFbxDouble:
107 | DisplayDouble(" Default Value: ", lProperty.Get());
108 | break;
109 |
110 | case eFbxDouble4:
111 | {
112 | FbxColor lDefault;
113 | char lBuf[64];
114 |
115 | lDefault = lProperty.Get();
116 | FBXSDK_sprintf(lBuf, 64, "R=%f, G=%f, B=%f, A=%f", lDefault.mRed, lDefault.mGreen, lDefault.mBlue, lDefault.mAlpha);
117 | DisplayString(" Default Value: ", lBuf);
118 | }
119 | break;
120 |
121 | case eFbxInt:
122 | DisplayInt(" Default Value: ", lProperty.Get());
123 | break;
124 |
125 | case eFbxDouble3:
126 | {
127 | FbxDouble3 lDefault;
128 | char lBuf[64];
129 |
130 | lDefault = lProperty.Get();
131 | FBXSDK_sprintf(lBuf, 64, "X=%f, Y=%f, Z=%f", lDefault[0], lDefault[1], lDefault[2]);
132 | DisplayString(" Default Value: ", lBuf);
133 | }
134 | break;
135 |
136 | //case FbxEnumDT:
137 | // DisplayInt(" Default Value: ", lProperty.Get());
138 | // break;
139 |
140 | case eFbxFloat:
141 | DisplayDouble(" Default Value: ", lProperty.Get());
142 | break;
143 | case eFbxString:
144 | lString = lProperty.Get();
145 | DisplayString(" Default Value: ", lString.Buffer());
146 | break;
147 |
148 | default:
149 | DisplayString(" Default Value: UNIDENTIFIED");
150 | break;
151 | }
152 | i++;
153 | lProperty = pObject->GetNextProperty(lProperty);
154 | }
155 | }
156 |
157 |
--------------------------------------------------------------------------------
/ImportScene/DisplayCache.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 |
13 | #include
14 |
15 | #include "DisplayCommon.h"
16 |
17 | void DisplayCache(FbxGeometry* pGeometry)
18 | {
19 | int lVertexCacheDeformerCount = pGeometry->GetDeformerCount( FbxDeformer::eVertexCache );
20 |
21 | for( int i = 0; i < lVertexCacheDeformerCount; ++i )
22 | {
23 | FbxVertexCacheDeformer* lDeformer = static_cast(pGeometry->GetDeformer(i, FbxDeformer::eVertexCache));
24 | if( !lDeformer ) continue;
25 |
26 | FbxCache* lCache = lDeformer->GetCache();
27 | if( !lCache ) continue;
28 |
29 | if (lCache->OpenFileForRead())
30 | {
31 | DisplayString(" Vertex Cache");
32 | int lChannelIndex = lCache->GetChannelIndex(lDeformer->Channel.Get());
33 | // skip normal channel
34 | if (lChannelIndex < 0)
35 | continue;
36 |
37 | FbxString lChnlName, lChnlInterp;
38 |
39 | FbxCache::EMCDataType lChnlType;
40 | FbxTime start, stop, rate;
41 | FbxCache::EMCSamplingType lChnlSampling;
42 | unsigned int lChnlSampleCount, lDataCount;
43 |
44 | lCache->GetChannelName(lChannelIndex, lChnlName);
45 | DisplayString(" Channel Name: ", lChnlName.Buffer());
46 | lCache->GetChannelDataType(lChannelIndex, lChnlType);
47 | switch (lChnlType)
48 | {
49 | case FbxCache::eUnknownData:
50 | DisplayString(" Channel Type: Unknown Data"); break;
51 | case FbxCache::eDouble:
52 | DisplayString(" Channel Type: Double"); break;
53 | case FbxCache::eDoubleArray:
54 | DisplayString(" Channel Type: Double Array"); break;
55 | case FbxCache::eDoubleVectorArray:
56 | DisplayString(" Channel Type: Double Vector Array"); break;
57 | case FbxCache::eInt32Array:
58 | DisplayString(" Channel Type: Int32 Array"); break;
59 | case FbxCache::eFloatArray:
60 | DisplayString(" Channel Type: Float Array"); break;
61 | case FbxCache::eFloatVectorArray:
62 | DisplayString(" Channel Type: Float Vector Array"); break;
63 | }
64 | lCache->GetChannelInterpretation(lChannelIndex, lChnlInterp);
65 | DisplayString(" Channel Interpretation: ", lChnlInterp.Buffer());
66 | lCache->GetChannelSamplingType(lChannelIndex, lChnlSampling);
67 | DisplayInt(" Channel Sampling Type: ", lChnlSampling);
68 | lCache->GetAnimationRange(lChannelIndex, start, stop);
69 | lCache->GetChannelSamplingRate(lChannelIndex, rate);
70 | lCache->GetChannelSampleCount(lChannelIndex, lChnlSampleCount);
71 | DisplayInt(" Channel Sample Count: ", lChnlSampleCount);
72 |
73 | // Only display cache data if the data type is float vector array
74 | if (lChnlType != FbxCache::eFloatVectorArray)
75 | continue;
76 |
77 | if (lChnlInterp == "normals")
78 | DisplayString(" Normal Cache Data");
79 | else
80 | DisplayString(" Points Cache Data");
81 | float* lBuffer = NULL;
82 | unsigned int lBufferSize = 0;
83 | int lFrame = 0;
84 | for (FbxTime t = start; t <= stop; t+=rate)
85 | {
86 | DisplayInt(" Frame ", lFrame);
87 | lCache->GetChannelPointCount(lChannelIndex, t, lDataCount);
88 | if (lBuffer == NULL)
89 | {
90 | lBuffer = new float[lDataCount*3];
91 | lBufferSize = lDataCount*3;
92 | }
93 | else if (lBufferSize < lDataCount*3)
94 | {
95 | delete [] lBuffer;
96 | lBuffer = new float[lDataCount*3];
97 | lBufferSize = lDataCount*3;
98 | }
99 | else
100 | memset(lBuffer, 0, lBufferSize*sizeof(float));
101 |
102 | lCache->Read(lChannelIndex, t, lBuffer, lDataCount);
103 | if (lChnlInterp == "normals")
104 | {
105 | // display normals cache data
106 | // the normal data is per-polygon per-vertex. we can get the polygon vertex index
107 | // from the index array of polygon vertex
108 | FbxMesh* lMesh = (FbxMesh*)pGeometry;
109 |
110 | if (lMesh == NULL)
111 | {
112 | // Only Mesh can have normal cache data
113 | continue;
114 | }
115 |
116 | DisplayInt(" Normal Count ", lDataCount);
117 | int pi, j, lPolygonCount = lMesh->GetPolygonCount();
118 | unsigned lNormalIndex = 0;
119 | for (pi = 0; pi < lPolygonCount && lNormalIndex+2 < lDataCount*3; pi++)
120 | {
121 | DisplayInt(" Polygon ", pi);
122 | DisplayString(" Normals for Each Polygon Vertex: ");
123 | int lPolygonSize = lMesh->GetPolygonSize(pi);
124 | for (j = 0; j < lPolygonSize && lNormalIndex+2 < lDataCount*3; j++)
125 | {
126 | FbxVector4 normal(lBuffer[lNormalIndex], lBuffer[lNormalIndex+1], lBuffer[lNormalIndex+2]);
127 | Display3DVector(" Normal Cache Data ", normal);
128 | lNormalIndex += 3;
129 | }
130 | }
131 | }
132 | else
133 | {
134 | DisplayInt(" Points Count: ", lDataCount);
135 | for (unsigned int j = 0; j < lDataCount*3; j=j+3)
136 | {
137 | FbxVector4 points(lBuffer[j], lBuffer[j+1], lBuffer[j+2]);
138 | Display3DVector(" Points Cache Data: ", points);
139 | }
140 | }
141 |
142 | lFrame++;
143 | }
144 |
145 | if (lBuffer != NULL)
146 | {
147 | delete [] lBuffer;
148 | lBuffer = NULL;
149 | }
150 |
151 | lCache->CloseFile();
152 | }
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/ImportScene/DisplayPivotsAndLimits.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | void DisplayPivotsAndLimits(FbxNode* pNode)
15 | {
16 | FbxVector4 lTmpVector;
17 |
18 | //
19 | // Pivots
20 | //
21 | FBXSDK_printf(" Pivot Information\n");
22 |
23 | FbxNode::EPivotState lPivotState;
24 | pNode->GetPivotState(FbxNode::eSourcePivot, lPivotState);
25 | FBXSDK_printf(" Pivot State: %s\n", lPivotState == FbxNode::ePivotActive ? "Active" : "Reference");
26 |
27 | lTmpVector = pNode->GetPreRotation(FbxNode::eSourcePivot);
28 | FBXSDK_printf(" Pre-Rotation: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
29 |
30 | lTmpVector = pNode->GetPostRotation(FbxNode::eSourcePivot);
31 | FBXSDK_printf(" Post-Rotation: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
32 |
33 | lTmpVector = pNode->GetRotationPivot(FbxNode::eSourcePivot);
34 | FBXSDK_printf(" Rotation Pivot: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
35 |
36 | lTmpVector = pNode->GetRotationOffset(FbxNode::eSourcePivot);
37 | FBXSDK_printf(" Rotation Offset: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
38 |
39 | lTmpVector = pNode->GetScalingPivot(FbxNode::eSourcePivot);
40 | FBXSDK_printf(" Scaling Pivot: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
41 |
42 | lTmpVector = pNode->GetScalingOffset(FbxNode::eSourcePivot);
43 | FBXSDK_printf(" Scaling Offset: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
44 |
45 | //
46 | // Limits
47 | //
48 | bool lIsActive, lMinXActive, lMinYActive, lMinZActive;
49 | bool lMaxXActive, lMaxYActive, lMaxZActive;
50 | FbxDouble3 lMinValues, lMaxValues;
51 |
52 | FBXSDK_printf(" Limits Information\n");
53 |
54 | lIsActive = pNode->TranslationActive;
55 | lMinXActive = pNode->TranslationMinX;
56 | lMinYActive = pNode->TranslationMinY;
57 | lMinZActive = pNode->TranslationMinZ;
58 | lMaxXActive = pNode->TranslationMaxX;
59 | lMaxYActive = pNode->TranslationMaxY;
60 | lMaxZActive = pNode->TranslationMaxZ;
61 | lMinValues = pNode->TranslationMin;
62 | lMaxValues = pNode->TranslationMax;
63 |
64 | FBXSDK_printf(" Translation limits: %s\n", lIsActive ? "Active" : "Inactive");
65 | FBXSDK_printf(" X\n");
66 | FBXSDK_printf(" Min Limit: %s\n", lMinXActive ? "Active" : "Inactive");
67 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[0]);
68 | FBXSDK_printf(" Max Limit: %s\n", lMaxXActive ? "Active" : "Inactive");
69 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[0]);
70 | FBXSDK_printf(" Y\n");
71 | FBXSDK_printf(" Min Limit: %s\n", lMinYActive ? "Active" : "Inactive");
72 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[1]);
73 | FBXSDK_printf(" Max Limit: %s\n", lMaxYActive ? "Active" : "Inactive");
74 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[1]);
75 | FBXSDK_printf(" Z\n");
76 | FBXSDK_printf(" Min Limit: %s\n", lMinZActive ? "Active" : "Inactive");
77 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[2]);
78 | FBXSDK_printf(" Max Limit: %s\n", lMaxZActive ? "Active" : "Inactive");
79 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[2]);
80 |
81 | lIsActive = pNode->RotationActive;
82 | lMinXActive = pNode->RotationMinX;
83 | lMinYActive = pNode->RotationMinY;
84 | lMinZActive = pNode->RotationMinZ;
85 | lMaxXActive = pNode->RotationMaxX;
86 | lMaxYActive = pNode->RotationMaxY;
87 | lMaxZActive = pNode->RotationMaxZ;
88 | lMinValues = pNode->RotationMin;
89 | lMaxValues = pNode->RotationMax;
90 |
91 | FBXSDK_printf(" Rotation limits: %s\n", lIsActive ? "Active" : "Inactive");
92 | FBXSDK_printf(" X\n");
93 | FBXSDK_printf(" Min Limit: %s\n", lMinXActive ? "Active" : "Inactive");
94 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[0]);
95 | FBXSDK_printf(" Max Limit: %s\n", lMaxXActive ? "Active" : "Inactive");
96 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[0]);
97 | FBXSDK_printf(" Y\n");
98 | FBXSDK_printf(" Min Limit: %s\n", lMinYActive ? "Active" : "Inactive");
99 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[1]);
100 | FBXSDK_printf(" Max Limit: %s\n", lMaxYActive ? "Active" : "Inactive");
101 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[1]);
102 | FBXSDK_printf(" Z\n");
103 | FBXSDK_printf(" Min Limit: %s\n", lMinZActive ? "Active" : "Inactive");
104 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[2]);
105 | FBXSDK_printf(" Max Limit: %s\n", lMaxZActive ? "Active" : "Inactive");
106 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[2]);
107 |
108 | lIsActive = pNode->ScalingActive;
109 | lMinXActive = pNode->ScalingMinX;
110 | lMinYActive = pNode->ScalingMinY;
111 | lMinZActive = pNode->ScalingMinZ;
112 | lMaxXActive = pNode->ScalingMaxX;
113 | lMaxYActive = pNode->ScalingMaxY;
114 | lMaxZActive = pNode->ScalingMaxZ;
115 | lMinValues = pNode->ScalingMin;
116 | lMaxValues = pNode->ScalingMax;
117 |
118 | FBXSDK_printf(" Scaling limits: %s\n", lIsActive ? "Active" : "Inactive");
119 | FBXSDK_printf(" X\n");
120 | FBXSDK_printf(" Min Limit: %s\n", lMinXActive ? "Active" : "Inactive");
121 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[0]);
122 | FBXSDK_printf(" Max Limit: %s\n", lMaxXActive ? "Active" : "Inactive");
123 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[0]);
124 | FBXSDK_printf(" Y\n");
125 | FBXSDK_printf(" Min Limit: %s\n", lMinYActive ? "Active" : "Inactive");
126 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[1]);
127 | FBXSDK_printf(" Max Limit: %s\n", lMaxYActive ? "Active" : "Inactive");
128 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[1]);
129 | FBXSDK_printf(" Z\n");
130 | FBXSDK_printf(" Min Limit: %s\n", lMinZActive ? "Active" : "Inactive");
131 | FBXSDK_printf(" Min Limit Value: %f\n", lMinValues[2]);
132 | FBXSDK_printf(" Max Limit: %s\n", lMaxZActive ? "Active" : "Inactive");
133 | FBXSDK_printf(" Max Limit Value: %f\n", lMaxValues[2]);
134 | }
135 |
136 |
--------------------------------------------------------------------------------
/ImportScene/DisplayTexture.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayTextureInfo(FbxTexture* pTexture, int pBlendMode)
17 | {
18 | FbxFileTexture *lFileTexture = FbxCast(pTexture);
19 | FbxProceduralTexture *lProceduralTexture = FbxCast(pTexture);
20 |
21 | DisplayString(" Name: \"", (char *) pTexture->GetName(), "\"");
22 | if (lFileTexture)
23 | {
24 | DisplayString(" Type: File Texture");
25 | DisplayString(" File Name: \"", (char *) lFileTexture->GetFileName(), "\"");
26 | }
27 | else if (lProceduralTexture)
28 | {
29 | DisplayString(" Type: Procedural Texture");
30 | }
31 | DisplayDouble(" Scale U: ", pTexture->GetScaleU());
32 | DisplayDouble(" Scale V: ", pTexture->GetScaleV());
33 | DisplayDouble(" Translation U: ", pTexture->GetTranslationU());
34 | DisplayDouble(" Translation V: ", pTexture->GetTranslationV());
35 | DisplayBool(" Swap UV: ", pTexture->GetSwapUV());
36 | DisplayDouble(" Rotation U: ", pTexture->GetRotationU());
37 | DisplayDouble(" Rotation V: ", pTexture->GetRotationV());
38 | DisplayDouble(" Rotation W: ", pTexture->GetRotationW());
39 |
40 | const char* lAlphaSources[] = { "None", "RGB Intensity", "Black" };
41 |
42 | DisplayString(" Alpha Source: ", lAlphaSources[pTexture->GetAlphaSource()]);
43 | DisplayDouble(" Cropping Left: ", pTexture->GetCroppingLeft());
44 | DisplayDouble(" Cropping Top: ", pTexture->GetCroppingTop());
45 | DisplayDouble(" Cropping Right: ", pTexture->GetCroppingRight());
46 | DisplayDouble(" Cropping Bottom: ", pTexture->GetCroppingBottom());
47 |
48 | const char* lMappingTypes[] = { "Null", "Planar", "Spherical", "Cylindrical",
49 | "Box", "Face", "UV", "Environment" };
50 |
51 | DisplayString(" Mapping Type: ", lMappingTypes[pTexture->GetMappingType()]);
52 |
53 | if (pTexture->GetMappingType() == FbxTexture::ePlanar)
54 | {
55 | const char* lPlanarMappingNormals[] = { "X", "Y", "Z" };
56 |
57 | DisplayString(" Planar Mapping Normal: ", lPlanarMappingNormals[pTexture->GetPlanarMappingNormal()]);
58 | }
59 |
60 | const char* lBlendModes[] = { "Translucent", "Add", "Modulate", "Modulate2" };
61 | if(pBlendMode >= 0)
62 | DisplayString(" Blend Mode: ", lBlendModes[pBlendMode]);
63 | DisplayDouble(" Alpha: ", pTexture->GetDefaultAlpha());
64 |
65 | if (lFileTexture)
66 | {
67 | const char* lMaterialUses[] = { "Model Material", "Default Material" };
68 | DisplayString(" Material Use: ", lMaterialUses[lFileTexture->GetMaterialUse()]);
69 | }
70 |
71 | const char* pTextureUses[] = { "Standard", "Shadow Map", "Light Map",
72 | "Spherical Reflexion Map", "Sphere Reflexion Map", "Bump Normal Map" };
73 |
74 | DisplayString(" Texture Use: ", pTextureUses[pTexture->GetTextureUse()]);
75 | DisplayString("");
76 |
77 | }
78 |
79 | void FindAndDisplayTextureInfoByProperty(FbxProperty pProperty, bool& pDisplayHeader, int pMaterialIndex){
80 |
81 | if( pProperty.IsValid() )
82 | {
83 | int lTextureCount = pProperty.GetSrcObjectCount();
84 |
85 | for (int j = 0; j < lTextureCount; ++j)
86 | {
87 | //Here we have to check if it's layeredtextures, or just textures:
88 | FbxLayeredTexture *lLayeredTexture = pProperty.GetSrcObject(j);
89 | if (lLayeredTexture)
90 | {
91 | DisplayInt(" Layered Texture: ", j);
92 | FbxLayeredTexture *lLayeredTexture = pProperty.GetSrcObject(j);
93 | int lNbTextures = lLayeredTexture->GetSrcObjectCount();
94 | for(int k =0; kGetSrcObject(k);
97 | if(lTexture)
98 | {
99 |
100 | if(pDisplayHeader){
101 | DisplayInt(" Textures connected to Material ", pMaterialIndex);
102 | pDisplayHeader = false;
103 | }
104 |
105 | //NOTE the blend mode is ALWAYS on the LayeredTexture and NOT the one on the texture.
106 | //Why is that? because one texture can be shared on different layered textures and might
107 | //have different blend modes.
108 |
109 | FbxLayeredTexture::EBlendMode lBlendMode;
110 | lLayeredTexture->GetTextureBlendMode(k, lBlendMode);
111 | DisplayString(" Textures for ", pProperty.GetName());
112 | DisplayInt(" Texture ", k);
113 | DisplayTextureInfo(lTexture, (int) lBlendMode);
114 | }
115 |
116 | }
117 | }
118 | else
119 | {
120 | //no layered texture simply get on the property
121 | FbxTexture* lTexture = pProperty.GetSrcObject(j);
122 | if(lTexture)
123 | {
124 | //display connected Material header only at the first time
125 | if(pDisplayHeader){
126 | DisplayInt(" Textures connected to Material ", pMaterialIndex);
127 | pDisplayHeader = false;
128 | }
129 |
130 | DisplayString(" Textures for ", pProperty.GetName());
131 | DisplayInt(" Texture ", j);
132 | DisplayTextureInfo(lTexture, -1);
133 | }
134 | }
135 | }
136 | }//end if pProperty
137 |
138 | }
139 |
140 |
141 | void DisplayTexture(FbxGeometry* pGeometry)
142 | {
143 | int lMaterialIndex;
144 | FbxProperty lProperty;
145 | if(pGeometry->GetNode()==NULL)
146 | return;
147 | int lNbMat = pGeometry->GetNode()->GetSrcObjectCount();
148 | for (lMaterialIndex = 0; lMaterialIndex < lNbMat; lMaterialIndex++){
149 | FbxSurfaceMaterial *lMaterial = pGeometry->GetNode()->GetSrcObject(lMaterialIndex);
150 | bool lDisplayHeader = true;
151 |
152 | //go through all the possible textures
153 | if(lMaterial){
154 |
155 | int lTextureIndex;
156 | FBXSDK_FOR_EACH_TEXTURE(lTextureIndex)
157 | {
158 | lProperty = lMaterial->FindProperty(FbxLayerElement::sTextureChannelNames[lTextureIndex]);
159 | FindAndDisplayTextureInfoByProperty(lProperty, lDisplayHeader, lMaterialIndex);
160 | }
161 |
162 | }//end if(lMaterial)
163 |
164 | }// end for lMaterialIndex
165 | }
166 |
--------------------------------------------------------------------------------
/ImportScene/Common.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include "Common.h"
13 |
14 | #ifdef IOS_REF
15 | #undef IOS_REF
16 | #define IOS_REF (*(pManager->GetIOSettings()))
17 | #endif
18 |
19 | void InitializeSdkObjects(FbxManager*& pManager, FbxScene*& pScene)
20 | {
21 | //The first thing to do is to create the FBX Manager which is the object allocator for almost all the classes in the SDK
22 | pManager = FbxManager::Create();
23 | if( !pManager )
24 | {
25 | FBXSDK_printf("Error: Unable to create FBX Manager!\n");
26 | exit(1);
27 | }
28 | else FBXSDK_printf("Autodesk FBX SDK version %s\n", pManager->GetVersion());
29 |
30 | //Create an IOSettings object. This object holds all import/export settings.
31 | FbxIOSettings* ios = FbxIOSettings::Create(pManager, IOSROOT);
32 | pManager->SetIOSettings(ios);
33 |
34 | //Load plugins from the executable directory (optional)
35 | FbxString lPath = FbxGetApplicationDirectory();
36 | pManager->LoadPluginsDirectory(lPath.Buffer());
37 |
38 | //Create an FBX scene. This object holds most objects imported/exported from/to files.
39 | pScene = FbxScene::Create(pManager, "My Scene");
40 | if( !pScene )
41 | {
42 | FBXSDK_printf("Error: Unable to create FBX scene!\n");
43 | exit(1);
44 | }
45 | }
46 |
47 | void DestroySdkObjects(FbxManager* pManager, bool pExitStatus)
48 | {
49 | //Delete the FBX Manager. All the objects that have been allocated using the FBX Manager and that haven't been explicitly destroyed are also automatically destroyed.
50 | if( pManager ) pManager->Destroy();
51 | if( pExitStatus ) FBXSDK_printf("Program Success!\n");
52 | }
53 |
54 | bool SaveScene(FbxManager* pManager, FbxDocument* pScene, const char* pFilename, int pFileFormat, bool pEmbedMedia)
55 | {
56 | int lMajor, lMinor, lRevision;
57 | bool lStatus = true;
58 |
59 | // Create an exporter.
60 | FbxExporter* lExporter = FbxExporter::Create(pManager, "");
61 |
62 | if( pFileFormat < 0 || pFileFormat >= pManager->GetIOPluginRegistry()->GetWriterFormatCount() )
63 | {
64 | // Write in fall back format in less no ASCII format found
65 | pFileFormat = pManager->GetIOPluginRegistry()->GetNativeWriterFormat();
66 |
67 | //Try to export in ASCII if possible
68 | int lFormatIndex, lFormatCount = pManager->GetIOPluginRegistry()->GetWriterFormatCount();
69 |
70 | for (lFormatIndex=0; lFormatIndexGetIOPluginRegistry()->WriterIsFBX(lFormatIndex))
73 | {
74 | FbxString lDesc =pManager->GetIOPluginRegistry()->GetWriterFormatDescription(lFormatIndex);
75 | const char *lASCII = "ascii";
76 | if (lDesc.Find(lASCII)>=0)
77 | {
78 | pFileFormat = lFormatIndex;
79 | break;
80 | }
81 | }
82 | }
83 | }
84 |
85 | // Set the export states. By default, the export states are always set to
86 | // true except for the option eEXPORT_TEXTURE_AS_EMBEDDED. The code below
87 | // shows how to change these states.
88 | IOS_REF.SetBoolProp(EXP_FBX_MATERIAL, true);
89 | IOS_REF.SetBoolProp(EXP_FBX_TEXTURE, true);
90 | IOS_REF.SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia);
91 | IOS_REF.SetBoolProp(EXP_FBX_SHAPE, true);
92 | IOS_REF.SetBoolProp(EXP_FBX_GOBO, true);
93 | IOS_REF.SetBoolProp(EXP_FBX_ANIMATION, true);
94 | IOS_REF.SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, true);
95 |
96 | // Initialize the exporter by providing a filename.
97 | if(lExporter->Initialize(pFilename, pFileFormat, pManager->GetIOSettings()) == false)
98 | {
99 | FBXSDK_printf("Call to FbxExporter::Initialize() failed.\n");
100 | FBXSDK_printf("Error returned: %s\n\n", lExporter->GetStatus().GetErrorString());
101 | return false;
102 | }
103 |
104 | FbxManager::GetFileFormatVersion(lMajor, lMinor, lRevision);
105 | FBXSDK_printf("FBX file format version %d.%d.%d\n\n", lMajor, lMinor, lRevision);
106 |
107 | // Export the scene.
108 | lStatus = lExporter->Export(pScene);
109 |
110 | // Destroy the exporter.
111 | lExporter->Destroy();
112 | return lStatus;
113 | }
114 |
115 | bool LoadScene(FbxManager* pManager, FbxDocument* pScene, const char* pFilename)
116 | {
117 | int lFileMajor, lFileMinor, lFileRevision;
118 | int lSDKMajor, lSDKMinor, lSDKRevision;
119 | //int lFileFormat = -1;
120 | int i, lAnimStackCount;
121 | bool lStatus;
122 | char lPassword[1024];
123 |
124 | // Get the file version number generate by the FBX SDK.
125 | FbxManager::GetFileFormatVersion(lSDKMajor, lSDKMinor, lSDKRevision);
126 |
127 | // Create an importer.
128 | FbxImporter* lImporter = FbxImporter::Create(pManager,"");
129 |
130 | // Initialize the importer by providing a filename.
131 | const bool lImportStatus = lImporter->Initialize(pFilename, -1, pManager->GetIOSettings());
132 | lImporter->GetFileVersion(lFileMajor, lFileMinor, lFileRevision);
133 |
134 | if( !lImportStatus )
135 | {
136 | FbxString error = lImporter->GetStatus().GetErrorString();
137 | FBXSDK_printf("Call to FbxImporter::Initialize() failed.\n");
138 | FBXSDK_printf("Error returned: %s\n\n", error.Buffer());
139 |
140 | if (lImporter->GetStatus().GetCode() == FbxStatus::eInvalidFileVersion)
141 | {
142 | FBXSDK_printf("FBX file format version for this FBX SDK is %d.%d.%d\n", lSDKMajor, lSDKMinor, lSDKRevision);
143 | FBXSDK_printf("FBX file format version for file '%s' is %d.%d.%d\n\n", pFilename, lFileMajor, lFileMinor, lFileRevision);
144 | }
145 |
146 | return false;
147 | }
148 |
149 | FBXSDK_printf("FBX file format version for this FBX SDK is %d.%d.%d\n", lSDKMajor, lSDKMinor, lSDKRevision);
150 |
151 | if (lImporter->IsFBX())
152 | {
153 | FBXSDK_printf("FBX file format version for file '%s' is %d.%d.%d\n\n", pFilename, lFileMajor, lFileMinor, lFileRevision);
154 |
155 | // From this point, it is possible to access animation stack information without
156 | // the expense of loading the entire file.
157 |
158 | FBXSDK_printf("Animation Stack Information\n");
159 |
160 | lAnimStackCount = lImporter->GetAnimStackCount();
161 |
162 | FBXSDK_printf(" Number of Animation Stacks: %d\n", lAnimStackCount);
163 | FBXSDK_printf(" Current Animation Stack: \"%s\"\n", lImporter->GetActiveAnimStackName().Buffer());
164 | FBXSDK_printf("\n");
165 |
166 | for(i = 0; i < lAnimStackCount; i++)
167 | {
168 | FbxTakeInfo* lTakeInfo = lImporter->GetTakeInfo(i);
169 |
170 | FBXSDK_printf(" Animation Stack %d\n", i);
171 | FBXSDK_printf(" Name: \"%s\"\n", lTakeInfo->mName.Buffer());
172 | FBXSDK_printf(" Description: \"%s\"\n", lTakeInfo->mDescription.Buffer());
173 |
174 | // Change the value of the import name if the animation stack should be imported
175 | // under a different name.
176 | FBXSDK_printf(" Import Name: \"%s\"\n", lTakeInfo->mImportName.Buffer());
177 |
178 | // Set the value of the import state to false if the animation stack should be not
179 | // be imported.
180 | FBXSDK_printf(" Import State: %s\n", lTakeInfo->mSelect ? "true" : "false");
181 | FBXSDK_printf("\n");
182 | }
183 |
184 | // Set the import states. By default, the import states are always set to
185 | // true. The code below shows how to change these states.
186 | IOS_REF.SetBoolProp(IMP_FBX_MATERIAL, true);
187 | IOS_REF.SetBoolProp(IMP_FBX_TEXTURE, true);
188 | IOS_REF.SetBoolProp(IMP_FBX_LINK, true);
189 | IOS_REF.SetBoolProp(IMP_FBX_SHAPE, true);
190 | IOS_REF.SetBoolProp(IMP_FBX_GOBO, true);
191 | IOS_REF.SetBoolProp(IMP_FBX_ANIMATION, true);
192 | IOS_REF.SetBoolProp(IMP_FBX_GLOBAL_SETTINGS, true);
193 | }
194 |
195 | // Import the scene.
196 | lStatus = lImporter->Import(pScene);
197 |
198 | if(lStatus == false && lImporter->GetStatus().GetCode() == FbxStatus::ePasswordError)
199 | {
200 | FBXSDK_printf("Please enter password: ");
201 |
202 | lPassword[0] = '\0';
203 |
204 | FBXSDK_CRT_SECURE_NO_WARNING_BEGIN
205 | scanf("%s", lPassword);
206 | FBXSDK_CRT_SECURE_NO_WARNING_END
207 |
208 | FbxString lString(lPassword);
209 |
210 | IOS_REF.SetStringProp(IMP_FBX_PASSWORD, lString);
211 | IOS_REF.SetBoolProp(IMP_FBX_PASSWORD_ENABLE, true);
212 |
213 | lStatus = lImporter->Import(pScene);
214 |
215 | if(lStatus == false && lImporter->GetStatus().GetCode() == FbxStatus::ePasswordError)
216 | {
217 | FBXSDK_printf("\nPassword is wrong, import aborted.\n");
218 | }
219 | }
220 |
221 | // Destroy the importer.
222 | lImporter->Destroy();
223 |
224 | return lStatus;
225 | }
226 |
--------------------------------------------------------------------------------
/ImportScene/main.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | /////////////////////////////////////////////////////////////////////////
13 | //
14 | // This example illustrates how to detect if a scene is password
15 | // protected, import and browse the scene to access node and animation
16 | // information. It displays the content of the FBX file which name is
17 | // passed as program argument. You can try it with the various FBX files
18 | // output by the export examples.
19 | //
20 | /////////////////////////////////////////////////////////////////////////
21 | #include "Common.h"
22 | #include "main.h"
23 |
24 | // Local function prototypes.
25 | bool gVerbose = true;
26 |
27 | int xx__main__xx(FbxString &lFilePath)
28 | {
29 | FbxManager* lSdkManager = NULL;
30 | FbxScene* lScene = NULL;
31 | bool lResult;
32 |
33 | // Prepare the FBX SDK.
34 | InitializeSdkObjects(lSdkManager, lScene);
35 | // Load the scene.
36 | FBXSDK_printf("\n\nFile: %s\n\n", lFilePath.Buffer());
37 | lResult = LoadScene(lSdkManager, lScene, lFilePath.Buffer());
38 |
39 | if(lResult == false)
40 | {
41 | FBXSDK_printf("\n\nAn error occurred while loading the scene...");
42 | }
43 | else
44 | {
45 | // Display the scene.
46 | DisplayMetaData(lScene);
47 |
48 | FBXSDK_printf("\n\n---------------------\nGlobal Light Settings\n---------------------\n\n");
49 |
50 | if( gVerbose ) DisplayGlobalLightSettings(&lScene->GetGlobalSettings());
51 |
52 | FBXSDK_printf("\n\n----------------------\nGlobal Camera Settings\n----------------------\n\n");
53 |
54 | if( gVerbose ) DisplayGlobalCameraSettings(&lScene->GetGlobalSettings());
55 |
56 | FBXSDK_printf("\n\n--------------------\nGlobal Time Settings\n--------------------\n\n");
57 |
58 | if( gVerbose ) DisplayGlobalTimeSettings(&lScene->GetGlobalSettings());
59 |
60 | FBXSDK_printf("\n\n---------\nHierarchy\n---------\n\n");
61 |
62 | if( gVerbose ) DisplayHierarchy(lScene);
63 |
64 | FBXSDK_printf("\n\n------------\nNode Content\n------------\n\n");
65 |
66 | if( gVerbose ) DisplayContent(lScene);
67 |
68 | FBXSDK_printf("\n\n----\nPose\n----\n\n");
69 |
70 | if( gVerbose ) DisplayPose(lScene);
71 |
72 | FBXSDK_printf("\n\n---------\nAnimation\n---------\n\n");
73 |
74 | if( gVerbose ) DisplayAnimation(lScene);
75 |
76 | //now display generic information
77 |
78 | FBXSDK_printf("\n\n---------\nGeneric Information\n---------\n\n");
79 | if( gVerbose ) DisplayGenericInfo(lScene);
80 | }
81 |
82 | // Destroy all objects created by the FBX SDK.
83 | DestroySdkObjects(lSdkManager, lResult);
84 |
85 | return 0;
86 | }
87 |
88 | void DisplayContent(FbxScene* pScene)
89 | {
90 | int i;
91 | FbxNode* lNode = pScene->GetRootNode();
92 |
93 | if(lNode)
94 | {
95 | for(i = 0; i < lNode->GetChildCount(); i++)
96 | {
97 | DisplayContent(lNode->GetChild(i));
98 | }
99 | }
100 | }
101 |
102 | void DisplayContent(FbxNode* pNode)
103 | {
104 | FbxNodeAttribute::EType lAttributeType;
105 | int i;
106 |
107 | if(pNode->GetNodeAttribute() == NULL)
108 | {
109 | FBXSDK_printf("NULL Node Attribute\n\n");
110 | }
111 | else
112 | {
113 | lAttributeType = (pNode->GetNodeAttribute()->GetAttributeType());
114 |
115 | switch (lAttributeType)
116 | {
117 | default:
118 | break;
119 | case FbxNodeAttribute::eMarker:
120 | DisplayMarker(pNode);
121 | break;
122 |
123 | case FbxNodeAttribute::eSkeleton:
124 | DisplaySkeleton(pNode);
125 | break;
126 |
127 | case FbxNodeAttribute::eMesh:
128 | DisplayMesh(pNode);
129 | break;
130 |
131 | case FbxNodeAttribute::eNurbs:
132 | DisplayNurb(pNode);
133 | break;
134 |
135 | case FbxNodeAttribute::ePatch:
136 | DisplayPatch(pNode);
137 | break;
138 |
139 | case FbxNodeAttribute::eCamera:
140 | DisplayCamera(pNode);
141 | break;
142 |
143 | case FbxNodeAttribute::eLight:
144 | DisplayLight(pNode);
145 | break;
146 |
147 | case FbxNodeAttribute::eLODGroup:
148 | DisplayLodGroup(pNode);
149 | break;
150 | }
151 | }
152 |
153 | DisplayUserProperties(pNode);
154 | DisplayTarget(pNode);
155 | DisplayPivotsAndLimits(pNode);
156 | DisplayTransformPropagation(pNode);
157 | DisplayGeometricTransform(pNode);
158 |
159 | for(i = 0; i < pNode->GetChildCount(); i++)
160 | {
161 | DisplayContent(pNode->GetChild(i));
162 | }
163 | }
164 |
165 |
166 | void DisplayTarget(FbxNode* pNode)
167 | {
168 | if(pNode->GetTarget() != NULL)
169 | {
170 | DisplayString(" Target Name: ", (char *) pNode->GetTarget()->GetName());
171 | }
172 | }
173 |
174 | void DisplayTransformPropagation(FbxNode* pNode)
175 | {
176 | FBXSDK_printf(" Transformation Propagation\n");
177 |
178 | //
179 | // Rotation Space
180 | //
181 | EFbxRotationOrder lRotationOrder;
182 | pNode->GetRotationOrder(FbxNode::eSourcePivot, lRotationOrder);
183 |
184 | FBXSDK_printf(" Rotation Space: ");
185 |
186 | switch (lRotationOrder)
187 | {
188 | case eEulerXYZ:
189 | FBXSDK_printf("Euler XYZ\n");
190 | break;
191 | case eEulerXZY:
192 | FBXSDK_printf("Euler XZY\n");
193 | break;
194 | case eEulerYZX:
195 | FBXSDK_printf("Euler YZX\n");
196 | break;
197 | case eEulerYXZ:
198 | FBXSDK_printf("Euler YXZ\n");
199 | break;
200 | case eEulerZXY:
201 | FBXSDK_printf("Euler ZXY\n");
202 | break;
203 | case eEulerZYX:
204 | FBXSDK_printf("Euler ZYX\n");
205 | break;
206 | case eSphericXYZ:
207 | FBXSDK_printf("Spheric XYZ\n");
208 | break;
209 | }
210 |
211 | //
212 | // Use the Rotation space only for the limits
213 | // (keep using eEulerXYZ for the rest)
214 | //
215 | FBXSDK_printf(" Use the Rotation Space for Limit specification only: %s\n",
216 | pNode->GetUseRotationSpaceForLimitOnly(FbxNode::eSourcePivot) ? "Yes" : "No");
217 |
218 |
219 | //
220 | // Inherit Type
221 | //
222 | FbxTransform::EInheritType lInheritType;
223 | pNode->GetTransformationInheritType(lInheritType);
224 |
225 | FBXSDK_printf(" Transformation Inheritance: ");
226 |
227 | switch (lInheritType)
228 | {
229 | case FbxTransform::eInheritRrSs:
230 | FBXSDK_printf("RrSs\n");
231 | break;
232 | case FbxTransform::eInheritRSrs:
233 | FBXSDK_printf("RSrs\n");
234 | break;
235 | case FbxTransform::eInheritRrs:
236 | FBXSDK_printf("Rrs\n");
237 | break;
238 | }
239 | }
240 |
241 | void DisplayGeometricTransform(FbxNode* pNode)
242 | {
243 | FbxVector4 lTmpVector;
244 |
245 | FBXSDK_printf(" Geometric Transformations\n");
246 |
247 | //
248 | // Translation
249 | //
250 | lTmpVector = pNode->GetGeometricTranslation(FbxNode::eSourcePivot);
251 | FBXSDK_printf(" Translation: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
252 |
253 | //
254 | // Rotation
255 | //
256 | lTmpVector = pNode->GetGeometricRotation(FbxNode::eSourcePivot);
257 | FBXSDK_printf(" Rotation: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
258 |
259 | //
260 | // Scaling
261 | //
262 | lTmpVector = pNode->GetGeometricScaling(FbxNode::eSourcePivot);
263 | FBXSDK_printf(" Scaling: %f %f %f\n", lTmpVector[0], lTmpVector[1], lTmpVector[2]);
264 | }
265 |
266 |
267 | void DisplayMetaData(FbxScene* pScene)
268 | {
269 | FbxDocumentInfo* sceneInfo = pScene->GetSceneInfo();
270 | if (sceneInfo)
271 | {
272 | FBXSDK_printf("\n\n--------------------\nMeta-Data\n--------------------\n\n");
273 | FBXSDK_printf(" Title: %s\n", sceneInfo->mTitle.Buffer());
274 | FBXSDK_printf(" Subject: %s\n", sceneInfo->mSubject.Buffer());
275 | FBXSDK_printf(" Author: %s\n", sceneInfo->mAuthor.Buffer());
276 | FBXSDK_printf(" Keywords: %s\n", sceneInfo->mKeywords.Buffer());
277 | FBXSDK_printf(" Revision: %s\n", sceneInfo->mRevision.Buffer());
278 | FBXSDK_printf(" Comment: %s\n", sceneInfo->mComment.Buffer());
279 |
280 | FbxThumbnail* thumbnail = sceneInfo->GetSceneThumbnail();
281 | if (thumbnail)
282 | {
283 | FBXSDK_printf(" Thumbnail:\n");
284 |
285 | switch (thumbnail->GetDataFormat())
286 | {
287 | case FbxThumbnail::eRGB_24:
288 | FBXSDK_printf(" Format: RGB\n");
289 | break;
290 | case FbxThumbnail::eRGBA_32:
291 | FBXSDK_printf(" Format: RGBA\n");
292 | break;
293 | }
294 |
295 | switch (thumbnail->GetSize())
296 | {
297 | default:
298 | break;
299 | case FbxThumbnail::eNotSet:
300 | FBXSDK_printf(" Size: no dimensions specified (%ld bytes)\n", thumbnail->GetSizeInBytes());
301 | break;
302 | case FbxThumbnail::e64x64:
303 | FBXSDK_printf(" Size: 64 x 64 pixels (%ld bytes)\n", thumbnail->GetSizeInBytes());
304 | break;
305 | case FbxThumbnail::e128x128:
306 | FBXSDK_printf(" Size: 128 x 128 pixels (%ld bytes)\n", thumbnail->GetSizeInBytes());
307 | }
308 | }
309 | }
310 | }
311 |
312 |
--------------------------------------------------------------------------------
/ImportScene/DisplayCamera.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayCamera(FbxCamera* pCamera, char* pName, FbxNode* pTargetNode = NULL, FbxNode* pTargetUpNode = NULL);
17 | void DisplayDefaultAnimationValues(FbxCamera* pCamera);
18 | void DisplayRenderOptions(FbxCamera* pCamera);
19 | void DisplayCameraViewOptions(FbxCamera* pCamera);
20 | void DisplayBackgroundProperties(FbxCamera* pCamera);
21 | void DisplayApertureAndFilmControls(FbxCamera* pCamera);
22 | void DisplayViewingAreaControls(FbxCamera* pCamera);
23 | void DisplayCameraPositionAndOrientation(FbxCamera* pCamera, FbxNode* pTargetNode, FbxNode* pUpTargetNode);
24 |
25 |
26 | void DisplayCamera(FbxNode* pNode)
27 | {
28 | DisplayCamera((FbxCamera*) pNode->GetNodeAttribute(), (char *) pNode->GetName(), pNode->GetTarget(), pNode->GetTargetUp());
29 | }
30 |
31 | void DisplayCamera(FbxCamera* pCamera, char* pName, FbxNode* pTargetNode, FbxNode* pTargetUpNode)
32 | {
33 | DisplayString("Camera Name: ", pName);
34 | if (!pCamera)
35 | {
36 | DisplayString("NOT FOUND");
37 | return;
38 | }
39 | DisplayMetaDataConnections(pCamera);
40 |
41 | DisplayCameraPositionAndOrientation(pCamera, pTargetNode, pTargetUpNode);
42 |
43 | const char* lProjectionTypes[] = { "Perspective", "Orthogonal" };
44 |
45 | DisplayString(" Projection Type: ", lProjectionTypes[pCamera->ProjectionType.Get()]);
46 |
47 | DisplayViewingAreaControls(pCamera);
48 |
49 | // If camera projection type is set to FbxCamera::eOrthogonal, the
50 | // aperture and film controls are not relevant.
51 | if (pCamera->ProjectionType.Get() != FbxCamera::eOrthogonal)
52 | {
53 | DisplayApertureAndFilmControls(pCamera);
54 | }
55 |
56 | DisplayBackgroundProperties(pCamera);
57 | DisplayCameraViewOptions(pCamera);
58 | DisplayRenderOptions(pCamera);
59 | DisplayDefaultAnimationValues(pCamera);
60 | }
61 |
62 |
63 | void DisplayCameraPositionAndOrientation(FbxCamera* pCamera, FbxNode* pTargetNode, FbxNode* pTargetUpNode)
64 | {
65 | DisplayString(" Camera Position and Orientation");
66 | Display3DVector(" Position: ", pCamera->Position.Get());
67 |
68 | if (pTargetNode)
69 | {
70 | DisplayString(" Camera Interest: ",(char *) pTargetNode->GetName());
71 | }
72 | else
73 | {
74 | Display3DVector(" Default Camera Interest Position: ", pCamera->InterestPosition.Get());
75 | }
76 |
77 | if (pTargetUpNode)
78 | {
79 | DisplayString(" Camera Up Target: ", (char *) pTargetUpNode->GetName());
80 | }
81 | else
82 | {
83 | Display3DVector(" Up Vector: ", pCamera->UpVector.Get());
84 | }
85 |
86 | DisplayDouble(" Roll: ", pCamera->Roll.Get());
87 | }
88 |
89 |
90 | void DisplayViewingAreaControls(FbxCamera* pCamera)
91 | {
92 | DisplayString(" Viewing Area Controls");
93 |
94 | const char* lCameraFormat[] = { "Custom", "D1 NTSC", "NTSC", "PAL", "D1 PAL",
95 | "HD", "640x480", "320x200", "320x240", "128x128",
96 | "Full Screen" };
97 |
98 | DisplayString(" Format: ", lCameraFormat[pCamera->GetFormat()]);
99 |
100 | const char* lAspectRatioModes[] = { "Window Size", "Fixed Ratio", "Fixed Resolution",
101 | "Fixed Width", "Fixed Height" };
102 |
103 | DisplayString(" Aspect Ratio Mode: ", lAspectRatioModes[pCamera->GetAspectRatioMode()]);
104 |
105 | // If the ratio mode is eWINDOW_SIZE, both width and height values aren't relevant.
106 | if (pCamera->GetAspectRatioMode() != FbxCamera::eWindowSize)
107 | {
108 | DisplayDouble(" Aspect Width: ", pCamera->AspectWidth.Get());
109 | DisplayDouble(" Aspect Height: ", pCamera->AspectHeight.Get());
110 | }
111 |
112 | DisplayDouble(" Pixel Ratio: ", pCamera->PixelAspectRatio.Get());
113 | DisplayDouble(" Near Plane: ", pCamera->NearPlane.Get());
114 | DisplayDouble(" Far Plane: ", pCamera->FarPlane.Get());
115 | DisplayBool(" Mouse Lock: ", pCamera->LockMode.Get());
116 | }
117 |
118 |
119 | void DisplayApertureAndFilmControls(FbxCamera* pCamera)
120 | {
121 | DisplayString(" Aperture and Film Controls");
122 |
123 | const char* lCameraApertureFormats[] = { "Custom",
124 | "16mm Theatrical",
125 | "Super 16mm",
126 | "35mm Academy",
127 | "35mm TV Projection",
128 | "35mm Full Aperture",
129 | "35mm 1.85 Projection",
130 | "35mm Anamorphic",
131 | "70mm Projection",
132 | "VistaVision",
133 | "Dynavision",
134 | "Imax" };
135 |
136 | DisplayString(" Aperture Format: ", lCameraApertureFormats[pCamera->GetApertureFormat()]);
137 |
138 | const char* lCameraApertureModes[] = { "Horizontal and Vertical", "Horizontal", "Vertical", "Focal Length" };
139 |
140 | DisplayString(" Aperture Mode: ", lCameraApertureModes[pCamera->GetApertureMode()]);
141 |
142 | DisplayDouble(" Aperture Width: ", pCamera->GetApertureWidth(), " inches");
143 | DisplayDouble(" Aperture Height: ", pCamera->GetApertureHeight(), " inches");
144 | DisplayDouble(" Squeeze Ratio: ", pCamera->GetSqueezeRatio());
145 | DisplayDouble(" Focal Length: ", pCamera->FocalLength.Get(), "mm");
146 | DisplayDouble(" Field of View: ", pCamera->FieldOfView.Get(), " degrees");
147 | }
148 |
149 |
150 | void DisplayBackgroundProperties(FbxCamera* pCamera)
151 | {
152 | DisplayString(" Background Properties");
153 |
154 | DisplayString(" Background File Name: \"", (char *) pCamera->GetBackgroundFileName(), "\"");
155 |
156 | const char* lBackgroundDisplayModes[] = { "Disabled", "Always", "When Media" };
157 |
158 | DisplayString(" Background Display Mode: ", lBackgroundDisplayModes[pCamera->ViewFrustumBackPlaneMode.Get()]);
159 |
160 | DisplayBool(" Foreground Matte Threshold Enable: ", pCamera->ShowFrontplate.Get());
161 |
162 | // This option is only relevant if background drawing mode is set to eFOREGROUND or eBACKGROUND_AND_FOREGROUND.
163 | if (pCamera->ForegroundOpacity.Get())
164 | {
165 | DisplayDouble(" Foreground Matte Threshold: ", pCamera->BackgroundAlphaTreshold.Get());
166 | }
167 |
168 | FbxString lBackgroundPlacementOptions;
169 |
170 | if (pCamera->GetBackPlateFitImage())
171 | {
172 | lBackgroundPlacementOptions += " Fit,";
173 | }
174 | if (pCamera->GetBackPlateCenter())
175 | {
176 | lBackgroundPlacementOptions += " Center,";
177 | }
178 | if (pCamera->GetBackPlateKeepRatio())
179 | {
180 | lBackgroundPlacementOptions += " Keep Ratio,";
181 | }
182 | if (pCamera->GetBackPlateCrop())
183 | {
184 | lBackgroundPlacementOptions += " Crop,";
185 | }
186 | if (!lBackgroundPlacementOptions.IsEmpty())
187 | {
188 | FbxString lString = lBackgroundPlacementOptions.Left(lBackgroundPlacementOptions.GetLen() - 1);
189 | DisplayString(" Background Placement Options: ",lString.Buffer());
190 | }
191 |
192 | DisplayDouble(" Background Distance: ", pCamera->BackPlaneDistance.Get());
193 |
194 | const char* lCameraBackgroundDistanceModes[] = { "Relative to Interest", "Absolute from Camera" };
195 |
196 | DisplayString(" Background Distance Mode: ", lCameraBackgroundDistanceModes[pCamera->BackPlaneDistanceMode.Get()]);
197 | }
198 |
199 |
200 | void DisplayCameraViewOptions(FbxCamera* pCamera)
201 | {
202 | DisplayString(" Camera View Options");
203 |
204 | DisplayBool(" View Camera Interest: ", pCamera->ViewCameraToLookAt.Get());
205 | DisplayBool(" View Near Far Planes: ", pCamera->ViewFrustumNearFarPlane.Get());
206 | DisplayBool(" Show Grid: ", pCamera->ShowGrid.Get());
207 | DisplayBool(" Show Axis: ", pCamera->ShowAzimut.Get());
208 | DisplayBool(" Show Name: ", pCamera->ShowName.Get());
209 | DisplayBool(" Show Info on Moving: ", pCamera->ShowInfoOnMoving.Get());
210 | DisplayBool(" Show Time Code: ", pCamera->ShowTimeCode.Get());
211 | DisplayBool(" Display Safe Area: ", pCamera->DisplaySafeArea.Get());
212 |
213 | const char* lSafeAreaStyles[] = { "Round", "Square" };
214 | FbxColor color;
215 | FbxDouble3 c;
216 |
217 | DisplayString(" Safe Area Style: ", lSafeAreaStyles[pCamera->SafeAreaDisplayStyle.Get()]);
218 | DisplayBool(" Show Audio: ", pCamera->ShowAudio.Get());
219 |
220 | c = pCamera->BackgroundColor.Get();
221 | color = FbxColor(c[0], c[1], c[2]);
222 | DisplayColor(" Background Color: ", color);
223 |
224 | c = pCamera->AudioColor.Get();
225 | color = FbxColor(c[0], c[1], c[2]);
226 | DisplayColor(" Audio Color: ", color);
227 |
228 | DisplayBool(" Use Frame Color: ", pCamera->UseFrameColor.Get());
229 |
230 | c = pCamera->FrameColor.Get();
231 | color = FbxColor(c[0], c[1], c[2]);
232 | DisplayColor(" Frame Color: ", color);
233 | }
234 |
235 |
236 | void DisplayRenderOptions(FbxCamera* pCamera)
237 | {
238 | DisplayString(" Render Options");
239 |
240 | const char* lCameraRenderOptionsUsageTimes[] = { "Interactive", "At Render" };
241 |
242 | DisplayString(" Render Options Usage Time: ", lCameraRenderOptionsUsageTimes[pCamera->UseRealTimeDOFAndAA.Get()]);
243 | DisplayBool(" Use Antialiasing: ", pCamera->UseAntialiasing.Get());
244 | DisplayDouble(" Antialiasing Intensity: ", pCamera->AntialiasingIntensity.Get());
245 |
246 | const char* lCameraAntialiasingMethods[] = { "Oversampling Antialiasing", "Hardware Antialiasing" };
247 |
248 | DisplayString(" Antialiasing Method: ", lCameraAntialiasingMethods[pCamera->AntialiasingMethod.Get()]);
249 |
250 | // This option is only relevant if antialiasing method is set to eOVERSAMPLING_ANTIALIASING.
251 | if (pCamera->AntialiasingMethod.Get() == FbxCamera::eAAOversampling)
252 | {
253 | DisplayInt(" Number of Samples: ", pCamera->FrameSamplingCount.Get());
254 | }
255 |
256 | const char* lCameraSamplingTypes[] = { "Uniform", "Stochastic" };
257 |
258 | DisplayString(" Sampling Type: ", lCameraSamplingTypes[pCamera->FrameSamplingType.Get()]);
259 | DisplayBool(" Use Accumulation Buffer: ", pCamera->UseAccumulationBuffer.Get());
260 | DisplayBool(" Use Depth of Field: ", pCamera->UseDepthOfField.Get());
261 |
262 | const char* lCameraFocusDistanceSources[] = { "Camera Interest", "Specific Distance" };
263 |
264 | DisplayString(" Focus Distance Source: ", lCameraFocusDistanceSources[pCamera->FocusSource.Get()]);
265 |
266 | // This parameter is only relevant if focus distance source is set to eSPECIFIC_DISTANCE.
267 | if (pCamera->FocusSource.Get() == FbxCamera::eFocusSpecificDistance)
268 | {
269 | DisplayDouble(" Specific Distance: ", pCamera->FocusDistance.Get());
270 | }
271 |
272 | DisplayDouble(" Focus Angle: ", pCamera->FocusAngle.Get(), " degrees");
273 | }
274 |
275 |
276 | void DisplayDefaultAnimationValues(FbxCamera* pCamera)
277 | {
278 | DisplayString(" Default Animation Values");
279 |
280 | DisplayDouble(" Default Field of View: ", pCamera->FieldOfView.Get());
281 | DisplayDouble(" Default Field of View X: ", pCamera->FieldOfViewX.Get());
282 | DisplayDouble(" Default Field of View Y: ", pCamera->FieldOfViewY.Get());
283 | DisplayDouble(" Default Optical Center X: ", pCamera->OpticalCenterX.Get());
284 | DisplayDouble(" Default Optical Center Y: ", pCamera->OpticalCenterY.Get());
285 | DisplayDouble(" Default Roll: ", pCamera->Roll.Get());
286 | }
287 |
288 |
289 |
--------------------------------------------------------------------------------
/ImportScene/DisplayMaterial.cxx:
--------------------------------------------------------------------------------
1 | /****************************************************************************************
2 |
3 | Copyright (C) 2014 Autodesk, Inc.
4 | All rights reserved.
5 |
6 | Use of this software is subject to the terms of the Autodesk license agreement
7 | provided at the time of installation or download, or which otherwise accompanies
8 | this software in either electronic or hard copy form.
9 |
10 | ****************************************************************************************/
11 |
12 | #include
13 |
14 | #include "DisplayCommon.h"
15 |
16 | void DisplayMaterial(FbxGeometry* pGeometry)
17 | {
18 | int lMaterialCount = 0;
19 | FbxNode* lNode = NULL;
20 | if(pGeometry){
21 | lNode = pGeometry->GetNode();
22 | if(lNode)
23 | lMaterialCount = lNode->GetMaterialCount();
24 | }
25 |
26 | if (lMaterialCount > 0)
27 | {
28 | FbxPropertyT lKFbxDouble3;
29 | FbxPropertyT lKFbxDouble1;
30 | FbxColor theColor;
31 |
32 | for (int lCount = 0; lCount < lMaterialCount; lCount ++)
33 | {
34 | DisplayInt(" Material ", lCount);
35 |
36 | FbxSurfaceMaterial *lMaterial = lNode->GetMaterial(lCount);
37 |
38 | DisplayString(" Name: \"", (char *) lMaterial->GetName(), "\"");
39 |
40 | //Get the implementation to see if it's a hardware shader.
41 | const FbxImplementation* lImplementation = GetImplementation(lMaterial, FBXSDK_IMPLEMENTATION_HLSL);
42 | FbxString lImplemenationType = "HLSL";
43 | if(!lImplementation)
44 | {
45 | lImplementation = GetImplementation(lMaterial, FBXSDK_IMPLEMENTATION_CGFX);
46 | lImplemenationType = "CGFX";
47 | }
48 | if(lImplementation)
49 | {
50 | //Now we have a hardware shader, let's read it
51 | FBXSDK_printf(" Hardware Shader Type: %s\n", lImplemenationType.Buffer());
52 | const FbxBindingTable* lRootTable = lImplementation->GetRootTable();
53 | FbxString lFileName = lRootTable->DescAbsoluteURL.Get();
54 | FbxString lTechniqueName = lRootTable->DescTAG.Get();
55 |
56 |
57 | const FbxBindingTable* lTable = lImplementation->GetRootTable();
58 | size_t lEntryNum = lTable->GetEntryCount();
59 |
60 | for(int i=0;i <(int)lEntryNum; ++i)
61 | {
62 | const FbxBindingTableEntry& lEntry = lTable->GetEntry(i);
63 | const char* lEntrySrcType = lEntry.GetEntryType(true);
64 | FbxProperty lFbxProp;
65 |
66 |
67 | FbxString lTest = lEntry.GetSource();
68 | FBXSDK_printf(" Entry: %s\n", lTest.Buffer());
69 |
70 |
71 | if ( strcmp( FbxPropertyEntryView::sEntryType, lEntrySrcType ) == 0 )
72 | {
73 | lFbxProp = lMaterial->FindPropertyHierarchical(lEntry.GetSource());
74 | if(!lFbxProp.IsValid())
75 | {
76 | lFbxProp = lMaterial->RootProperty.FindHierarchical(lEntry.GetSource());
77 | }
78 |
79 |
80 | }
81 | else if( strcmp( FbxConstantEntryView::sEntryType, lEntrySrcType ) == 0 )
82 | {
83 | lFbxProp = lImplementation->GetConstants().FindHierarchical(lEntry.GetSource());
84 | }
85 | if(lFbxProp.IsValid())
86 | {
87 | if( lFbxProp.GetSrcObjectCount() > 0 )
88 | {
89 | //do what you want with the textures
90 | for(int j=0; j(); ++j)
91 | {
92 | FbxFileTexture *lTex = lFbxProp.GetSrcObject(j);
93 | FBXSDK_printf(" File Texture: %s\n", lTex->GetFileName());
94 | }
95 | for(int j=0; j(); ++j)
96 | {
97 | FbxLayeredTexture *lTex = lFbxProp.GetSrcObject(j);
98 | FBXSDK_printf(" Layered Texture: %s\n", lTex->GetName());
99 | }
100 | for(int j=0; j(); ++j)
101 | {
102 | FbxProceduralTexture *lTex = lFbxProp.GetSrcObject(j);
103 | FBXSDK_printf(" Procedural Texture: %s\n", lTex->GetName());
104 | }
105 | }
106 | else
107 | {
108 | FbxDataType lFbxType = lFbxProp.GetPropertyDataType();
109 | FbxString blah = lFbxType.GetName();
110 | if(FbxBoolDT == lFbxType)
111 | {
112 | DisplayBool(" Bool: ", lFbxProp.Get() );
113 | }
114 | else if ( FbxIntDT == lFbxType || FbxEnumDT == lFbxType )
115 | {
116 | DisplayInt(" Int: ", lFbxProp.Get());
117 | }
118 | else if ( FbxFloatDT == lFbxType)
119 | {
120 | DisplayDouble(" Float: ", lFbxProp.Get());
121 |
122 | }
123 | else if ( FbxDoubleDT == lFbxType)
124 | {
125 | DisplayDouble(" Double: ", lFbxProp.Get());
126 | }
127 | else if ( FbxStringDT == lFbxType
128 | || FbxUrlDT == lFbxType
129 | || FbxXRefUrlDT == lFbxType )
130 | {
131 | DisplayString(" String: ", lFbxProp.Get().Buffer());
132 | }
133 | else if ( FbxDouble2DT == lFbxType)
134 | {
135 | FbxDouble2 lDouble2 = lFbxProp.Get();
136 | FbxVector2 lVect;
137 | lVect[0] = lDouble2[0];
138 | lVect[1] = lDouble2[1];
139 |
140 | Display2DVector(" 2D vector: ", lVect);
141 | }
142 | else if ( FbxDouble3DT == lFbxType || FbxColor3DT == lFbxType)
143 | {
144 | FbxDouble3 lDouble3 = lFbxProp.Get();
145 |
146 |
147 | FbxVector4 lVect;
148 | lVect[0] = lDouble3[0];
149 | lVect[1] = lDouble3[1];
150 | lVect[2] = lDouble3[2];
151 | Display3DVector(" 3D vector: ", lVect);
152 | }
153 |
154 | else if ( FbxDouble4DT == lFbxType || FbxColor4DT == lFbxType)
155 | {
156 | FbxDouble4 lDouble4 = lFbxProp.Get();
157 | FbxVector4 lVect;
158 | lVect[0] = lDouble4[0];
159 | lVect[1] = lDouble4[1];
160 | lVect[2] = lDouble4[2];
161 | lVect[3] = lDouble4[3];
162 | Display4DVector(" 4D vector: ", lVect);
163 | }
164 | else if ( FbxDouble4x4DT == lFbxType)
165 | {
166 | FbxDouble4x4 lDouble44 = lFbxProp.Get();
167 | for(int j=0; j<4; ++j)
168 | {
169 |
170 | FbxVector4 lVect;
171 | lVect[0] = lDouble44[j][0];
172 | lVect[1] = lDouble44[j][1];
173 | lVect[2] = lDouble44[j][2];
174 | lVect[3] = lDouble44[j][3];
175 | Display4DVector(" 4x4D vector: ", lVect);
176 | }
177 |
178 | }
179 | }
180 |
181 | }
182 | }
183 | }
184 | else if (lMaterial->GetClassId().Is(FbxSurfacePhong::ClassId))
185 | {
186 | // We found a Phong material. Display its properties.
187 |
188 | // Display the Ambient Color
189 | lKFbxDouble3 =((FbxSurfacePhong *) lMaterial)->Ambient;
190 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
191 | DisplayColor(" Ambient: ", theColor);
192 |
193 | // Display the Diffuse Color
194 | lKFbxDouble3 =((FbxSurfacePhong *) lMaterial)->Diffuse;
195 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
196 | DisplayColor(" Diffuse: ", theColor);
197 |
198 | // Display the Specular Color (unique to Phong materials)
199 | lKFbxDouble3 =((FbxSurfacePhong *) lMaterial)->Specular;
200 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
201 | DisplayColor(" Specular: ", theColor);
202 |
203 | // Display the Emissive Color
204 | lKFbxDouble3 =((FbxSurfacePhong *) lMaterial)->Emissive;
205 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
206 | DisplayColor(" Emissive: ", theColor);
207 |
208 | //Opacity is Transparency factor now
209 | lKFbxDouble1 =((FbxSurfacePhong *) lMaterial)->TransparencyFactor;
210 | DisplayDouble(" Opacity: ", 1.0-lKFbxDouble1.Get());
211 |
212 | // Display the Shininess
213 | lKFbxDouble1 =((FbxSurfacePhong *) lMaterial)->Shininess;
214 | DisplayDouble(" Shininess: ", lKFbxDouble1.Get());
215 |
216 | // Display the Reflectivity
217 | lKFbxDouble1 =((FbxSurfacePhong *) lMaterial)->ReflectionFactor;
218 | DisplayDouble(" Reflectivity: ", lKFbxDouble1.Get());
219 | }
220 | else if(lMaterial->GetClassId().Is(FbxSurfaceLambert::ClassId) )
221 | {
222 | // We found a Lambert material. Display its properties.
223 | // Display the Ambient Color
224 | lKFbxDouble3=((FbxSurfaceLambert *)lMaterial)->Ambient;
225 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
226 | DisplayColor(" Ambient: ", theColor);
227 |
228 | // Display the Diffuse Color
229 | lKFbxDouble3 =((FbxSurfaceLambert *)lMaterial)->Diffuse;
230 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
231 | DisplayColor(" Diffuse: ", theColor);
232 |
233 | // Display the Emissive
234 | lKFbxDouble3 =((FbxSurfaceLambert *)lMaterial)->Emissive;
235 | theColor.Set(lKFbxDouble3.Get()[0], lKFbxDouble3.Get()[1], lKFbxDouble3.Get()[2]);
236 | DisplayColor(" Emissive: ", theColor);
237 |
238 | // Display the Opacity
239 | lKFbxDouble1 =((FbxSurfaceLambert *)lMaterial)->TransparencyFactor;
240 | DisplayDouble(" Opacity: ", 1.0-lKFbxDouble1.Get());
241 | }
242 | else
243 | DisplayString("Unknown type of Material");
244 |
245 | FbxPropertyT lString;
246 | lString = lMaterial->ShadingModel;
247 | DisplayString(" Shading Model: ", lString.Get().Buffer());
248 | DisplayString("");
249 | }
250 | }
251 | }
252 |
253 |
--------------------------------------------------------------------------------
/ImportScene.xcodeproj/xcuserdata/cyrille.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
40 |
52 |
53 |
54 |
56 |
68 |
69 |
70 |
72 |
84 |
85 |
86 |
88 |
100 |
101 |
102 |
104 |
116 |
117 |
118 |
120 |
132 |
133 |
134 |
136 |
148 |
149 |
150 |
152 |
164 |
165 |
166 |
168 |
180 |
181 |
182 |
184 |
196 |
197 |
198 |
200 |
212 |
213 |
214 |
216 |
228 |
229 |
230 |
232 |
244 |
245 |
246 |
248 |
260 |
261 |
262 |
264 |
276 |
277 |
278 |
280 |
292 |
293 |
294 |
296 |
308 |
309 |
310 |
311 |
312 |
--------------------------------------------------------------------------------
/ImportScene/Base.lproj/Main_iPad.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
104 |
110 |
116 |
122 |
128 |
134 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
160 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
--------------------------------------------------------------------------------