{"action":"created","comment":{"url":"https://api.github.com/repos/poparteu/openMVG/pulls/comments/69373600","id":69373600,"diff_hunk":"@@ -0,0 +1,108 @@\n+// Copyright (c) 2015 Stian Z. Vrba.\n+//\n+// // This Source Code Form is subject to the terms of the Mozilla Public\n+// // License, v. 2.0. If a copy of the MPL was not distributed with this\n+// // file, You can obtain one at http://mozilla.org/MPL/2.0/.\n+\n+\n+#include <cstdlib>\n+\n+// Command line\n+#include \"third_party/cmdLine/cmdLine.h\"\n+\n+// OpenMVG\n+#include \"openMVG/sfm/sfm.hpp\"\n+#include \"openMVG/numeric/numeric.h\"\n+#include \"openMVG/geometry/pose3.hpp\"\n+using namespace openMVG::sfm;\n+\n+// FBX\n+#include <fbxsdk.h>\n+\n+int main(int argc, char **argv) {\n+   \n+    // Get arguments\n+    CmdLine cmdLine;\n+    std::string sfmDataFilename;\n+    std::string sOutFBX = \"\";\n+\n+    cmdLine.add(make_option('i', sfmDataFilename, \"sfmdata\"));\n+    cmdLine.add(make_option('o', sOutFBX, \"outfile\"));\n+\n+    try {\n+        if (argc < 4) throw std::string(\"Invalid number of parameters in the command line.\");\n+        cmdLine.process(argc, argv);\n+    } catch(const std::string &s) {\n+        std::cout << \"openMVG to FBX\\n\";\n+        std::cout << \"Usage: \" << argv[0] << '\\n'\n+        << \"[-i|--sfmdata filename, the SfM_Data file to convert]\\n\"\n+        << \"[-o|--outfile path]\\n\"\n+        << std::endl;\n+        std::cerr << s << std::endl;\n+        return EXIT_FAILURE;\n+    }\n+\n+    //\n+    SfM_Data sfm_data;\n+    if (!Load(sfm_data, sfmDataFilename, ESfM_Data(ALL))) {\n+        std::cout << \"Error: The input project file \\\"\"\n+                  << sfmDataFilename << \"\\\" cannot be read.\" << std::endl;\n+        return EXIT_FAILURE;\n+    }\n+\n+    //=================================================================================\n+    // Create scene and mesh\n+    //=================================================================================\n+    \n+    FbxAutoDestroyPtr<FbxManager> fbxmanager(FbxManager::Create());\n+    FbxScene* fbxscene = FbxScene::Create(fbxmanager, \"openMVG\");\n+    \n+    FbxNode* fbxnode = FbxNode::Create(fbxscene, \"sfm_node\");\n+    fbxscene->GetRootNode()->AddChild(fbxnode);\n+    \n+    FbxMesh* fbxmesh = FbxMesh::Create(fbxscene, \"sfm_mesh\");\n+    fbxnode->SetNodeAttribute(fbxmesh);\n+    \n+    //=================================================================================\n+    // Add points.  FBX has no native support for point clouds, so we create a mesh\n+    // containing only vertices, w/o any other geometry.\n+    //=================================================================================\n+\n+    {\n+      const int point_count = sfm_data.GetLandmarks().size();\n+      fbxmesh->InitControlPoints(point_count);\n+      FbxVector4* out = fbxmesh->GetControlPoints();\n+      for (const auto& lm: sfm_data.GetLandmarks()) {\n+        const openMVG::Vec3 &pt = lm.second.X;\n+        *out++ = FbxVector4(pt[0], pt[1], pt[2]);","path":"src/software/SfM/main_openMVG2FBX.cpp","position":77,"original_position":77,"commit_id":"4d7f7c1778be7a96191e951adf50dafa04cac0cb","original_commit_id":"4d7f7c1778be7a96191e951adf50dafa04cac0cb","user":{"login":"zvrba","id":630366,"avatar_url":"https://avatars.githubusercontent.com/u/630366?v=3","gravatar_id":"","url":"https://api.github.com/users/zvrba","html_url":"https://github.com/zvrba","followers_url":"https://api.github.com/users/zvrba/followers","following_url":"https://api.github.com/users/zvrba/following{/other_user}","gists_url":"https://api.github.com/users/zvrba/gists{/gist_id}","starred_url":"https://api.github.com/users/zvrba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvrba/subscriptions","organizations_url":"https://api.github.com/users/zvrba/orgs","repos_url":"https://api.github.com/users/zvrba/repos","events_url":"https://api.github.com/users/zvrba/events{/privacy}","received_events_url":"https://api.github.com/users/zvrba/received_events","type":"User","site_admin":false},"body":"It's easy, so I'll do it :) A question though: are rgb components floats normalized to [0,1]?","created_at":"2016-07-02T06:11:10Z","updated_at":"2016-07-02T06:11:10Z","html_url":"https://github.com/poparteu/openMVG/pull/174#discussion_r69373600","pull_request_url":"https://api.github.com/repos/poparteu/openMVG/pulls/174","_links":{"self":{"href":"https://api.github.com/repos/poparteu/openMVG/pulls/comments/69373600"},"html":{"href":"https://github.com/poparteu/openMVG/pull/174#discussion_r69373600"},"pull_request":{"href":"https://api.github.com/repos/poparteu/openMVG/pulls/174"}}},"pull_request":{"url":"https://api.github.com/repos/poparteu/openMVG/pulls/174","id":75971368,"html_url":"https://github.com/poparteu/openMVG/pull/174","diff_url":"https://github.com/poparteu/openMVG/pull/174.diff","patch_url":"https://github.com/poparteu/openMVG/pull/174.patch","issue_url":"https://api.github.com/repos/poparteu/openMVG/issues/174","number":174,"state":"open","locked":false,"title":"Added program to export point cloud in FBX format","user":{"login":"zvrba","id":630366,"avatar_url":"https://avatars.githubusercontent.com/u/630366?v=3","gravatar_id":"","url":"https://api.github.com/users/zvrba","html_url":"https://github.com/zvrba","followers_url":"https://api.github.com/users/zvrba/followers","following_url":"https://api.github.com/users/zvrba/following{/other_user}","gists_url":"https://api.github.com/users/zvrba/gists{/gist_id}","starred_url":"https://api.github.com/users/zvrba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvrba/subscriptions","organizations_url":"https://api.github.com/users/zvrba/orgs","repos_url":"https://api.github.com/users/zvrba/repos","events_url":"https://api.github.com/users/zvrba/events{/privacy}","received_events_url":"https://api.github.com/users/zvrba/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-01T12:17:48Z","updated_at":"2016-07-02T06:11:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6ab07e1556e68561433bc388a93b4c098ef3fa1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/poparteu/openMVG/pulls/174/commits","review_comments_url":"https://api.github.com/repos/poparteu/openMVG/pulls/174/comments","review_comment_url":"https://api.github.com/repos/poparteu/openMVG/pulls/comments{/number}","comments_url":"https://api.github.com/repos/poparteu/openMVG/issues/174/comments","statuses_url":"https://api.github.com/repos/poparteu/openMVG/statuses/4d7f7c1778be7a96191e951adf50dafa04cac0cb","head":{"label":"poparteu:fbxexport","ref":"fbxexport","sha":"4d7f7c1778be7a96191e951adf50dafa04cac0cb","user":{"login":"poparteu","id":9333123,"avatar_url":"https://avatars.githubusercontent.com/u/9333123?v=3","gravatar_id":"","url":"https://api.github.com/users/poparteu","html_url":"https://github.com/poparteu","followers_url":"https://api.github.com/users/poparteu/followers","following_url":"https://api.github.com/users/poparteu/following{/other_user}","gists_url":"https://api.github.com/users/poparteu/gists{/gist_id}","starred_url":"https://api.github.com/users/poparteu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poparteu/subscriptions","organizations_url":"https://api.github.com/users/poparteu/orgs","repos_url":"https://api.github.com/users/poparteu/repos","events_url":"https://api.github.com/users/poparteu/events{/privacy}","received_events_url":"https://api.github.com/users/poparteu/received_events","type":"Organization","site_admin":false},"repo":{"id":28635894,"name":"openMVG","full_name":"poparteu/openMVG","owner":{"login":"poparteu","id":9333123,"avatar_url":"https://avatars.githubusercontent.com/u/9333123?v=3","gravatar_id":"","url":"https://api.github.com/users/poparteu","html_url":"https://github.com/poparteu","followers_url":"https://api.github.com/users/poparteu/followers","following_url":"https://api.github.com/users/poparteu/following{/other_user}","gists_url":"https://api.github.com/users/poparteu/gists{/gist_id}","starred_url":"https://api.github.com/users/poparteu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poparteu/subscriptions","organizations_url":"https://api.github.com/users/poparteu/orgs","repos_url":"https://api.github.com/users/poparteu/repos","events_url":"https://api.github.com/users/poparteu/events{/privacy}","received_events_url":"https://api.github.com/users/poparteu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/poparteu/openMVG","description":"open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.","fork":true,"url":"https://api.github.com/repos/poparteu/openMVG","forks_url":"https://api.github.com/repos/poparteu/openMVG/forks","keys_url":"https://api.github.com/repos/poparteu/openMVG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poparteu/openMVG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poparteu/openMVG/teams","hooks_url":"https://api.github.com/repos/poparteu/openMVG/hooks","issue_events_url":"https://api.github.com/repos/poparteu/openMVG/issues/events{/number}","events_url":"https://api.github.com/repos/poparteu/openMVG/events","assignees_url":"https://api.github.com/repos/poparteu/openMVG/assignees{/user}","branches_url":"https://api.github.com/repos/poparteu/openMVG/branches{/branch}","tags_url":"https://api.github.com/repos/poparteu/openMVG/tags","blobs_url":"https://api.github.com/repos/poparteu/openMVG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poparteu/openMVG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poparteu/openMVG/git/refs{/sha}","trees_url":"https://api.github.com/repos/poparteu/openMVG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poparteu/openMVG/statuses/{sha}","languages_url":"https://api.github.com/repos/poparteu/openMVG/languages","stargazers_url":"https://api.github.com/repos/poparteu/openMVG/stargazers","contributors_url":"https://api.github.com/repos/poparteu/openMVG/contributors","subscribers_url":"https://api.github.com/repos/poparteu/openMVG/subscribers","subscription_url":"https://api.github.com/repos/poparteu/openMVG/subscription","commits_url":"https://api.github.com/repos/poparteu/openMVG/commits{/sha}","git_commits_url":"https://api.github.com/repos/poparteu/openMVG/git/commits{/sha}","comments_url":"https://api.github.com/repos/poparteu/openMVG/comments{/number}","issue_comment_url":"https://api.github.com/repos/poparteu/openMVG/issues/comments{/number}","contents_url":"https://api.github.com/repos/poparteu/openMVG/contents/{+path}","compare_url":"https://api.github.com/repos/poparteu/openMVG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poparteu/openMVG/merges","archive_url":"https://api.github.com/repos/poparteu/openMVG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poparteu/openMVG/downloads","issues_url":"https://api.github.com/repos/poparteu/openMVG/issues{/number}","pulls_url":"https://api.github.com/repos/poparteu/openMVG/pulls{/number}","milestones_url":"https://api.github.com/repos/poparteu/openMVG/milestones{/number}","notifications_url":"https://api.github.com/repos/poparteu/openMVG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poparteu/openMVG/labels{/name}","releases_url":"https://api.github.com/repos/poparteu/openMVG/releases{/id}","deployments_url":"https://api.github.com/repos/poparteu/openMVG/deployments","created_at":"2014-12-30T15:39:27Z","updated_at":"2016-01-28T19:18:10Z","pushed_at":"2016-07-01T19:51:06Z","git_url":"git://github.com/poparteu/openMVG.git","ssh_url":"git@github.com:poparteu/openMVG.git","clone_url":"https://github.com/poparteu/openMVG.git","svn_url":"https://github.com/poparteu/openMVG","homepage":"","size":23246,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":46,"forks":1,"open_issues":46,"watchers":1,"default_branch":"popart_develop"}},"base":{"label":"poparteu:popart_develop","ref":"popart_develop","sha":"1b1d1c23334bed208f10bc8ff2ec305756010d6f","user":{"login":"poparteu","id":9333123,"avatar_url":"https://avatars.githubusercontent.com/u/9333123?v=3","gravatar_id":"","url":"https://api.github.com/users/poparteu","html_url":"https://github.com/poparteu","followers_url":"https://api.github.com/users/poparteu/followers","following_url":"https://api.github.com/users/poparteu/following{/other_user}","gists_url":"https://api.github.com/users/poparteu/gists{/gist_id}","starred_url":"https://api.github.com/users/poparteu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poparteu/subscriptions","organizations_url":"https://api.github.com/users/poparteu/orgs","repos_url":"https://api.github.com/users/poparteu/repos","events_url":"https://api.github.com/users/poparteu/events{/privacy}","received_events_url":"https://api.github.com/users/poparteu/received_events","type":"Organization","site_admin":false},"repo":{"id":28635894,"name":"openMVG","full_name":"poparteu/openMVG","owner":{"login":"poparteu","id":9333123,"avatar_url":"https://avatars.githubusercontent.com/u/9333123?v=3","gravatar_id":"","url":"https://api.github.com/users/poparteu","html_url":"https://github.com/poparteu","followers_url":"https://api.github.com/users/poparteu/followers","following_url":"https://api.github.com/users/poparteu/following{/other_user}","gists_url":"https://api.github.com/users/poparteu/gists{/gist_id}","starred_url":"https://api.github.com/users/poparteu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poparteu/subscriptions","organizations_url":"https://api.github.com/users/poparteu/orgs","repos_url":"https://api.github.com/users/poparteu/repos","events_url":"https://api.github.com/users/poparteu/events{/privacy}","received_events_url":"https://api.github.com/users/poparteu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/poparteu/openMVG","description":"open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.","fork":true,"url":"https://api.github.com/repos/poparteu/openMVG","forks_url":"https://api.github.com/repos/poparteu/openMVG/forks","keys_url":"https://api.github.com/repos/poparteu/openMVG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poparteu/openMVG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poparteu/openMVG/teams","hooks_url":"https://api.github.com/repos/poparteu/openMVG/hooks","issue_events_url":"https://api.github.com/repos/poparteu/openMVG/issues/events{/number}","events_url":"https://api.github.com/repos/poparteu/openMVG/events","assignees_url":"https://api.github.com/repos/poparteu/openMVG/assignees{/user}","branches_url":"https://api.github.com/repos/poparteu/openMVG/branches{/branch}","tags_url":"https://api.github.com/repos/poparteu/openMVG/tags","blobs_url":"https://api.github.com/repos/poparteu/openMVG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poparteu/openMVG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poparteu/openMVG/git/refs{/sha}","trees_url":"https://api.github.com/repos/poparteu/openMVG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poparteu/openMVG/statuses/{sha}","languages_url":"https://api.github.com/repos/poparteu/openMVG/languages","stargazers_url":"https://api.github.com/repos/poparteu/openMVG/stargazers","contributors_url":"https://api.github.com/repos/poparteu/openMVG/contributors","subscribers_url":"https://api.github.com/repos/poparteu/openMVG/subscribers","subscription_url":"https://api.github.com/repos/poparteu/openMVG/subscription","commits_url":"https://api.github.com/repos/poparteu/openMVG/commits{/sha}","git_commits_url":"https://api.github.com/repos/poparteu/openMVG/git/commits{/sha}","comments_url":"https://api.github.com/repos/poparteu/openMVG/comments{/number}","issue_comment_url":"https://api.github.com/repos/poparteu/openMVG/issues/comments{/number}","contents_url":"https://api.github.com/repos/poparteu/openMVG/contents/{+path}","compare_url":"https://api.github.com/repos/poparteu/openMVG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poparteu/openMVG/merges","archive_url":"https://api.github.com/repos/poparteu/openMVG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poparteu/openMVG/downloads","issues_url":"https://api.github.com/repos/poparteu/openMVG/issues{/number}","pulls_url":"https://api.github.com/repos/poparteu/openMVG/pulls{/number}","milestones_url":"https://api.github.com/repos/poparteu/openMVG/milestones{/number}","notifications_url":"https://api.github.com/repos/poparteu/openMVG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poparteu/openMVG/labels{/name}","releases_url":"https://api.github.com/repos/poparteu/openMVG/releases{/id}","deployments_url":"https://api.github.com/repos/poparteu/openMVG/deployments","created_at":"2014-12-30T15:39:27Z","updated_at":"2016-01-28T19:18:10Z","pushed_at":"2016-07-01T19:51:06Z","git_url":"git://github.com/poparteu/openMVG.git","ssh_url":"git@github.com:poparteu/openMVG.git","clone_url":"https://github.com/poparteu/openMVG.git","svn_url":"https://github.com/poparteu/openMVG","homepage":"","size":23246,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":46,"forks":1,"open_issues":46,"watchers":1,"default_branch":"popart_develop"}},"_links":{"self":{"href":"https://api.github.com/repos/poparteu/openMVG/pulls/174"},"html":{"href":"https://github.com/poparteu/openMVG/pull/174"},"issue":{"href":"https://api.github.com/repos/poparteu/openMVG/issues/174"},"comments":{"href":"https://api.github.com/repos/poparteu/openMVG/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/poparteu/openMVG/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/poparteu/openMVG/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/poparteu/openMVG/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/poparteu/openMVG/statuses/4d7f7c1778be7a96191e951adf50dafa04cac0cb"}}}}
{"actor":{"display_login":"zvrba"}}