Blender Git Commits
June 13, 2016, 10:36 (GMT) |
Merge branch 'master' into custom-normals-bmesh |
June 9, 2016, 15:52 (GMT) |
Minor docstring formatting edit |
June 9, 2016, 15:46 (GMT) |
Use mathutils_array_parse instead of inline array parsing Also fixes decref bug when None was given. |
June 9, 2016, 15:24 (GMT) |
More minor changes: - replace PyTuple_Pack with PyTuple_SET_ITEMS (avoids using varargs, and instead assign values directly). - rename nbr_val -> value_len (consistent with value, value_items). |
June 9, 2016, 15:20 (GMT) |
Cleanup: whitespace |
June 9, 2016, 15:16 (GMT) |
Use PySequence_Fast_ITEMS for direct access |
June 9, 2016, 13:45 (GMT) |
Merge branch 'master' into custom-normals-bmesh |
June 8, 2016, 15:23 (GMT) |
BMesh clnor: Change py API. After some talking with Campbell, this is now accessible through BMesh's CustomData system: - clnor data is now exposed in BMesh (same way as for UVs etc.). - You can now get/set **raw** values (pair of factors) of each loop independently. This is not so useful in itself (though it allows nice 'relative' normal edition, given what those two factors represent), getting/setting 'real' normals there is for later. - You can now set all custom normals at once using the new 'from_array' method of BMLayerItem. This is supposed to be generic setter, but for now it's only implemented for clnor data. Some notes/reflections, also for future developments: - About from_array: * Do we accept that rather 'flexible' way of handling given array of data? think we do not have much choice if we want to keep generic BMLayerItem (else we'll have to define sub-classes of this for every type of data :/ ). * Currently clnor's from_array returns values actually set as a new array, not sure we want to keep this, or instead add another 'to_array' method (in this case, how do we control type of returned data?). - About clnors in BMesh in general: * Think ultimately we'll want to have own struct of clnors in BMesh, caching clnor spaces, encoded normal, real normal, etc. * We'll then need to add lots of stuff to handle edition, in particular a system to rebuild clnor spaces of affected loops each time we add/remove/modify geometry... Latest point is important, since it means current BMesh py API will **not** be stable for now, and will most certainly break when full support of custom normals is added to BMesh. |
June 8, 2016, 10:34 (GMT) |
Merge branch 'master' into custom-normals-bmesh |
June 7, 2016, 19:55 (GMT) |
Initial work to allow custom normals setting in BMesh, with quick bmesh py API call too. Seems to be working OK from quick tests... Some notes: - This is mimicking BKE_mesh_evaluate code. While this is OK for some cases, we'll likely want some more integrated and fine-grained ways to set/edit those normals in Edit mode once we create real editing tools for those (most likely based on some BMesh operators). This implies some kind of dynamic caching/update of clnors spaces though, which is not trivial. So kept for later, for now you have to set all custom normals at once. - Not sure where/how to expose this in py API, for now just added a func in bmesh.utils. |