Previously, the shading and material was set once per PBVHNode when
drawing. This is still the case, but PBVHNodes are now built to
contain only one material and shading mode.
This is done with an extra partitioning step; once the number of
primitives in the node falls below the PBVH leaf limit, it's
primitives are checked for matching materials. If more than one
material or shading mode is present in the node, it is split and
partitioned (partitioned by material rather than 3D location.)
Given a sufficiently 'annoying' input, like a dense mesh with
thousands of materials randomly scattered across it, this could
greatly increase PBVH build time (since nodes might end up containing
a single primitive), but in general this shouldn't come up.
In order to support materials for grids, the CCGDM is building another
grid array (of DMFaceMat structs). This could be used to replace
CCGDM.faceFlag for some small memory savings (TODO).
Previously this was just a character array that stored face/poly flags
and mat_nr. Since mat_nr should be a short, this would have truncated
for higher values.
Replaced with a new DMFaceFlags struct.
This option might be useful in some cases like keeping UV coordinated in kind of
"correct" state so sliding edge loop will also slide edges in UV. But for other
layers like shapekeys and vertex colors it's arguable it's actually needed.
The way it's currently done isn't actually acceptable because it doesn't take
flags like UVCALC_TRANSFORM_CORRECT into account and also makes extra unwanted
things like interpolating shapekeys which leads to propagating changes into
basis keys and also results with slide applied twice for relative keys because
offset is also applying on loading edit mesh.
Also discussed with Brecht who agreed with marking this things as TODO and
disabling for now.
This should fix issue reported in #30387: Edge Slide propogates to Basis Shape Key
[#30454] perspective_matrix not update in real time with bpy.ops.view3d.zoom
This is so you can modifify the view settings and get the view matrix after without waiting for a redraw.
mesh.calc_normals() wasnt calculating vertex normals (only face normals),
now only calculate vertex normals.
added a define incase we want to have poly normals back again.
On a user level, edge rotate now works better with multiple edges selected, it wont make zero area faces or rotate edges into existing ones.
With a single edge selected - rotate is less strict and will allow ugly resulting faces but still checks on duplicate edges.
API:
* BM_edge_rotate now takes a flag, to optionally...
** check for existing edge
** splice edge (rotate and merge)
** check for degenerate resulting faces (overlapping geometry, zero area)
** beauty - only rotate to a better fit.
... this allows it to still be used as a low level API function since all checks can be skipped.
* BM_edge_rotate() now works a bit different, it find the new edge rotation before joining the faces - exposed by BM_edge_rotate_calc().
* Added api call bmesh_radial_faceloop_find_vert() - Radial Find a Vertex Loop in Face
* optimize BM_face_other_edge_loop to do about half as many iterations for quad heavy meshes, with ngons the gain is much more since searching around the entire ngon when the edge already stores its loop is silly.
... also nicer in cases where edge has no face users it avoids a loop on all face corners.
Do not crash when joint SIDs cannot be resolved.
OpenCOLLADA cannot resolve joint SIDs connected to skin if the <skeleton> tag is missing.
Page 148 of COLLADA spec 1.4.1 states: "<skeleton> elements define where to start the sid lookup". So I think this is a bug in "FBX COLLADA exporter" which did not add the <skeleton> tag.
The problem can be fixed by manually adding the <skeleton> tag into <instance_controller>.
we cant ensure buildinfo to have utf8 encoding so access it as bytes via python - a different workaround then this patch made.
also use C style string formatting for sys_info.py
* calculate vertex normals (previously was calculating face normals only)
* clear tessfaces unless theres an argument to build them. since no tessfaces is the default state right now.
* if convert_mfaces_to_mpolys() runs, dont calculate edges, since it already does that.
* add BLI_rfindlink for reverse index lookup (used so bm.select_history[-1] doesn't have to loop the entire list twice).
* add bm.select_history.active so you can get the last selected item or None without having to check seq length.
In fact, most "UI special cases" are not well translated, currently. :/ This affects especially the "Properties" panels. This commit should address problems in Graph editors, and 3D View (but probably not yet all of them). Yet it already adds more than 100 new messages (and fixes translated drawing of more).
Also done some style edits…
* improve check to see if edge rotate can be done,
was checking if both edges verts have an edge count of 2, which is really a meaningless test since the verts can have stray edges connected and the result wont work right.
instead check if the next verts in both faces share a vertex.
* add utility function BM_face_other_vert_loop() which gets the next loop in a face.
* add convenience function BM_edge_face_pair() which returns 2 faces for edges that have exactly 2 face users. (saves ugly e->l->radial_next ... in code) and is more readable.
Also adds DampedTrackTo to the list of supported constraints in the BGE
Test file:
http://www.pasteall.org/blend/11715
Patch developed as part of a project to NF-UBC Nereus Program.
Development time 'sponsored' by the project.
www.nereusprogram.org