Commit Graph

201 Commits

Author SHA1 Message Date
e44cd30abb Fix T41507: Empty prevents image deletion
Also allow assigning `Object.data = None` from Python
2014-08-21 17:05:47 +10:00
ef68faa2f9 Fix T41343, hard to remove group from objects.
Added a small menu with a few helper oerators next to each group panel:

* Remove group from all objects
* Select objects in group

More could be added possibly in the future.

Thanks to Campbell for the advice here.
2014-08-06 20:03:16 +02:00
Dalai Felinto
97641a0ec9 Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.

The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.

The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit

Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake

bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.

Supported Features:
------------------
 * Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.

 * Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.

 * Cage Extrusion - distance to use for the inward ray cast when using selected to active

 * Custom Cage - object to use as cage (instead of the lowpoly object).

 * Normal swizzle - change the axis that gets mapped to RGB

 * Normal space - save as tangent or object normal spaces

Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"

Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)

* For a complete implementation example look at the Cycles Bake commit (next).

Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge

Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.

The entire commit history can be found on the branch: bake-cycles
2014-05-02 21:19:08 -03:00
2fc7d04804 Add Simple randomize vertex tool
D432 from Walid Shouman with normal & uniform options added.
2014-03-31 14:56:43 +11:00
e9e08a1d12 Game Engine: Level of detail support and tools
Levels of detail can be added and modified in the object panel. The object
panel also contains new tools for generating levels of detail, setting up
levels of detail based on object names (useful for importing), and
clearing an object's level of detail settings. This is meant as a game
engine feature, though the level of details settings can be previewed in
the viewport.

Reviewed By: moguri, nexyon, brecht

Differential Revision: http://developer.blender.org/D109
2013-12-17 17:03:27 -08:00
85ce444455 Lattice Editmode: Select Mirror
patch originally by Philipp Oeser with some edits.
2013-12-09 15:41:54 +11:00
673bd9a009 Mesh Modifiers: Added Laplacian Deform
Part of soc-2013-sketch_mesh branch

See: http://wiki.blender.org/index.php/User:Apinzonf/Doc:2.6/Manual/Modifiers/Deform/Laplacian_Deform
2013-11-24 07:10:42 +11:00
33ae2b6c70 Transform: Warp tool (rewritten)
* Can optionally warp a segment (sets min/max default so it acts as old warp did).
* Can rotate the warp axis (old warp tool was limited to horizontal).
2013-11-20 23:30:26 +11:00
c9209de573 vertex weights: add weight quantize tool. 2013-11-17 14:58:23 +11:00
80f3b32e06 patch [#35789] Quick hack more/less tool for lattices
by Pedro Riera (priera), Andrey Dubravin, I also made some changes.
2013-07-19 10:49:23 +00:00
df299ab500 patch [#36032] Quick Hack lattice random selection
by Andrey Dubravin (daa)
2013-07-19 10:44:39 +00:00
4f3f95751a Bugfix [#35936] Can't create new vertex group when using Ctrl G menu
This was caused by r.57812

There were two problems here:
  1) vertex_group_vert_select_unlocked_poll()  had faulty logic which meant that
it always failed when there were no vgroups present yet - the final return
always just fell through
  2) Since the "Assign to New Groups" option was actually implemented using the
same operator as "Assign to Active Group" (just with an extra parameter set), if
the active group was locked, it was not possible to "Assign to New Group" (even
though a new group would not be locked).
2013-07-01 13:02:53 +00:00
b52d01dea6 Rename operator for better clarity 2013-06-25 22:28:20 +00:00
70fd2320c8 Added polished Vertex Weights Panel (properties sidebar) 2013-06-23 15:37:08 +00:00
75a5e239d7 correct enums which were in fact variables defined in headers. 2013-03-22 05:46:39 +00:00
8a4a034325 patch [#34634] Select vertices without a group
from Kevin Mackay (yakca)
2013-03-16 16:11:50 +00:00
4e1ea1f9fd patch [#34411] Patch for image drag and drop to create Empty rather than BG image
from Kevin Mackay (yakca)
2013-02-24 23:18:21 +00:00
6e0cedd61c code cleanup: operator/function mismatch 2013-02-17 07:17:04 +00:00
b6b2f37f27 Lattice Editing: Distortion-Free "Flip" Operator
This operator (Ctrl-F) allows you to flip the lattice coordinates without
inverting the normals of meshes deformed by the lattice (or the lattice's
deformation space for that matter). Unlike the traditional mirror tool, this
tool is aware of the fact that the vertex order for lattice control points
matters, and that simply mirroring the coordinates will only cause the lattice
to have an inverted deform along a particular axis (i.e. it will be scaling by a
negative scaling factor along that axis).

The problems (as I discovered the other day) with having such an inverted
deformation space are that:
- the normals of meshes/objects inside that will be incorrect/flipped (and will
disappear in GLSL shading mode for instance)
- transforming objects deformed by the lattices will become really tricky and
counter-intuitive (e.g. rotate in opposite direction by asymmetric amounts to
get desired result)
- it is not always immediately obvious that problems have occurred

Specific use cases this operator is meant to solve:
1) You've created a lattice-based deformer for one cartoonish eye. Now you want
to make the second eye, but want to save some time crafting that basic shape
again but mirrored.
2) You've got an even more finely crafted setup for stretchy-rigs, and now need
to apply it to other parts of the rig.

Notes:
* I've implemented a separate operator for this vs extending/patching mirror
transform tool as it's easier to implement this way, but also because there are
still some cases where the old mirroring seems valid (i.e. you explicitly want
these sort of distortion effects).
* Currently this doesn't take selections into account, as it doesn't seem useful
to do so.
2012-10-13 10:42:38 +00:00
cb42de588d Adding weightpaint transfer tool.
From: https://svn.blender.org/svnroot/bf-blender/branches/meshdata_transfer

Bachelor project at Narvik university collage (Norway).
By Ove M Henriksen (Cyborgmuppet)
 
Thesis will be published at Cyborgmuppets blender page.

Thanks for letting me participate!
2012-10-09 12:25:10 +00:00
8730b390fb patch [#31919] limit the number of bone deform weights per vertex. Many game engines require a limit of 4.
from Kesten Broughton (kestion)


Usage: In weight paint mode, select the mesh to have its weights culled. Click on "Limit Weights" button. A sub-panel will appear "Limit Number of Vertex Weights" with a slider field "Limit" which you can set to the appropriate level. The default level is 4, and it gets executed upon pressing "Limit Weights" so you will need to do an "undo" if your max bone limit is above 4. The checkbox "All Deform Weights" will consider all vertex weights, not just bone deform weights.
2012-10-09 10:56:35 +00:00
7247af6af5 svn merge ^/trunk/blender -r48592:HEAD 2012-10-09 10:53:20 +00:00
b2a5f28421 Follow Path Constraint - "Animate Path" Operator
Added a convenience operator to the Follow Path constraint which adds a F-Curve
for the path (or the operator's "fixed position" value if no path is assigned),
with options for setting the start frame and length of motion. This makes it
easier for common users to just set up a quick follow-path animation where the
camera (e.g. flying around a set over certain number of frames).

A key advantage of this is that it takes care of the underlying math required
for setting up the generator curve accordingly (I've got some plans for making
this a bit friendlier to use later). Now, animating the paths is a one-click
operation, with the start and length properties able to be controlled using the
operator properties.
2012-10-05 14:51:35 +00:00
00ce0c9aae Clean up in "add object" code:
* Get rid of ED_object_add_generic_invoke() and all invoke callbacks using it, it was doing nothing exec() callbacks would not do. In fact, its only action (setting part of common add ops properties, like loc, layers, etc.) was needed too by direct exec call, so it was done twice in case of using invoke()!
* Replace custom invoke code for metaballs by WM_menu_invoke helper (as already used by lamps).
* Add a new OBJECT_OT_empty_add op, to allow direct addition of empties of a given drawtype.
* And some general code cleanup (like trailing spaces, empty lines, ...).

Did quite a bunch of tests/verifications, but obviously could not tackle all possible scenarios... Anyway, if any, bugs should arize quite quickly (but I don’t expect any! :p ).
2012-10-05 12:59:09 +00:00
7d3e854aeb add hook now has option to add to active bone (mango request). 2012-08-13 08:54:33 +00:00
d43e1fa7be svn merge ^/trunk/blender -r48095:48592 2012-07-04 15:56:42 +00:00
72f7ab441d removing from group now shows menu to select group to remove. 2012-06-20 14:13:22 +00:00
736daa9f04 svn merge ^/trunk/blender -r46844:HEAD 2012-05-23 10:56:06 +00:00
45265b326a Add operator to extract armature and vertex groups from skin.
* The operator creates bones for each input edge (does not subdivide
  them like the skin operator does), adds a fake root bone for skin
  roots with multiple children.

* The operator adds vertex weight groups to the original mesh.

* Make copy_object_transform() public, used to match the armature
  object to the mesh object.

Skin modifier documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/SkinModifier
2012-05-22 15:29:57 +00:00
11309a19e2 Add skin vertex operators.
* Add operator to mark selected vertices as skin roots.
* Add operator to mark/clear selected vertices as loose.
* Add operator to equalize skin radii.

Skin modifier documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/SkinModifier
2012-05-22 15:29:44 +00:00
8521ca69fa removed:
OBJECT_OT_vertex_group_copy_to_selected_single()
plan for future to implement option as an argument in:
OBJECT_OT_vertex_group_copy_to_selected()
2012-05-17 12:36:07 +00:00
0978d1eb9d Added framework for transfer weight options.
vertex_group_transfer_weight_exec() governs all.
Functions renamed/added with _transfer_weight_
as opposed to _copy_by_ 
This is to reflect changes in parameters and usage as the internal code will change.
2012-05-17 01:42:06 +00:00
68179be662 svn merge ^/trunk/blender -r45927:HEAD --accept=theirs-full
This revision does not compile. code need to be merged in manualy.
2012-05-09 14:55:50 +00:00
7b3beec987 merging back to a version that works...
svn merge -r46433:46359 .
2012-05-08 19:49:39 +00:00
1d5440350d svn merge ^/trunk/blender -r46330:46335 2012-05-07 22:28:59 +00:00
6c86b70145 svn merge ^/trunk/blender -r46000:46100
some conflicts. had to backup my code, accept with "tc" and introduce my own code again.
Hope I didnt leave anything out.
2012-05-06 22:19:13 +00:00
5d02292d3c Bugfixes for Motion Path drawing/updating in light of the recent changes:
* Added proper "update" operators in place of the abuse of the calculate
operators, so now the display ranges won't get overwritten everytime (with the
default values) you go to update the paths.

* Display range settings in properties editor now actually work. Before, the "In
Range" mode only displayed the entire paths.
2012-05-06 04:18:13 +00:00
e2c453b5f9 style cleanup: editors / mesh & object 2012-04-28 15:42:27 +00:00
93f22cf012 svn merge ^/trunk/blender -r45364:HEAD --accept postpone 2012-04-12 16:01:24 +00:00
2a54ef0442 there was no way to reset timing for absolute shape keys, add an operator to do so. 2012-04-05 06:10:15 +00:00
244836b18d svn merge ^/trunk/blender -r44562:45364 2012-04-03 11:55:39 +00:00
4fb535070e Removed: The uneccecary previously added code and added functions for "copy_to_selected_single.
Reason: less code and  consistensy with existing code.

Added fuction "ED_vgroup_copy_single" that forms the basis for the above.
2012-04-03 08:23:00 +00:00
0b8ae86e59 Added functionality: copy vertex group from source to targets.
Changed some comments to represent the code more accuratly.
2012-03-15 21:49:40 +00:00
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
5b29a7bd2f from first change up until including this: added two buttons to gui,
transfer weight and trtransfer weight all, made the basic structure, redy to implement the contents of the functions in object_vgroup.c
2012-03-02 13:33:14 +00:00
42dfd82928 M source/blender/editors/object/object_ops.c
M    source/blender/editors/object/object_intern.h
2012-02-29 19:55:54 +00:00
94a2775a14 M source/blender/editors/object/object_vgroup.c
M    source/blender/editors/object/object_ops.c
M    source/blender/editors/object/object_intern.h
2012-02-29 19:46:31 +00:00
48006292d8 svn merge ^/trunk/blender -r44189:44204 2012-02-17 20:56:25 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
917714acf7 svn merge ^/trunk/blender -r43345:43381 2012-01-15 09:16:39 +00:00