{"action":"created","issue":{"url":"https://api.github.com/repos/mikedh/trimesh/issues/187","repository_url":"https://api.github.com/repos/mikedh/trimesh","labels_url":"https://api.github.com/repos/mikedh/trimesh/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/mikedh/trimesh/issues/187/comments","events_url":"https://api.github.com/repos/mikedh/trimesh/issues/187/events","html_url":"https://github.com/mikedh/trimesh/issues/187","id":337401599,"node_id":"MDU6SXNzdWUzMzc0MDE1OTk=","number":187,"title":"Saved .PLY does not have color","user":{"login":"hzhcongo","id":32129703,"node_id":"MDQ6VXNlcjMyMTI5NzAz","avatar_url":"https://avatars0.githubusercontent.com/u/32129703?v=4","gravatar_id":"","url":"https://api.github.com/users/hzhcongo","html_url":"https://github.com/hzhcongo","followers_url":"https://api.github.com/users/hzhcongo/followers","following_url":"https://api.github.com/users/hzhcongo/following{/other_user}","gists_url":"https://api.github.com/users/hzhcongo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzhcongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzhcongo/subscriptions","organizations_url":"https://api.github.com/users/hzhcongo/orgs","repos_url":"https://api.github.com/users/hzhcongo/repos","events_url":"https://api.github.com/users/hzhcongo/events{/privacy}","received_events_url":"https://api.github.com/users/hzhcongo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-02T07:36:05Z","updated_at":"2018-07-03T07:19:13Z","closed_at":null,"author_association":"NONE","body":"Hi, I am trying to save a the largest mesh from a .PLY object after splitting it up (_meshes = mesh.split(only_watertight = False_)\r\n\r\nHowever, it does not save the vertex colors somehow.\r\n\r\nI understand that a similar thread has been opened and closed at: #160 , but even when I export the .PLY into ascii and opened with WordPad, the header is missing RGB properties (as shown):\r\n\r\n_ply\r\nformat ascii 1.0\r\ncomment github.com/mikedh/trimesh\r\nelement vertex 216572\r\nproperty float x\r\nproperty float y\r\nproperty float z\r\nproperty float nx\r\nproperty float ny\r\nproperty float nz\r\nelement face 431895\r\nproperty list uchar int vertex_indices\r\nend_header_\r\n\r\nThis is my initial .PLY header:\r\n_ply\r\nformat ascii 1.0\r\nelement vertex 216656\r\nproperty float x\r\nproperty float y\r\nproperty float z\r\nproperty float value\r\nproperty uchar red\r\nproperty uchar green\r\nproperty uchar blue\r\nelement face 432043\r\nproperty list uchar int vertex_indices\r\nend_header_\r\n\r\nTrying to export as .STL also results in missing colors. \r\nI have tried different exports (pardon my poor programming as I am just starting out in Python):\r\n_trimesh.Trimesh.export(meshes[largestMeshIndex], 'result.ply', 'ply')\r\ntrimesh.Trimesh.export(meshes[largestMeshIndex], 'result.stl', 'stl_ascii')_\r\n\r\nI tried manually generate the data before storing them into .PLY files, but to no avail too:\r\n_result = trimesh.io.ply.export_ply(meshes[largestMeshIndex], encoding='ascii', vertex_normal=None)\r\nresult = trimesh.io.ply.export_ply(meshes[largestMeshIndex], encoding='ascii', vertex_normal=True)_\r\n\r\nAny help would be greatly appreciated!\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/mikedh/trimesh/issues/comments/402037870","html_url":"https://github.com/mikedh/trimesh/issues/187#issuecomment-402037870","issue_url":"https://api.github.com/repos/mikedh/trimesh/issues/187","id":402037870,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjAzNzg3MA==","user":{"login":"hzhcongo","id":32129703,"node_id":"MDQ6VXNlcjMyMTI5NzAz","avatar_url":"https://avatars0.githubusercontent.com/u/32129703?v=4","gravatar_id":"","url":"https://api.github.com/users/hzhcongo","html_url":"https://github.com/hzhcongo","followers_url":"https://api.github.com/users/hzhcongo/followers","following_url":"https://api.github.com/users/hzhcongo/following{/other_user}","gists_url":"https://api.github.com/users/hzhcongo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzhcongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzhcongo/subscriptions","organizations_url":"https://api.github.com/users/hzhcongo/orgs","repos_url":"https://api.github.com/users/hzhcongo/repos","events_url":"https://api.github.com/users/hzhcongo/events{/privacy}","received_events_url":"https://api.github.com/users/hzhcongo/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T07:19:13Z","updated_at":"2018-07-03T07:19:13Z","author_association":"NONE","body":"I see,\r\n\r\nI tried _.export()_, and a binary .ply was generated with the following headers:\r\nply\r\nformat binary_little_endian 1.0\r\ncomment github.com/mikedh/trimesh\r\nelement vertex 216572\r\nproperty float x\r\nproperty float y\r\nproperty float z\r\nelement face 431895\r\nproperty list uchar int vertex_indices\r\nproperty uchar red\r\nproperty uchar green\r\nproperty uchar blue\r\nproperty uchar alpha\r\nend_header\r\n\r\nBut it still doesn't show any colors when the headers have the color properties.\r\n\r\n_mesh.visual.kind_ is vertex\r\n_meshes[largestMeshIndex].visual.kind_ is face\r\n\r\nIs this the cause for the missing colors?"}}
{"actor":{"display_login":"hzhcongo"}}