{"action":"created","issue":{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/136","labels_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/136/comments","events_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/136/events","html_url":"https://github.com/bsavery/PRMan-for-Blender/issues/136","id":106219139,"number":136,"title":"Object motion missing from parented objects when parent is animated.","user":{"login":"fjuhec","id":4067896,"avatar_url":"https://avatars.githubusercontent.com/u/4067896?v=3","gravatar_id":"","url":"https://api.github.com/users/fjuhec","html_url":"https://github.com/fjuhec","followers_url":"https://api.github.com/users/fjuhec/followers","following_url":"https://api.github.com/users/fjuhec/following{/other_user}","gists_url":"https://api.github.com/users/fjuhec/gists{/gist_id}","starred_url":"https://api.github.com/users/fjuhec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjuhec/subscriptions","organizations_url":"https://api.github.com/users/fjuhec/orgs","repos_url":"https://api.github.com/users/fjuhec/repos","events_url":"https://api.github.com/users/fjuhec/events{/privacy}","received_events_url":"https://api.github.com/users/fjuhec/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-13T14:10:51Z","updated_at":"2015-09-18T17:46:51Z","closed_at":"2015-09-18T17:30:48Z","body":"Hi,\r\n\r\nFirst, thank you for a great exporter. It has been a great help for me to continue work and add new features to the exporter I am coding for Mitsuba Renderer. Learned a lot from reading through your code.\r\n\r\nI have reused the code for getting animation data for motion blur and found out that objects with no animation but an animated parent where not having its motion exported.\r\n\r\nThe code on line 1504 of export.py\r\n```python\r\n    if ob.animation_data is not None or ob.constraints:\r\n        if ob.name not in motion['transformation'].keys():\r\n            motion['transformation'][ob.name] = []\r\n\r\n        if ob.parent:\r\n            mat = ob.parent.matrix_world * ob.matrix_local\r\n        else:\r\n            mat = ob.matrix_world\r\n\r\n        motion['transformation'][ob.name].append(mat.copy())\r\n```\r\n\r\nIs correctly using the parent matrix on parented objects but is missing a check to see if the parent is animated in case the parented object is not.\r\n\r\nThis modification fixes the issue for me:\r\n```python\r\n    if ob.animation_data is not None or ob.constraints or \\\r\n            (ob.parent and (ob.parent.animation_data is not None or ob.parent.constraints)):\r\n```\r\n\r\nTested also with Renderman exporter and fixed the issue.\r\nTo test the issue I am using the BMW benchmark scene in case you want to test.\r\nhttps://www.dropbox.com/s/ip1t0gqiu1bk5vr/BMW1M-MikePan.blend?dl=0\r\nYou can animate the car with the carController object and notice some objects stay behind because they have no animation but are parented to an animated object.\r\nThere is also an issue on this scene with rib files not being written for some dupli objects but have not investigated it.\r\n\r\nThanks,\r\nFrancesc"},"comment":{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/comments/141517908","html_url":"https://github.com/bsavery/PRMan-for-Blender/issues/136#issuecomment-141517908","issue_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/136","id":141517908,"user":{"login":"fjuhec","id":4067896,"avatar_url":"https://avatars.githubusercontent.com/u/4067896?v=3","gravatar_id":"","url":"https://api.github.com/users/fjuhec","html_url":"https://github.com/fjuhec","followers_url":"https://api.github.com/users/fjuhec/followers","following_url":"https://api.github.com/users/fjuhec/following{/other_user}","gists_url":"https://api.github.com/users/fjuhec/gists{/gist_id}","starred_url":"https://api.github.com/users/fjuhec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjuhec/subscriptions","organizations_url":"https://api.github.com/users/fjuhec/orgs","repos_url":"https://api.github.com/users/fjuhec/repos","events_url":"https://api.github.com/users/fjuhec/events{/privacy}","received_events_url":"https://api.github.com/users/fjuhec/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T17:46:51Z","updated_at":"2015-09-18T17:46:51Z","body":"Nice!\r\nThere is still some issue.\r\nWith the BMW scene, the wheels don't have motion blur.\r\n![bmw-blur](https://cloud.githubusercontent.com/assets/4067896/9966559/d4d05064-5e3d-11e5-89d5-b952e58e8839.jpg)\r\n"}}