[#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!
* BMFace.copy_from_face_interp(face)
* BMLoop.copy_from_face_interp(face, vert=True, multires=True)
These are important for rebuilding geometry from existing faces without loosing UV's, vcols etc.
* ntreeCompositExecTree accessed 'ntree' before NULL check.
* BM_face_triangulate accessed 'f' before NULL check.
also quiet warning in BKE_text_to_curve() and add a check for BMesh bridge loops so it knows quicker if it can copy loop data or not.
Since FFmpeg 0.10 release FFV1 codec supports alpha channel which is getting
enabled when using PIX_FMT_RGB32 pixel format. This leads to incompatibility of
videos rendered in Blender with almost all external players (especially in OSX).
Seems that PIX_FMT_BGR0 is recommended to be used to make videos compatible with
older players which doesn't support alpha channel in FFV1.
Also added an option to switch to RGBA rendering if FFV1 codec is used and if RGBA
rendering is used FFV1 will be using PIX_FMT_RGB32 format which supports alpha channel.
* remove 'select' and 'hide' from BMLoop
* remove BMesh.update
* add BMesh.normal_update(skip_hidden=False)
* add BMElemSet.index_update(), eg: bm.verts.index_update()
bmesh api
* BM_mesh_normals_update() now takes skip_hidden as an argument
(previously this was default behavior), however this isnt good when
using BMesh modifiers, where you want all normals to be recalculated.
* add bm_iter_itype_htype_map[], to get the iter type from a BMesh
iterator.
not pick the right object. This operator had two properties "object" and
"type", but the latter was used while the former had the right description.
Now changed it to have only an "object" property, so that the above code works.
In fact, Graph View wasn't been supposed to be opened in Clip show editor mode.
Made curves view unavailable from Clip view mode and store it's alignment in
a runtime flag in SpaceClip structure.
bmesh.utils.face_join(faces)
added a utility function for converting a list of python BMesh elements into a C array.
use for this face_join as well as BMesh.faces.new()
Seems that after converting tessfaces into faces normals should be re-calculated.
At least that's what happening in some other modifiers and what makes boolean
work fine with smooth normals.
Two issues are fixed here:
- On windows rename() doesn't actually renames file if destination file is already exist.
Solved by ulinking previously built proxy/timecode.
- IMB_TC_MAX_SLOT was set to incorrect value leading to record run timecode calculating
several times.
Compilation error was mostly caused by trying to use namespace std before it was
actually defined (e.g. before any include of stl header).
It's not actually good idea to use namespaces in header files -- it's really easy to
run into namespace conflicts and so. Resolved by not using "using namespace" in header
files and using full quality accessing to stl collections (e.g. std::vector).
* BM_vert_in_face now loops over a vert's faces rather then every vert in the face.
* rename bmesh_radial_find_first_facevert --> bmesh_radial_find_first_faceloop
* rename bmesh_radial_find_next_facevert --> bmesh_radial_find_next_faceloop
* rename BM_vert_collapse_edges --> BM_vert_collapse_edge (only collapses one)
* bmesh.types, just allows access to BMVert, BMEdge etc.
* bmesh.utils, so far only added edge_split() function, this module will give access to mesh editing functions.
The implementation was also changed in a couple ways: use unsigned
integers as its base type rather than unsigned chars, and uses macros
rather than functions. (These could be changed to inline functions.)
Currently it is still only used during PBVH building, but now it's
accessible elsewhere.
At the point where GPU_build_mesh_buffers is called, the
face_vert_indices map has already been built; it contains the same
data in an easier-to-access format.
Now constraints' space conversion code also uses generic armature_mat_(pose_to_bone/bone_to_pose). Previous own function (constraint_pchan_diff_mat) was somewhat inconsistent too with Hinge/NoScale/LocalLocation options...
As with previous similar changes, this might break some old rigs, in very specific cases (when constraint-evaluating an hinge/noscale/local_location bone in local space).
In the same part of code, removed unnecessary matrices copying, mult_m4_m4m4 can take the same matrix as input and output, nowadays...
Also found a bug-generator weakness in those armature_mat_ functions (if both input and output mat where the same, result was wrong, now systematically copying input mat, as done in LIB's matrix funcs).
Finally, factorized offset bone matrix generation into its own small function too, as it is used in two different places in armature.c (pchan_to_pose_mat itself, and restpose's where_is_armature_bone).
Note: I think all parts of blender's code related to that topic have now been tackled, but yet have to check BGE, it’s probably using that stuff too, one way or the other...
* Only have 1 python object per bmesh, vertex, edge, loop, face.
* Store pointers back to the python data in a custom data layer so as not to use more memory for normal editing operations (when pythons not running).
* Currently this data is created and freed along with the BMesh PyObject.
* Incidentally - this fixes comparisons for bmesh elements which wasnt working before.
* Ctrl+Click extrude wasnt normalizing the quaternion (was printing warnings)
* bmesh bevel was supposed to add a float layer and remove, but removing passed the mask define of the customdata layer.