It's currently not respecting the material color, probably since the
BMesh merge. There are a couple problems, both involving "dummy"
variables taking the place of actual MTFace/MCol data.
Code review: http://codereview.appspot.com/5753050/
Now create the rotate edge in advance and copy its customdata (before joining the faces).
This commit also fixes an annoyance where tryangulating faces could create duplicate edges.
Issue was caused by incorrect resetting of tesselated fave data in copy_mesh:
- CustomData_free will free data from original mesh because layers in new mesh
are pointing to the same memory just after copy. So it's needed only to
set some pointers to NULL.
- It was incorrect filling fdata with zeroes because of incorrect structure size used.
Seems that issue is caused by several threads accessing to movie clip and one
of the threads (compositor node) was editing ImBuf which isn't nice anyway.
Made Set Floor a bit more general and name it Set Plane which defines
orientation from 3 selected tracks and makes them belong to specified
plane (wall or floor).
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
if blender freed the BMesh before python was finished (on exit editmode for eg), python would attempt to access the bmesh to clear python pointers in it.
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
* dont check selection and hiddent state (select + hide isnt allowed and api ensures this)
* MESH_OT_noise had incorrect check for texture (checked if slot [0] was filled but then used active texture)
In fact, the same bug affected curves' weights too. Now using the same method as for setting mesh edges' crease and bevel weights. Also factorized/simplified that part of code by defining a new utility func computing the scale factor.
Also greatly simplified UI code in same v3d_editvertex_buts() function, was really over-complicated (this fixes btw a few minor UI bugs in the transform editmode panel, like missing tips, etc.).
* double default edge allocation size (double the number of verts/faces).
* CustomData_bmesh_init_pool was using allocsize & chunksize as the same variable. Now use type specific chunk size.
* bmesh copy and editmode conversion now allocate the BMesh mempool size needed for the entire vert/edge/loop/face arrays since its known already.
* name bmesh operator func's BMO_slot_buffer_* rather then BMO_slot_* since it wasnt obvious some only dealt with buffer, some both.
* more typechecks and asserts of BMO_ functions (I lost some time calling a map with a buffer function that failed silently).
* small speedup for extrude check - test if the edge is wire _before_ doign a hash lookup.
Extruding an edge where both verts were clipped would not create a face for this edge.
This is ok when a connected face is also extruded but not when the edge is selected on its own.
* add extra argument to BMO_slot_map_to_flag() to filter by vert/edge/face
* made BMO_slot_map_* / BMO_slot_buffer_* functions stricter with type checking.
* Moved format field and added (deprecated) sfra and efra ints to ensure some forward compatibility of file output node. Earlier blender versions will simple interpret the struct as NodeFileImage, so by matching the first fields the numbers can stay somewhat valid.
1) Old CMP_NODE_OUTPUT_FILE and CMP_NODE_OUTPUT_MULTI_FILE have been merged,
only CMP_NODE_OUTPUT_FILE remains. All functions renamed accordingly.
2) do_versions code for converting single-file output nodes into multi-file
output nodes. If a Z buffer input is used, the node is made into a multilayer
exr with two inputs. (see below). Also re-identifies multi-file output nodes
with the CMP_NODE_OUTPUT_FILE type.
3) "Global" format is stored in node now. By default this overrides any
per-socket settings.
4) Multilayer EXR output implemented. When M.EXR format is selected for node
format, all socket format details are ignored. Socket names are used for layer
names.
5) Input buffer types are used as-is when possible, i.e. stored as B/W, RGB or
RGBA. In regular file output the format dictates the number of actual channels,
so the CompBuf is typechecked to the right type first. For multilayer EXR the
number of channels is more flexible, so an input buffer will store only the
channels it actually uses.
6) The editor socket type is updated from linked sockets as an indicator of the
actual data written to files. This may not be totally accurate for regular file
output though, due to restrictions of format setting.
Issue was caused by fix for slide+automerge bug resulted in accessing to freed memory
from multires projection code. Solved by moving multires projection from cleanup callback
to special_aftertrans_update.
Patch by Antony Riakiotakis with some own corrections.
- Pinch/Magnify brush isn't available from vertex paint mode anymore.
- Switch default texture to Low Quality bump method
The same method is used for new textures and it makes possible to
view bump in 3D viewport with GLSL shading.
- Anisotropic filtering is set to 2x by default.
added some missing functions too - which are not used yep but should be there for api completeness.
* CDDM_set_mloop
* CDDM_set_mpoly
* BLI_mempool_count
Looks like it was missed BMesh element index for faces in emDM_drawMappedFacesMat.
There was already call of BM_mesh_elem_index_ensure to ensure there's element
index for vertices, added flag to ensure there's also index for faces.
time, sorry), from delete to backspace. Delete did not work on buttons in nodes,
because it would delete the node itself or if we changed the priority interfere
with deleting nodes if the cursor was placed accidentally over a button in a node.
Patch by Damir Prebeg.
Split proxy build operator into three parts:
- Prepare context (IMB_anim_index_rebuild_context) which prepares all
needed data and stores it in an anonymous structure used by specific
builder lately.
- Build proxies/timecodes into temporary files (IMB_anim_index_rebuild)
This function will build all selected proxies/timecodes into a temporary
files so old proxies will be still available during building.
- Finish building proxies (IMB_anim_index_rebuild_finish) which copies
temporary files over old proxies filed and releases all resources used
by a context.
Context creation and finishing building happens in a main thread so
it's easy and safe to close all opened handles of proxies files and
refresh cache after rebuilding is finished.
This should finally fix#30315: Temporary proxy files are not erased and old proxys are not updated if the proxy is built more then once (windows)
when making a quad from 2 edges - it was comparing the edge lengths to avoid making a bowtie quad. but this doesnt work in all cases, now compare normals instead.
the problem was a triangle couldnt be made when there was a quad that used 3 of the verts.
* now check if overlapping face has same length as the one to be created.
* an unrelated fix - the output of a triangle was not being flagged by the bmesh_contextual_create operator.
When set to solid-shading, GPU_update_grid_buffers was calling
normal_quad_v3 to output into a mapped buffer, but normal_quad_v3
reads as well as writes.
This fix actually makes a huge performance difference with my drivers
(Gallium/Radeon).
For the preview-icon search menu (used for example in brush
selection), clip the text so that long names don't flow out into the
space between columns.
There are a number of features that use a kind of "internal linking" in nodes:
1. muting
2. delete + reconnect (restore link to/from node after delete)
3. the new detach operator (same as 2, but don't delete the node)
The desired behavior in all cases is the same: find a sensible mapping of inputs-to-outputs of a node. In the case of muting these links are displayed in red on the node itself. For the other operators they are used to relink connections, such that one gets the best possible ongoing link between previous up- and downstream nodes.
Muting previously used a complicated callback system to ensure consistent behavior in the editor as well as execution in compositor, shader cpu/gpu and texture nodes. This has been greatly simplified by moving the muting step into the node tree localization functions. Any muted node is now bypassed using the generalized nodeInternalRelink function and then removed from the local tree. This way the internal execution system doesn't have to deal with muted nodes at all, as if they are non-existent.
The same function is also used by the delete_reconnect and the new links_detach operators (which work directly in the editor node tree). Detaching nodes is currently keymapped as a translation variant (macro operator): pressing ALTKEY + moving node first detaches and then continues with regular transform operator. The default key is ALT+DKEY though, instead ALT+GKEY, since the latter is already used for the ungroup operator.
* made bmesh_structure.h function names more consistant.
* remove unused code in bmesh_structure.c
* removed 'Edge Flip' operator (missing from bmesh but looked into trunk feature and dont think its worth keeping).
* tagged some BMESH_TODO's
so registering them seems to be kind of useless because things like deleting
edge loops with Shift-R command is impossible.
This commit will resolve issue #30375: Loop Select should not become a Redo History Item.
On a place, Ctrl+T, Fkey would create a quad overlapping the 2 Tris.
Now this case is checked for in a general way - if the bounds of the face are already filled in with faces (that _only_ use these edges-verts), then dont create the face.
This is an option for the 'edgenet_fill' operator, since creating the face isnt incorrect, just not-what-you-want mostly.
added functions
* BM_edge_share_vert - returns shared vert between 2 edges.
* BM_face_exists_multi, BM_face_exists_multi_edge - check if existing faces fill the edge bounds.
* also add BM_ELEM_INTERNAL_TAG so low level functions can tag without conflicting with higher level functions that also rely on tagging elements.
rather then recalc polygon normals - solidify is simple enough to just flip the normals of the copied faces, the rim faces normals are already re-calculated so copy them.
Don't really know why, but appears we need to recalc normals when this option is ON.
Also small perf improvement (avoid to compute twice each face normals).
- If track was hidded in clip editor it wasn't highlighted in 3d viewport
even if it's selected.
- If two tracks has got the same bundle coordinate and one of them is
selected it might not be highlighted in 3d viewport because of
draw order.
This way. IMHO is more useful since it means you can simplify the geometry between faces without joining them and it distinguishes vertex dissolve more from edge dissolve - which will join both faces still.
Previously the function took 'invert' and 'add' parameters to indicate
what operation should be performed on the displacements, replaced
these with three named modes: APPLY_DISPLACEMENTS, CALC_DISPLACEMENTS,
and ADD_DISPLACEMENTS.
now collapse the vertex into the edges.
also disable removing the vertrex when it could not be collapsed (old code), found it could would connected faces which isn't acceptable - now return fail in that case.
* better type safety for BM_elem_flag_* and BM_elem_index_* functions.
* add BMElem type to be used where BMFace/Edge/Vert/Loop can be interchanged.
* fix bug in select manifold, found when making functions more strict.
* change BMO_elem_flag_* defines to inline functions.
* BMO_slot_map_insert() is too big for an inline function - un-inline it.
* remove redundant casts.
* added BM_elem_flag_set, BMO_elem_flag_set. to avoid 'if(...) enable(); else disable();' all over the place.
* added bmesh_operator_api_inline.c, the header file was getting messy.
Disabled double-side lighting by default and changed areas which are using
double sided lighting to switch it off just after doing stuff which requires
double side.
This makes code a bit more simple to follow (no all that disabling double side
lighting all over the code and so).
This change also fixes crash of blender caused by intel gme965 driver which
leads to stack corruption in some place when double side lighting isn't
disabled (probably driver still kind of using double side in some areas or so).
Hopefully it'll also fix#30293: Converting Text to Mesh
Thanks to Campbell to assist writing this patch!