Commit Graph

30772 Commits

Author SHA1 Message Date
Nicholas Bishop
0c91821364 Add new CCG accessor functions.
ccg_gridsize() converts a level into gridsize, ccg_factor() is for
converting coordinates between different multires levels.
2012-03-14 06:31:24 +00:00
Nicholas Bishop
7f2acc173e Add BKE mesh function to update edge/poly hidden flags from verts. 2012-03-14 06:31:14 +00:00
Nicholas Bishop
38d4848020 Don't wait for sculpt stroke to create PBVH.
This idea is borrowed from the multires modifier, which already
checked if the object was in sculpt mode and, if so, created the
PBVH. That check is now moved higher up the chain into
mesh_build_data(), so that it occurs for CDDerivedMesh too.

This also replaces an assert in cdDM_getPBVH for tesselated mesh faces
with a call to create them if missing.
2012-03-14 06:30:55 +00:00
Campbell Barton
ee9a00948b mathutils py api:
Vector.angle_signed(other)
  for 2D vectors to get the clockwise angle between them.

  in BLI math its called - angle_signed_v2v2()

shorthand for...

  atan2f((v1[1] * v2[0]) - (v1[0] * v2[1]), dot_v2v2(v1, v2))

also corrects compile error in last commit.
2012-03-14 06:14:15 +00:00
Campbell Barton
f15c15e992 bmesh py api: finished todo - editable select_history
eg:
  bm.select_history = vert, face, edge

  bm.select_history.add(edge)
2012-03-14 04:46:12 +00:00
Nicholas Bishop
99f72dfbfc Add 'level' field to struct MDisps, companion to 'totdisp'.
Gets initialized when loading old files and updated at the same places
totdisp is updated. Saves having to do log+sqrt to extract level from
totdisp.
2012-03-14 03:10:18 +00:00
Campbell Barton
f80fa54428 documentation edit to address bmesh py api bug [#30453]
warn when addons are not found when running cmake.
2012-03-14 00:30:20 +00:00
Campbell Barton
a64ee8433a fix [#30493] GE crashes on exit because of using freed mtfaces from tessfaces
prevent gpu_draw.c holding a pointer to a freed array.
2012-03-13 23:28:02 +00:00
Campbell Barton
01b3e9cc9f loopwalker support for selecting the sides of ngons
see: wiki.blender.org/uploads/d/dc/BMesh_NGon_Loop_Select.png
2012-03-13 18:37:31 +00:00
Campbell Barton
b47e2ee907 code/style cleanup for loop walker which was is fairly confusing and hard to extend.
- only have one return at the end of the function.
- break up functionality more clearly between wire/face walk.
- remove unused struct member.
2012-03-13 17:13:44 +00:00
Campbell Barton
1581816d54 patch [#30511] from r44792, broke setting the window state from the command line (-W / -w).
Fix this by storing if the border is set - before this was only done for the window dimensions.
also move these variables into a static struct so this logic is easier to follow.
2012-03-13 15:44:48 +00:00
Sergey Sharybin
f34c3580ac Fix possible usage of NULL function reported by clang 2012-03-13 10:31:42 +00:00
Campbell Barton
2fbb5ce833 bmesh py api: more comprehensive intro page, also fix some spelling errors. 2012-03-13 06:22:43 +00:00
Campbell Barton
a69585573e bmesh python api:
BMesh.select_history.remove/clear/validate functions.
2012-03-13 02:59:42 +00:00
Campbell Barton
d25dc3b872 bmesh: Pressing Fkey when a face cant be made falls back to the selection history and creates edges in the order of verts selected, pressing F again will make an NGon.
(fun feature while our bug tracker is down)
2012-03-13 02:18:46 +00:00
Campbell Barton
a97825dfd7 stule cleanup for rct.c and fix for error in last commit. 2012-03-13 01:55:25 +00:00
Campbell Barton
8646bb4464 workaround [#30480] Knife tool flicker
the problem was numeric precision when in ortho mode the start/end points for the view vector would be 2000 apart which caused trouble for the intersection test.
2012-03-13 01:11:08 +00:00
Campbell Barton
b457c7fdbd style cleanup 2012-03-12 23:56:11 +00:00
Nicholas Bishop
caac81d75f Code cleanup: use explicit PBVH type enum rather than checking for grids or faces.
No functional changes, this is just a bit easier to read I think (and
nicer if we add more PBVH types in the future, e.g. for dynamic
topology sculpting.)
2012-03-12 23:03:43 +00:00
Nicholas Bishop
dfc9a57b3e Code cleanup: replace multires update function pointer with direct call.
Renamed the multiresModifier_update() function to
multires_modifier_update_mdisps() and made it visible to subsurf_ccg.c
so it can be called directly. No functional change, just a bit simpler.
2012-03-12 22:52:20 +00:00
Campbell Barton
07ffbbfcb6 better fix for [#30529], find the right axis rather then checking for folded quads. 2012-03-12 21:38:13 +00:00
Campbell Barton
30790e9390 fix [#30529] BMesh: Wrong Indizes of Faces
problem was bow-tie quads would add opposite normals together and result in zero vector which was used for projection.
Now is_quad_convex_v3() checks if quad contains 2 faces which point away from eachother when split by either direction.

Theres another fix for this bug which can be done since creating the face can use existing edges in the example given so it wont have to guess which order of verts to use.
2012-03-12 21:09:27 +00:00
Sergey Sharybin
e0a2e79f4d Fix #30406: Hooks ignore Automatic handles setting in curves
Update handles positions after applying modifiers which seems to be expected behavior.
The only currently unsolved issue is about updating aligned handles because this needs
to determine in which order handles need to be recalculated which currently depends on
selection flags and which is quite tricky to do when running modifiers and animation data,
so currently just not update their positions for now.
2012-03-12 14:55:56 +00:00
Lukas Toenne
d3e271c55a Fix for lasso gestures. After executing the modal gesture operator the list of gesture points is copied to the operator "path" id property, which is simply a collection of points. This list must be cleared before adding new lasso points to it, since operator properties are now stored after each execution. Noticed by Olivier Amrein (oenvoyage) on IRC. 2012-03-12 14:39:37 +00:00
Sergey Sharybin
a527e3ea25 Fix #30496: Bugs and crashes about "make links modifers" function.
Was missed check for if modifier is available for particular object type
which ended up with unpredictable results when modifier which isn't supported
yet for some object type as linked to that object type.
2012-03-12 14:35:07 +00:00
Howard Trickey
50af47a67f Code cleanup: knife gathers pos-related state into a struct. No functional change.
This is in preparation for bug fixing and cleanup related to tracking
of bmface and is_space state variables.  And makes it more likely
to avoid bugs in future where some part of state is copied but not all.
2012-03-12 12:45:55 +00:00
Brecht Van Lommel
b53cbb4e01 Fix #30512: external render saved render result after reporting error. 2012-03-12 11:32:23 +00:00
Howard Trickey
ca5fd21bb5 Make knifetool more robust against crashes. Fix some hole problems.
Sometimes split would fail to make a face - make sure it doesn't
crash if that happens.
Chain finding code for holes would sometimes go back to same
vertex on the face, which causes problems, so fixe that.
Also, disallowed a cut that starts at a vertex or edge and
cycles back to that same point in a face - this would make
a face with a repeated vertex, which may not be handled by
the rest of the system properly.
2012-03-12 11:27:59 +00:00
Bastien Montagne
30907594b6 Style cleanup in blenfont (spaces, C++ comments, etc.). 2012-03-12 09:22:16 +00:00
Bastien Montagne
51c553befb Removing SWAP macro define from BLI_heap.c, already present in BLI_utildefines.h, giving compile error. 2012-03-12 09:20:38 +00:00
Sergey Sharybin
e3df2697c3 Commit patch from Shane Ambler to make VideoTexture compile with a clang on FreeBSD.
Thanks!
2012-03-12 08:46:53 +00:00
Miika Hamalainen
ea56a54747 Fix msvc compilation errors. (__func__ undeclared) 2012-03-12 07:21:22 +00:00
Campbell Barton
aedd4af57e code cleanup/bugfix uninitialized values
- edgebisect bmesh operator used uninialized beauty field.
- BLI_join_dirfile could read from before the string bounds when passed an empty dir string.
- pransform could use an uninitialized projected coordinate (unlikely but possible)
- RNA_property_path_from_ID_check would compare against an uninitialized pointer when the path wasn't found.

also have bmesh walker use BM_edge_other_vert() utility function.
2012-03-12 06:53:47 +00:00
Campbell Barton
0873cbaed5 style cleanup: line length - some over 300 long. 2012-03-12 06:07:16 +00:00
Campbell Barton
7afeb21a41 text delimiter - convert to unicode before comparing characters. 2012-03-12 00:03:42 +00:00
Campbell Barton
cae11a98f9 style cleanup 2012-03-11 23:47:41 +00:00
Campbell Barton
ac24d98e24 bmesh: edge loop select
add support for loop selecting boundry edges only - handy for loop selecting the side of an ngon.
2012-03-11 21:47:14 +00:00
Antony Riakiotakis
33d8104716 Fix edge loop selection. Now boundary selection checks only for filled edges to determine when to stop and stops at vertices shared by only 2 edges. 2012-03-11 20:45:58 +00:00
Campbell Barton
b330abc290 remove Object member from BMesh struct - was only used for undo and BMEditMesh already stores an object pointer.
also fix for own mistake with mesh conversion refactor, shape key index was off by 1 when switching editmode.
2012-03-11 19:58:56 +00:00
Campbell Barton
c21c58f44c style cleanup, also remove unused externs. 2012-03-11 19:09:01 +00:00
Campbell Barton
65895a2a38 improve confusing macro GET_ACF_FLAG_PTR
- was operating on `type` which wasnt an argument to the macro.
- was calling return within the macro (makes code harder to follow).
2012-03-11 17:41:19 +00:00
Campbell Barton
178c2c32f2 [#30503] Callback for render job completion
from Jason van Gumster (thefallenweeble)

adds render_complete and render_cancel callbacks to bpy.app.handlers
2012-03-11 17:24:03 +00:00
Campbell Barton
19400d418d fix for debug assignment left in from own commit r44778
also removed private face normal update functions - they were same as public.
2012-03-11 15:27:08 +00:00
Campbell Barton
7fa7e4ba1f bmesh python api additions:
- BMesh.is_wrapped
- BMesh.copy()
- BMesh.clear()
- BMesh.free()
- BMesh.from_object(obj, apply_modifiers=True)
- BMEdge.calc_length()
- BMLoop.calc_normal()
- BMLoop.calc_tangent()
2012-03-11 05:58:22 +00:00
Campbell Barton
050439fd9d bmesh py api - correct class references in docs and rename mesh conversion funcs to ne less confusing. 2012-03-11 04:07:22 +00:00
Campbell Barton
21fd09c028 bmesh py api: change .from_mesh() / .to_mesh() to be class methods of BMesh rather than functions in the module.
added example script which converts a mesh to a bmesh, edits and converts back again.
2012-03-11 02:45:27 +00:00
Campbell Barton
0c50bedd9c code cleanup: remove unused externs. 2012-03-11 00:00:27 +00:00
Campbell Barton
7f34653f59 style cleanup: + some warning fixes, also remove unused metaelem extern. 2012-03-10 22:00:55 +00:00
Martin Poirier
67f1e83508 [#30373] Which part to snap in volume snapping is removed
By Bug reported by Pep Ribal

Also fixed an object mode bug with volume snapping and made it compatible with the edit mode "Snap on self" option
2012-03-10 21:40:35 +00:00
Campbell Barton
e09ab8883c bmesh:
- moved mesh conversion functions into their own file.

bmesh py api:
- can now create a new empty bmesh without first creating mesh data.
- added function to copy bmesh data back to a mesh.
- bmesh.from_mesh() can now get a mesh which isnt in editmode.
2012-03-10 20:41:19 +00:00
Thomas Dinges
83a5c943af 2.6 UI:
World Context:
* Made world id block wider
* Don't show texture user when Cycles engine is used
Other: 
* Change Dopesheet > DopeSheet in User Preferences Theme section for consistency.
2012-03-10 20:30:05 +00:00
Campbell Barton
d6a6f285d6 patch [#30511] Save/load window state (allows Blender to start maximised)
from Tom Edwards (artfunkel)

This patch fixes bug [#20791]
2012-03-10 17:49:26 +00:00
Sergey Sharybin
78941c1676 Remove remained part of debug code. 2012-03-10 17:14:50 +00:00
Sergey Sharybin
c175ed8b9b Forgot to remove code used for debuggning in previous commit. 2012-03-10 16:55:09 +00:00
Sergey Sharybin
be9aa6eada Finally 2D stabilization auto scale factor should be calculated perfectly 2012-03-10 16:31:12 +00:00
Campbell Barton
57693a3756 fix for own error in recent commit with UV texture layers. - was shadowing variable so assignment failed. 2012-03-10 15:55:25 +00:00
Campbell Barton
c7988dc1ac style cleanup 2012-03-10 14:43:12 +00:00
Campbell Barton
6fef7f1c32 style cleanup: unit code 2012-03-10 14:20:55 +00:00
Nicholas Bishop
2932ab8761 Fix an infinite loop in get_levels_from_disps().
This is called when adding a multiries modifier. BMesh MDisps have
only one loop's displacements rather than a full face's, so don't
multiply by number of corners here.
2012-03-10 12:26:32 +00:00
Campbell Barton
20d8d366ab style cleanup: fly mode. 2012-03-10 06:46:23 +00:00
Campbell Barton
064a333561 fix [#30500] Mesh.tessface_uv_textures or Mesh.tessface_vertex_colors crash on access in editmode
just missing NULL checks on face data.
2012-03-10 05:20:41 +00:00
Nicholas Bishop
24b676e370 Remove the OBJECT_OT_test_multires operator.
Originated in r35213, appears to have been some test for multires in
BMesh.
2012-03-10 05:15:17 +00:00
Campbell Barton
d3ffa53f78 change fly mode behavior to address issue raised in [#30508] - there being no way to pause.
now when reversing direction immediately - fly mode translation will pause until pressed again.
2012-03-10 04:19:25 +00:00
Campbell Barton
b1b07fb951 Speedup for ngon normal calculation
- BM_mesh_normals_update was looping over all faces to find the largest one, this is no longer needed.
- calculating a face normal was looping over every faces corners twice, now only once - using the loops directly (not an iterator).
- face vert locations were being copied an array, now use directly.
- calculating the normals would copy a float vector for the next point in the face, which was never used (only current and previous used).
- was copying vectors to compute the normal, now just assign the float pointers.
2012-03-10 03:25:16 +00:00
Nicholas Bishop
b8f15a1dd3 Revert changes BMesh changes MDisp loading in readfile.c
These changes originated in r35321, which transfered MDisps to a
different memory allocator; this is no long used, however, so
post-merge it was just making an identical copy.
2012-03-10 03:07:42 +00:00
Campbell Barton
702e85ef84 picky changes to mouse cursor text selection behavior, previously as soon as the mouse was before a character it would select the previous, even if the cursor was closer to the space between the next 2 chars.
now find the closest point inbetween both chars.
2012-03-09 23:10:07 +00:00
Campbell Barton
a2e00c6230 disable object outline draw when painting (its distracting), also fix for own recent mistake in vgroup_blend(). - had bad check for editmesh. 2012-03-09 22:00:40 +00:00
Campbell Barton
4dc35836ad code cleanup: remove unused variable assignents and added bmesh submodule links, doc correction reported by dfelinto. 2012-03-09 21:23:15 +00:00
Campbell Barton
4908ded534 bmesh fix: faces were being created flipped the wrong way compared to surrounding geometry.
also the last edge was mot taken into account when calculating the correct winding.
2012-03-09 20:29:53 +00:00
Campbell Barton
80dca0a06d style cleanup: consistent names for header guards. 2012-03-09 19:17:19 +00:00
Brecht Van Lommel
378765650d Fix makesdna error due to poor comment parsing, should be fixed in makesdna
ideally but for now just tweak code in case it causes issues.

ERROR: still 1 structs unknown
*** Unknown structs: bSound
2012-03-09 19:01:30 +00:00
Campbell Barton
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Sergey Sharybin
de4bd55e01 DO not increment image user counter on view3d duplicate and not decrement
it's user count on free. That's how other spaces handles ID block (like
image editor, space clip).

This fixes issue when loading file without loading UI when current layout
has got background images set.
Also this hopefully will fix issue #30429: Background Images Lost on Save/Close/Reload
2012-03-09 13:43:37 +00:00
Sergey Sharybin
0c68f0eee8 Previous fix for stabilization autoscale actually broke stabilizaiton itself
(median point was sliding a bit from it's original position)

This happens because of how transformation for stabilization calculates:
image is scaling around it's center, so image translation should be recalculated
after scale was changed, but scale also depends on translation. That's where
tricky things happens. It's still not ideal for case of rotation, but before
fixing this issue better to figure out usecase and see if it's indeed
so needed to scale around image center (it might only be helpful to use
stabilization parameters in compositor nodes).
2012-03-09 13:37:42 +00:00
Joshua Leung
15ec2a90c9 Markers Tweak for Sequencer
Applied the keymaps hack which is used for other animation editors to allow
markers to be added and renamed anywhere from within the sequencer strips
region, instead of just when the cursor is over the scrollbar.

Other operations where the hotkeys conflict though (delete, move) can still be
done only from the scrollbar, or better still, from the Timeline.
2012-03-09 13:31:20 +00:00
Lukas Toenne
455d1be696 Node socket selection feature reimplemented from 2.49. Sockets can be selected as a sub-selection of nodes and are then preferred by the auto-connect operator. This makes it easier to create precise links over long distances as an alternative to the click & hold operator.
Socket selection is indicated by a simple white highlight circle.

Multiple inputs can be selected by holding SHIFTKEY (just like regular node select). Only one output socket can be selected at a time for each node, but several outputs in different nodes are allowed.

The auto-connect operator will prefer selected sockets on nodes for creating links. If either the output or input side have no selected sockets it will fall back to the previous behavior of chosing 'best' sockets first (colors, then vectors, then values). This could be improved in the future, but is out of scope here.
2012-03-09 10:16:41 +00:00
Sergey Sharybin
eb1b38f31a Some fixes for 2D stabilization:
- Ron aspect ratio correction after applying location
  There're still some annoynments with rotation stabilization with
  pixel aspect != 1, will be fixed later.
- Joining tracks will update track used for rotation stabilization/
2012-03-09 10:01:29 +00:00
Nicholas Bishop
0641f1723b Optimize index buffers for multires drawing in sculpt mode.
All multires grids have exactly the same ordering, so rather than
allocate a new index buffer for each PBVH node, just allocate one that
can be reused for every grid.

This requires more draw calls (one per grid rather than one per PBVH
node), but less graphics memory.
2012-03-09 09:30:03 +00:00
Campbell Barton
dfdfa3d51b code cleanup: replace macros VECCOPY, VECADD, VECSUB, INPR - with BLI_math funcs.
added copy float/double funcs: copy_v3fl_v3db(), copy_v3db_v3fl(). 2d & 4d too.
2012-03-09 06:04:17 +00:00
Campbell Barton
4251746382 some code cleanup for rip tool. 2012-03-09 04:10:19 +00:00
Campbell Barton
78d73eb155 BMesh: rewrite edge split code (used by edge split modifier and rip tool)
this fixes but [#30461] where the same vertex was added to some faces twice.

Previous code rebuilt all faces around the split edges, replace this with much simpler code that uses existing bmesh API for splitting.

This also gives a performance boost to the modifier (over 30x faster in the bug-report file).
2012-03-09 03:16:39 +00:00
Campbell Barton
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
Campbell Barton
27d43f3fd3 added API function to C and python
* C:  BM_vert_separate(...)
* py: bmesh.utils.vert_separate(vert, edges)

This splits off regions around the vertex, splitting on connected edges passed in a sequence.

also made minor changes
- rename python api functions _rip to _separate
- fixed bmesh iterator being iterable its self (some parts of python expect this)
- fix memory leak in bmesh python api.
2012-03-09 00:01:38 +00:00
Nicholas Bishop
06b2343b50 Use sqrtf rather than sqrt in CCGSubSurf.c 2012-03-08 22:33:34 +00:00
Sergey Sharybin
3a3c5db82b - MSVC doesn't have log2f function
- Fix misusage of new [] and delete in BGE.
2012-03-08 21:14:54 +00:00
Campbell Barton
c82c456247 bmesh py api, new functions:
* bmesh.utils.face_vert_rip(f, v)
* bmesh.utils.loop_rip(l)
2012-03-08 20:00:37 +00:00
Brecht Van Lommel
9b8dae71a5 Cycles: support for environment texture "Mirror Ball" projection mode, next to
existing "Equirectangular". This projection is useful to create light probes
from a chrome ball placed in a real scene. It expects as input a photograph of
the chrome ball, cropped so the ball just fits inside the image boundaries.

Example setup with panorama camera and mixing two (poor quality) photographs
from different viewpoints to avoid stretching and hide the photographer:
http://www.pasteall.org/pic/28036
2012-03-08 19:52:58 +00:00
Sergey Sharybin
0f3e1821ea Fix #30435: 2.62 Torus Batch building "Bug" or A Experimental Feature?
Python-defined primitives used to be added to all visible layers instead of
adding to active scene layer as it happens with C-defined primitives.
2012-03-08 18:50:42 +00:00
Ton Roosendaal
a8d65a3708 Fix for Francesco Siddi: ALT+A should always start with the scene start frame! 2012-03-08 17:40:55 +00:00
Sergey Sharybin
fe131db70b New operators for clip editor's curve view:
- Select All operator for selecting markers
- Disable selected markers operator
2012-03-08 17:06:40 +00:00
Campbell Barton
a71936196a bmesh: fix for edge split allowing marked boundry edges for splitting. 2012-03-08 16:46:14 +00:00
Sergey Sharybin
895b99715b - Clip draw as scene strip background works fine again
- Path cleanup performed from curve view now clears only active track
  instead of all selected tracks.
2012-03-08 16:27:53 +00:00
Sergey Sharybin
3675fab31d Fix #30485: TRANSFORM / STABILIZE 2D: First row / column blackness.
Clamp source coordinates to boundaries so it'll be kind of correct weight
calculated for the pixel.
2012-03-08 14:23:34 +00:00
Bastien Montagne
a80b7d6129 Fixing several issues with keyingsets:
*Add a new idname to keyingsets, keeping name as label-only (using same string for both made lookup fail when using i18n other than english, as it tried to compare an untranslated static string id against a translated RNA name). Also adding a description string (can be helpful with custom keyingsets, imho).
*Fixed a few other bugs related to that area (namely, you can’t deselect current keyingset from the shift-ctrl-alt-I popup menu, and insert/delete key ops were using a rather strange way to get chosen custom keyingset…).
*Fixed UI code so that it always uses (RNA) enum, and simplified menu-creation code.
2012-03-08 14:04:06 +00:00
Sergey Sharybin
a5f2db9992 Fix #30489: Loop Cut by Typing Numbers Is Limited to 32?
Increase numbering input of number of loop cuts to 130 as it was in 2.49.
Also display count of cuts in a header.
2012-03-08 13:20:06 +00:00
Lukas Toenne
085c94e09d Modified behaviour of the link-insertion operator (drag on link, request by Sebastian Koenig). This would previously attempt to find a socket with exactly matching type to the from/to sockets of the cut link, but this is annoying because it often links to the "secondary" sockets, such as Factor input in the Mix node. New behaviour is to choose the input/output for reconnection based on the "highest" (= most important) socket types (in order color, vector, value), like the autoconnect operator (FKEY) also does. It is far from ideal and will probably not work in all situations either, but until we have a detailed design for "best sockets to auto-link" this will have to do. 2012-03-08 12:04:06 +00:00
Sergey Sharybin
c6d80d1db1 Fix ##30455: Orthographic grid alignment jumps/shifts when zooming
Issue was caused by precision errors with floats.
Made internal grid drawing stuff using doubles and also added some
functions to multiply double vector by float matrix which also makes
all intermediate calculation in doubles.
2012-03-08 11:57:51 +00:00
Howard Trickey
fc170e6a4e Knifetool: change ESC to mean cancel, not confirm.
This corresponds to the more usual convention.
There was no key connected to Cancel, and we already
have Return, Numpad-Return, and Right-click for confirm.
2012-03-08 11:56:11 +00:00
Joshua Leung
f839e2d41a Partial Bugfix [#30097] : Current frame indicator on Motion Paths drawn
incorrectly

When the current frame occurs outside the current visible range a given motion
path, the point lookup was seeking past the ends of the path's point cache,
causing sporadic flickering of current frame indicator at 0,0,0.
2012-03-08 10:53:40 +00:00
Nathan Letwory
41bed8e04c Add missing include. 2012-03-08 10:52:30 +00:00
Sergey Sharybin
50b6c903ff Fix #30467: UV/Image Editor: Scope: Opacity Values maybe wrong
Internally vector and waveform opacities are stored as float in 0..1 range
and the same range is exposed to the UI.
From file compatibility POV decided to change prop's type from percentage
to factor so it'll be nice slider with 0..1 range without confusing percentage
symbols (which should be quite easy to follow) and both forward and backwards
compatibilities are here.
2012-03-08 10:01:03 +00:00
Bastien Montagne
4a02307236 Another fix due to recent DM refactoring, for compilation of navmesh... 2012-03-08 09:14:10 +00:00
Sergey Sharybin
2413523d69 Compilation error fix for game engine caused by recent DM refactoring. 2012-03-08 08:57:38 +00:00
Nicholas Bishop
640b0adb98 Code cleanup: use named values for options in DerivedMesh drawing.
The DMSetDrawOptions[Tex] callbacks return 0 (skip), 1 (draw), or 2
(either stipple or skip mcols.) In the CDDM, EDDM, and CCGDM draw
functions, as well as the callbacks in drawmesh/drawobject, replace
these numbers with values from an enum, DMDrawOptions.
2012-03-08 06:47:05 +00:00
Campbell Barton
ee84084f99 style cleanup: pep8 + picky edits 2012-03-08 05:36:05 +00:00
Campbell Barton
e61339a76f code cleanup: duplicate checks and double assignments. 2012-03-08 04:38:35 +00:00
Campbell Barton
79d97ca509 style cleanup - spelling. 2012-03-08 04:12:11 +00:00
Campbell Barton
17786b3b3e building without python works again, cleanup bmesh include paths (cmake and scons). 2012-03-08 03:25:53 +00:00
Campbell Barton
640d766370 style cleanup - remove unneeded ';'s 2012-03-08 03:05:57 +00:00
Campbell Barton
1c91d62c7e use BLI_path_cmp() rather then strcmp() 2012-03-08 02:19:41 +00:00
Campbell Barton
6029640bca Many vertex group functions assumed mesh object when lattices could be operated on too. 2012-03-08 01:49:25 +00:00
Campbell Barton
081aa382ed fix
- access to a meshs editmesh before the pointer was checked to be a mesh.
- uninitialized memory use in transform (not a problem practically but nice to quiet the error in valgrind).
2012-03-08 01:22:49 +00:00
Campbell Barton
52db32bb53 fix for 2 crashes from missing NULL checks. 2012-03-08 00:23:28 +00:00
Campbell Barton
6bed106ed4 the length of mesh.tessface_vertex_colors was reported incorrect. (fix needed for FBX export) 2012-03-07 22:21:28 +00:00
Campbell Barton
db4a85162d edits to rna/tessface UV layer needed to get OBJ import/export functional.
add the function to create new UV layers, this only works when there are no polygon layers already created (to prevent confusion since scripts with polygon layers should be adding MTexPoly and MLoopUV layers)
2012-03-07 21:58:58 +00:00
Sergey Sharybin
333433d15e Fix for setting uv_layer name for modifiers
Issue was caused by missing fdata for meshes which doesn't have tessellated
faces yet. Real fix would be to use loop's MLOOPUV layer, but currently interface
is using mtex layer names for UV lists so use poly's mtex layer to check if
layer name is indeed correct.
Should work fine until we'll separate setting textures and UV coordinates.
2012-03-07 20:56:25 +00:00
Campbell Barton
5ebe91ca1f change camera zoom from short to float. 2012-03-07 19:42:22 +00:00
Sergey Sharybin
e5464db95d Fix for opengl render setting current frame to 0 after finish rendering. 2012-03-07 19:19:58 +00:00
Campbell Barton
541d239cdc fix for error in r44711, needed to update sequencer callback.
also quiet some warnings.
2012-03-07 19:19:56 +00:00
Sergey Sharybin
0c98a407a2 Another mango request: Ctrl-MMB zoom in camera view
It makes it much easier to zoom in camera view using the tablet.
2012-03-07 18:34:16 +00:00
Campbell Barton
0c05194639 remove printing versions in makesdna/makesrna - this used svn ID property which isnt set in the files anymore. 2012-03-07 18:27:12 +00:00
Sergey Sharybin
c69e4ef862 Mango request: use active scene clip as background for sequencer scene strip renderer
and opengl renerer when rendering from camera view.

Other usages of offscreen drawing shouldn't be affected by this change.
2012-03-07 17:45:40 +00:00
Campbell Barton
8a06ee3d42 running operators after loading a file in background mode would often fail because the screen was set to NULL and never assigned again (as it is when not in background mode),
Now skip clearning the screen when in background mode.
2012-03-07 17:18:57 +00:00
Campbell Barton
5d74235b5f patch [#30481] rna_Screen_scene_set does the wrong thing [patch]
from Dan Eicher (dna)

--- from the tracker
Setting Screen.scene only uses the active screen through a call to CTX_wm_screen(C) instead of the actual referenced scene.

The attached py-op demonstrates this behavior, assuming at least two separate scenes in the VSE.
2012-03-07 16:43:42 +00:00
Campbell Barton
c78f02d990 edit to cursor adjustment, use int rather then short to store the cursor position. 2012-03-07 16:24:25 +00:00
Campbell Barton
00781668ce Unify string stepping delimiter code for text buttons, text editor and console (all had duplicate code).
this is also a step toward the console working with utf8 though many todo's remain.
2012-03-07 15:55:12 +00:00
Campbell Barton
b41b19025e style cleanup: picky edits 2012-03-07 15:10:21 +00:00
Howard Trickey
9f742303a7 Knifetool uses direct cutting instead of scanfill: fixes bugs 29908, 28963, 30333.
Knifetool accumulates a bunch of proposed cuts and when the user
confirms, it makes them all. The old code did this by using scanfill
to triangulate the cutting edges in their faces, and then merging
triangles where possible. This sometimes ended up with strange
lost faces, and also made it so that when holes were cut, the
surrounding face ended up totally triangulated. But 29908 was
an example of a lost face.

This new code directly finds chains of cutting edges that go from
one side of a face to the other and using BM_edge_split_n to make
the cuts. Holes are handled by finding two good places where
the hole can be connected to the containing face (using two
because I think some other code in bmesh assumes that there are
no edges that appear twice in a face).

The old code is still there with #if SCANFILL_CUTS, so can easily revert
if this proves to be a bad idea.

Also, a small fix to previously added BM_split_n (forgot to
copy face attributes to new face).
2012-03-07 14:44:43 +00:00
Campbell Barton
41bdcc7e4e tweak text delimiters for button ctrl + left/right, ctrl+backspace/del
now theres always a single step before skipping delimiters, this means the skipping actions always advance by more then 1 char (which matches the text editor).
2012-03-07 13:35:32 +00:00
Nicholas Bishop
925f213427 Code cleanup: simplify the DerivedMesh.drawMappedFaces interface.
This function pointer's 'setDrawOptions' parameter took a slightly
different type than the other drawing callbacks. In particular, it
could set a 'drawSmooth' value to indicate that smoothing should
always be enabled, overriding the face flag. However, all callbacks
either did not set this value, or set it unconditionally to
1. Replaced this by adding a new 'flag' parameter to drawFacesMapped,
which can be set to DM_DRAW_ALWAYS_SMOOTH where appropriate.

Also removed the 'useColors' parameter and replaced it with another
flag value, DM_DRAW_USE_COLORS.

Removed the 'wpaint__setSolidDrawOptions' callback, was only being
used to set the shading to smooth.
2012-03-07 12:48:52 +00:00
Lukas Toenne
43711d8568 Simplified the ntreeUpdate function by getting rid of the dependency list and limiting resorting to cases where it is actually necessary (when nodes get added/removed or links change).
Node updates should generally be local by design, i.e. changes should not depend on any of the other nodes in the same tree. The original purpose of the dependency sort was to allow some experimental nodes to update their socket types based on upstream connected nodes, but these have been removed long ago. If such features need to be implemented they should instead use the tree-wide update callback, which is called after all the local node updates are done.

Removing the extra allocation and recursive function calls from most updates will ensure this function stays as fast as possible and can be called during node space context updates (snode_set_context), which are done very frequently (redraw).
2012-03-07 12:30:29 +00:00
Brecht Van Lommel
9fba458a7f Cycles: float texture support. Due to GPU limitations there are now 95 byte,
and 5 float image textures. For CPU render this limit will be lifted later
on with image cache support. Patch by Mike Farnsworth.

Also changed color space option in image/environment texture node, to show
options Color and Non-Color Data, instead of sRGB and Linear, this is more
descriptive, and it was not really correct to equate Non-Color Data with
Linear.
2012-03-07 12:27:18 +00:00
Michael Fox
bdf731f03d Patch [#30476] small 3 line patch to add the option 'NOT EQUAL TO' to the select faces by number of vertices operator
"This patch adds "Not Equal To" to the list of options for selecting faces based on the number of vertices. While the equivalent can indeed be achieved by using "Equal To" and invert selection, having this option allows for a smoother work-flow when adjusting the number of vertices to be compared."
2012-03-07 07:32:15 +00:00
Campbell Barton
46045fbb09 style cleanup - braces & else / if's 2012-03-07 04:53:43 +00:00
Nicholas Bishop
71e5edeb6a Code cleanup: use typedefs for DerivedMesh drawing callbacks.
There are still fairly bewildering set of callbacks being tossed
around, but it's at least a little less verbose now.
2012-03-07 04:41:14 +00:00
Campbell Barton
b563870fd9 use a better method if picking the rip vertex to use, rather then finding the edge closest to the mouse, find the face corner attached to the vert - thats closest to the mouse, this way ripping gives predictable outcome. 2012-03-07 04:20:30 +00:00
Campbell Barton
0c7487d1eb re: edge split with edges only connected to 2 faces (with no other faces around the verts)
turns out old code also had the same bug (just coincidance it was noticed after my change)

now boundry verts are tagged so edges connected to them are not seen is missing a tagged, adjacent edge.

this fixes [#30471]
2012-03-07 03:58:23 +00:00
Campbell Barton
4fe4cfdb88 revert own commit r44684 it broke edges with one vertex on a boundry 2012-03-07 03:46:30 +00:00
Campbell Barton
04beeea9c9 single vertex rip wasn't finishing with the best vertex selected. 2012-03-07 02:46:58 +00:00
Campbell Barton
6eb6877cdd minor improvement to Rip tool side calculation, measure distance to the edge line segment rather then midpoint. 2012-03-07 01:14:20 +00:00
Campbell Barton
f11d7a426f fix for bug in ED_view3d_project_float that only effected the 'Rip' tool.
when the source and destination vectors were the same pointer, the X value would get overwritten.

now the rip tool uses the best side to grab as in trunk.
2012-03-07 01:06:18 +00:00
Campbell Barton
400a0297b0 - simplify rip code not to expand/contract selection.
- disable BVH edge visibility test (ifdef'd out. dont think its really needed)
2012-03-07 00:08:00 +00:00
Sergey Sharybin
7c59666a27 Mango request: for range buttons copy start+1 to end if start>=0
Also copy end-1 to start if changing end boundary and end<=start.

Scene's start/end frames and ghost range in armature buttons are affected.
2012-03-06 21:42:03 +00:00
Nicholas Bishop
2fd7a56526 Fix textured-mode drawing in editmode.
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/
2012-03-06 21:21:22 +00:00
Campbell Barton
ef67172587 bmesh edge split - use a faster method of finding isolated split edges. 2012-03-06 20:41:11 +00:00
Juha Mäki-Kanto
1148344f46 fix #30440, Collada import: no faces/uv after bmesh merge
Seems too simple, just missing call to convert_mfaces_to_mpolys.
2012-03-06 19:50:07 +00:00
Campbell Barton
d1937de1d2 fix for own error in edge-rotate keeping edge customdata - this was crashing when rotating multiple edges.
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.
2012-03-06 19:29:05 +00:00
Campbell Barton
31d2ee9bf7 style cleanup, brackets in else/if, some indentation. 2012-03-06 18:40:15 +00:00
Campbell Barton
7b7214c722 code cleanup - give edge split more helpful var names and replace edgetag macros with static functions. 2012-03-06 17:23:26 +00:00
Sergey Sharybin
bffeab99ae Fix for fracture object crash
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.
2012-03-06 16:22:41 +00:00
Campbell Barton
5ba020da4f bmesh: speedup for deselecting all, (avoid topology loops since all get deselected anyway).
& some ascii art to explain BM_face_other_vert_loop() behavior.
2012-03-06 16:17:55 +00:00
Brecht Van Lommel
0deeab95be Fix sculpt partial redraw in viewport not working, my mistake, found by Nicholas. 2012-03-06 14:48:11 +00:00
Sergey Sharybin
7edb514945 Actual fix for mango files crashes on load
Was caused by recent code cleanup.
2012-03-06 14:46:45 +00:00
Sergey Sharybin
c6f7c97daa Fix for crash when loading some mango files
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.
2012-03-06 13:57:28 +00:00
Campbell Barton
3882f7cde7 quiet some warnings and fix build error with strict casting rules. 2012-03-06 12:51:17 +00:00
Sergey Sharybin
91c2aa7b95 Camera tracking: wall scene orientation operator
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).
2012-03-06 12:27:42 +00:00
Howard Trickey
bb21641e1c Fix to knifetool when intermediate point in space.
Before, if you cut the same edge multiple times
with an intermediate point in space, it wouldn't
get all of the edges.
2012-03-06 12:16:55 +00:00
Howard Trickey
d87f08cbaa Add BM_face_split_n which splits a face with intermediate points with given coordinates.
This will be used in soon-to-be-commited knife tool rewrite.
Interpolates using the original face.
Also fixed or improved a couple of comments.
2012-03-06 12:09:35 +00:00
Lukas Toenne
92322b57d4 Fix for 30439, Cycles node group conversion wasn't checking node->id pointer (group node without internal node tree). This is a somewhat unusual case (UI buttons don't allow unlinking group tree), but not entirely forbidden.
Also fixed similar issue in node_templates.c where the group tree is used to generate a button name.
2012-03-06 11:34:57 +00:00
Sergey Sharybin
2b9551a4e4 Fixed typo in tracking-related tweaks for depsgraph resulting with crash
in special cases (like setting camera's constraint clip if scene's clip is not set)
2012-03-06 11:24:23 +00:00
Nicholas Bishop
cc850522bc Fix incorrect null parameter in PBVH drawing 2012-03-06 09:19:13 +00:00
Nicholas Bishop
919a0d99fb Code cleanup: remove some PBVH material code that isn't needed anymore. 2012-03-06 03:34:27 +00:00
Nicholas Bishop
c7ffe7f621 Draw individual face's material and shading correctly in the PBVH.
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).
2012-03-06 02:40:08 +00:00
Nicholas Bishop
9c7e8e837d Code cleanup: remove unused parameter from some ccgSubSurf accessors.
Remove 'CCGSubSurf *ss' parameter from ccgSubSurf_getFaceFaceHandle,
ccgSubSurf_getFaceVert, and ccgSubSurf_getFaceEdge.
2012-03-06 01:01:42 +00:00
Nicholas Bishop
c729d6a87b Bugfix and code cleanup: use better types for faceFlags in CCGDM.
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.
2012-03-06 00:17:03 +00:00
Bastien Montagne
0114d78c33 Code cleanup in rna files (huge, higly automated with py script).
Addresses:
* C++ comments.
* Spaces after if/for/while/switch statements.
* Spaces around assignment operators.
2012-03-05 23:30:41 +00:00
Nicholas Bishop
1eb893a114 Code cleanup: factor out some common code from PBVH build_sub/build_leaf. 2012-03-05 22:24:49 +00:00
Nicholas Bishop
190c233293 Code cleanup: add comments for build_sub() and remove debug function.
Remove the function (and call to) check_partitioning(), this was just
a debug function.
2012-03-05 22:12:50 +00:00
Nicholas Bishop
10d1079226 Code cleanup: split PBVH build_sub() into two functions.
Removes also a confusing else{} block that didn't make much sense.
2012-03-05 21:55:53 +00:00
Sergey Sharybin
3f04564724 Disable interpolation of customdata layers on edge slide
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
2012-03-05 21:42:17 +00:00
Nicholas Bishop
e2003f9a6c Code cleanup: remove unused drawFacesColored from DerivedMesh.
This function pointer isn't called anymore, so removing it and the
cddm/ccgdm/gpu code associated with it.
2012-03-05 21:27:28 +00:00
Campbell Barton
bd83487dab fix [#30459] BMesh Edge Split Hangs.
edge split result is still not correct in this case but at least avoid eternal loop.

also - dont tag sharp edges with <2 faces for splitting.
2012-03-05 21:17:24 +00:00
Sergey Sharybin
1ae27144f6 Fix for OpenEXR half float save function resulting in dark images saved
Float buffers of ImBuf are always supposed to be linear space a,d ImBuf's
profile means how byte array was constructed from float buffer.
2012-03-05 18:54:57 +00:00
Campbell Barton
a5eadf14e0 copying a mesh was generating tessfaces which isnt needed 2012-03-05 18:05:06 +00:00
Sergey Sharybin
03ebd2091b Add stub needed for blenderplayer compilation. 2012-03-05 17:23:52 +00:00
Campbell Barton
529b2a01eb added check for DNA C syntax we cant parse:
void*somepointer;

.. this is valid C but breaks makesdna.c
2012-03-05 16:21:13 +00:00
Bastien Montagne
1e41b19ec1 tesselat -> tessellat in UI messages, + style edits. 2012-03-05 16:19:16 +00:00
Sergey Sharybin
aa0eb72c18 Fix for missed faces in mesh after switching active shape key in edit mode. 2012-03-05 14:25:52 +00:00
Campbell Barton
4f447921d2 RegionView3D.update call, to address issue in report:
[#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.
2012-03-05 13:02:45 +00:00
Campbell Barton
f6ddb79e20 fix [#30457] Smooth normals wrongly exported to wavefront
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.
2012-03-05 11:49:24 +00:00
Campbell Barton
4b940364a1 edge rotate now keeps edge properties (like seam, crease, bevel weight.. etc) 2012-03-05 01:53:30 +00:00
Campbell Barton
4d84e869a0 Improvements to bmesh edge rotate
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
2012-03-05 00:50:18 +00:00
Sergey Sharybin
5f509134ec Added option to fit frame to the whole clip editor viewport instead of zooming
to a power-of-two factor. Shortcut is F.
2012-03-04 21:02:58 +00:00
Sergey Sharybin
c395c862e9 Track cleanup operators are now moved to the global clip editor shortcuts
which makes it possible to cleanup tracks from curve view.
2012-03-04 20:44:09 +00:00
Sergey Sharybin
0963f45c66 Fixed copyright lines for some tracking related DNA files. 2012-03-04 20:23:50 +00:00
Sergey Sharybin
f79232cf34 Movie clip editor: implemented border select operator for curves view 2012-03-04 19:34:01 +00:00
Campbell Barton
a0ab2eefb9 * rename BM_face_other_loop --> BM_face_other_edge_loop
* 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.
2012-03-04 16:36:31 +00:00
Campbell Barton
76e9f91d1c switch arg order for BM_face_other_* funcs (make face come first), and add nice ascii art for BM_face_other_vert_loop since this stuff is hard to grasp as text. 2012-03-04 16:01:02 +00:00
Arystanbek Dyussenov
c2760307e8 #collada skeleton import, bugfix #29621
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>.
2012-03-04 13:43:23 +00:00
Campbell Barton
12d0489b33 fix for building openjpeg image support on OpenSUSE 12.1, also quiet compile warning. 2012-03-04 11:58:55 +00:00
Campbell Barton
34db81a6dc fix for missing NULL check in bmesh.from_mesh(), bug [#30446] 2012-03-04 11:10:11 +00:00
Lukas Toenne
dceab32f78 Small feature for the viewer linking operator: When no viewer node is present in the tree, it automatically adds a new one next to the output socket.
Also changed the poll function of that operator to make sure it actually only works on compositor trees (others don't have viewer nodes).
2012-03-04 10:49:13 +00:00
Campbell Barton
f6ae27daef style cleanup - comment spelling + translate some dutch. 2012-03-04 04:35:12 +00:00
Campbell Barton
4f2976941f fix for issue raise by patch [#30154] non utf8 buildinfo, fails to import 'bpy' module.
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
2012-03-04 03:14:38 +00:00
Joshua Leung
6c37e0a442 Whitespace tweaks 2012-03-04 02:43:15 +00:00
Campbell Barton
d99888d786 bmesh: add back feature from 2.4x Ctrl+Shift+T subdivides quads in the alternate direction. 2012-03-04 02:18:17 +00:00
Campbell Barton
88e0bcfbe1 fix for crash in bmesh py api, was missing NULL checks for parsing sequences and had bad string formatting in exception. 2012-03-04 02:09:02 +00:00
Campbell Barton
e583aa8e34 changes to ED_mesh_update() to work with OBJ import.
* 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.
2012-03-04 00:16:50 +00:00
Campbell Barton
8c7ea2f746 #ifdef out ngon edge-ring loop support, from r44561, this is a nice feature but can too easily give bad results, perhaps being it back with some sanity checks. 2012-03-03 22:27:34 +00:00
Campbell Barton
1531e3677a bmesh py api
* 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.
2012-03-03 22:07:58 +00:00
Bastien Montagne
685fda4f13 Many i18n fixings, based on [#30428] [2.62] Translation Issues.
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…
2012-03-03 21:42:21 +00:00
Campbell Barton
3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
Campbell Barton
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
Campbell Barton
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
Campbell Barton
86cec98f9e fix for leak in bmesh edge split - assert when invalid args are given rather then returning NULL. 2012-03-03 14:48:50 +00:00
Campbell Barton
cbc07986b5 bmesh support for rotating multiple edges at once. 2012-03-03 12:49:03 +00:00
Campbell Barton
9c18ade898 bmesh edge rotate
* 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.
2012-03-03 12:35:37 +00:00
Campbell Barton
9d49fa0e63 style cleanup - spelling corrections & update some incorrect comments. 2012-03-03 11:45:08 +00:00
Dalai Felinto
1f928833f3 option for the Armature Actuator to change the influence of a bone constraint.
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
2012-03-03 02:47:01 +00:00
Campbell Barton
95bba22af0 fix for error report in property registration, it wasnt printing the error. 2012-03-03 00:20:05 +00:00
Bastien Montagne
b3a0a33791 "Fix" [#30431] UI string spelling & similar fixes.
All suggested changes looked good to me, thx to Michael Färber for this list of changes!
2012-03-02 21:14:37 +00:00
Campbell Barton
e9c935caa0 fix bug [#30426] crash in bmesh python api.
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.
2012-03-02 18:23:08 +00:00
Campbell Barton
cc8e2d12a7 remove prints committed by accident. 2012-03-02 17:53:39 +00:00
Campbell Barton
7bbf4b7831 style cleanup
- 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.
2012-03-02 16:05:54 +00:00
Campbell Barton
63f5b96fe3 mesh.update() now has option to calculate tessellation faces. 2012-03-02 14:46:14 +00:00
Campbell Barton
21280a6386 Code Cleanup - naming consistancy for bmesh struct types 2012-03-02 12:44:34 +00:00
Campbell Barton
622ac0dd16 code cleanup:
replace casts: '((Mesh *)ob->data)->edit_btmesh' with 'BMEdit_FromObject(ob)'

also minor style edits.
2012-03-02 12:09:49 +00:00
Campbell Barton
cf927d3fd1 bmesh minor changes
* 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)
2012-03-02 10:49:15 +00:00
Bastien Montagne
47a1c7e5aa Fix [#30419] Median wrongly setting lattice vertex weights.
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.).
2012-03-02 10:30:11 +00:00
Campbell Barton
979a80e743 minor edits to last commit - use fixed chunksize, rather than the number of verts/edges/faces in bm_mempool_init(). 2012-03-01 23:59:34 +00:00
Campbell Barton
c26f5035b6 style cleanup for mempool 2012-03-01 23:14:51 +00:00
Campbell Barton
bc767059cb Code Cleanup: update to mempool, use flag rather then bool args. 2012-03-01 22:59:18 +00:00
Campbell Barton
921a7556fb bmesh - changes to mempool allocations
* 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.
2012-03-01 22:17:04 +00:00
Brecht Van Lommel
2942eab57c Fix #30413: dynamic paint crash with texture slots with no texture assigned. 2012-03-01 20:41:13 +00:00
Campbell Barton
9aafe32147 bmmesh api - use struct rather than int[4] to initialize mesh sizes.
also correct bad assert() in previous commit.
2012-03-01 20:09:17 +00:00
Brecht Van Lommel
d534f0e16d Fix #30405: combine HSVA node not working correct with fixed color instead
of socket connected as input, patch by Denis Declara.
2012-03-01 20:05:14 +00:00
Brecht Van Lommel
8643b8a02d Fix related to #30416: python render_stats handler now also gets called when the
saved file message is printed.
2012-03-01 19:19:10 +00:00
Brecht Van Lommel
dff2e84427 Fix #30415: motion blur option still had an effect on external engines / cycles,
should not be used then.
2012-03-01 19:19:04 +00:00
Campbell Barton
e69a758eaa fix [#30280] bmesh: Dissolve with error message kills Crease
CD_MASK_BMESH was didnt include crease of bevel weight - so copying the bmesh would skip these.
2012-03-01 19:05:14 +00:00
Campbell Barton
522b73a635 bmesh api:
* 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.
2012-03-01 17:38:04 +00:00
Campbell Barton
1f473a78b8 Code Cleanup: remove bmesh_radial_loop_next() function,
just access l->radial_next
2012-03-01 17:13:02 +00:00
Lukas Toenne
c1e8d77842 Same fix for file output node as Brecht did in r44580, EXR compression is defined in exr_codec instead compression. 2012-03-01 17:02:05 +00:00
Campbell Barton
e89f09a774 fast-path for BM_edge_is_manifold, BM_edge_is_boundary functions. 2012-03-01 16:56:42 +00:00
Brecht Van Lommel
93249c35b1 Fix related to #30384: multilayer exr files not saving compressed correctly. 2012-03-01 16:41:51 +00:00
Campbell Barton
3b8d96820f fix [#30399] bmesh: Extrusions adjacent to mirror plane leave stray edges.
thanks to Antony Riakiotakis for finding the cause.
2012-03-01 16:27:44 +00:00
Campbell Barton
64007f5625 bmesh regression with extrude.
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.
2012-03-01 16:12:11 +00:00
Campbell Barton
4a5078d6c9 style cleanup
* 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.
2012-03-01 16:04:37 +00:00
Campbell Barton
216f74880e style cleanup: bmesh - have continue on new line, also avoid unneeded loop in bmo_extrude_face_region_exec() in some cases. 2012-03-01 13:13:08 +00:00
Campbell Barton
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
Lukas Toenne
6a36b6249b Call the node freestorage callback _before_ actually freeing sockets, since this is also responsible for freeing possible socket storage data. 2012-03-01 12:07:59 +00:00
Lukas Toenne
b671f5e0de When adding a file output socket make it active, for convenience. Also move back one index when deleting the last. 2012-03-01 11:41:15 +00:00
Lukas Toenne
171d6bf509 Fix for Multilayer EXR API. This was using implementation stubs directly in the header file, causing problems with scons in particular. 2012-03-01 11:19:41 +00:00
Lukas Toenne
537605f0d4 Fix for wrong channel number in ImBuf when file node output format is something other than RGBA. This doesn't get set in the init function, has to be done manually (i guess?). 2012-03-01 08:47:32 +00:00
Lukas Toenne
77442de6c0 * Removed DNA_DEPRECATED tag from old NodeImageFile struct typedef, it doesn't work that way (duh)
* 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.
2012-03-01 08:17:16 +00:00
Lukas Toenne
2eb29e4788 A number of improvements for the file output node(s).
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.
2012-03-01 07:56:15 +00:00
Sergey Sharybin
1d5a3886a1 Fix crash on edge slide when object has got multires modifier
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.
2012-03-01 07:10:45 +00:00
Nicholas Bishop
4dfc25223f Remove struct NgonInterpModifierData and related ModifierType Info.
This modifier was already removed in r44288, looks like these were
just missed.
2012-03-01 02:20:10 +00:00
Campbell Barton
af0a469307 fix [#29135] NGons dont work with loop cut
patch by Andrew Wiggin
2012-02-29 17:23:41 +00:00
Sergey Sharybin
034b1711ea Changes to startup.blend:
- 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.
2012-02-29 17:01:43 +00:00
Campbell Barton
6c53638863 add an assert for inserting an egde with the same vertices and a BMESH_TODO for bevel. 2012-02-29 16:29:09 +00:00