{"action":"created","issue":{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/83","labels_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/83/comments","events_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/83/events","html_url":"https://github.com/bsavery/PRMan-for-Blender/issues/83","id":98659570,"number":83,"title":"Proposal for multi-material objects","user":{"login":"bsavery","id":1892220,"avatar_url":"https://avatars.githubusercontent.com/u/1892220?v=3","gravatar_id":"","url":"https://api.github.com/users/bsavery","html_url":"https://github.com/bsavery","followers_url":"https://api.github.com/users/bsavery/followers","following_url":"https://api.github.com/users/bsavery/following{/other_user}","gists_url":"https://api.github.com/users/bsavery/gists{/gist_id}","starred_url":"https://api.github.com/users/bsavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsavery/subscriptions","organizations_url":"https://api.github.com/users/bsavery/orgs","repos_url":"https://api.github.com/users/bsavery/repos","events_url":"https://api.github.com/users/bsavery/events{/privacy}","received_events_url":"https://api.github.com/users/bsavery/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":{"login":"bsavery","id":1892220,"avatar_url":"https://avatars.githubusercontent.com/u/1892220?v=3","gravatar_id":"","url":"https://api.github.com/users/bsavery","html_url":"https://github.com/bsavery","followers_url":"https://api.github.com/users/bsavery/followers","following_url":"https://api.github.com/users/bsavery/following{/other_user}","gists_url":"https://api.github.com/users/bsavery/gists{/gist_id}","starred_url":"https://api.github.com/users/bsavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsavery/subscriptions","organizations_url":"https://api.github.com/users/bsavery/orgs","repos_url":"https://api.github.com/users/bsavery/repos","events_url":"https://api.github.com/users/bsavery/events{/privacy}","received_events_url":"https://api.github.com/users/bsavery/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-08-03T02:42:25Z","updated_at":"2015-08-03T04:04:47Z","closed_at":null,"body":"So I've been working over how to create multi-material meshes when rib exporting.  Previously we were creating new meshes (1 per material) adding them to bpy.data exporting, then emitting each rib separately with the corresponding material.  Ok fine, this worked, however it split up meshes, which I claim may have issue on subdiv meshes.  Also seemed to have issues with UV, as well as scene updates which were slow on big scenes.\r\n\r\nI have a proposal that seems to work with only ONE (biggish) downside.  It won't support emissive geometry on multi-materials, yet.\r\n\r\nHere's the trick.  Just emit the geometry as for a normal object, emit a per face material id primvar.\r\nEmit all the Bxdfs/materials for the geometry, then use the PxrBxdfBlend (keying the mask parameter off the material id primvar) to switch between the Bxdfs.  \r\n\r\nI could probably even write a light shader .sl to do the same thing fairly easily as well to make it support multiple materials objects that also have emmissivity in them.  But for now we could give the caveat to not use emmisive multi-material Objects.  \r\n\r\nThoughts?   "},"comment":{"url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/comments/127116258","html_url":"https://github.com/bsavery/PRMan-for-Blender/issues/83#issuecomment-127116258","issue_url":"https://api.github.com/repos/bsavery/PRMan-for-Blender/issues/83","id":127116258,"user":{"login":"MWY3510","id":9410101,"avatar_url":"https://avatars.githubusercontent.com/u/9410101?v=3","gravatar_id":"","url":"https://api.github.com/users/MWY3510","html_url":"https://github.com/MWY3510","followers_url":"https://api.github.com/users/MWY3510/followers","following_url":"https://api.github.com/users/MWY3510/following{/other_user}","gists_url":"https://api.github.com/users/MWY3510/gists{/gist_id}","starred_url":"https://api.github.com/users/MWY3510/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MWY3510/subscriptions","organizations_url":"https://api.github.com/users/MWY3510/orgs","repos_url":"https://api.github.com/users/MWY3510/repos","events_url":"https://api.github.com/users/MWY3510/events{/privacy}","received_events_url":"https://api.github.com/users/MWY3510/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T04:04:47Z","updated_at":"2015-08-03T04:04:47Z","body":"I like this idea. It is unfortunate that there is a downside, but if there has to be one that is ok. Great job Brian!"}}