forked from bartvdbraak/blender
Merged revision(s) 57908-57978 from trunk/blender into soc-2013-dingto.
This commit is contained in:
commit
e7fc69bdfd
1772
doc/doxygen/Doxyfile
1772
doc/doxygen/Doxyfile
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file audaspace/jack/AUD_JacLibrary.cpp
|
||||
/** \file audaspace/jack/AUD_JackLibrary.cpp
|
||||
* \ingroup audjack
|
||||
*/
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file audaspace/jack/AUD_JacLibrary.cpp
|
||||
/** \file audaspace/jack/AUD_JackLibrary.cpp
|
||||
* \ingroup audjack
|
||||
*/
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "background.h"
|
||||
#include "device.h"
|
||||
#include "integrator.h"
|
||||
#include "film.h"
|
||||
@ -568,9 +569,24 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
|
||||
light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else if(light->type == LIGHT_BACKGROUND) {
|
||||
uint visibility = scene->background->visibility;
|
||||
|
||||
shader_id &= ~SHADER_AREA_LIGHT;
|
||||
shader_id |= SHADER_USE_MIS;
|
||||
|
||||
if(!(visibility & PATH_RAY_DIFFUSE)) {
|
||||
shader_id |= SHADER_EXCLUDE_DIFFUSE;
|
||||
use_light_visibility = true;
|
||||
}
|
||||
if(!(visibility & PATH_RAY_GLOSSY)) {
|
||||
shader_id |= SHADER_EXCLUDE_GLOSSY;
|
||||
use_light_visibility = true;
|
||||
}
|
||||
if(!(visibility & PATH_RAY_TRANSMIT)) {
|
||||
shader_id |= SHADER_EXCLUDE_TRANSMIT;
|
||||
use_light_visibility = true;
|
||||
}
|
||||
|
||||
light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), 0.0f, 0.0f, 0.0f);
|
||||
light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), 0.0f, 0.0f, 0.0f);
|
||||
light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
@ -14,7 +14,7 @@
|
||||
height="640"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.48.3.1 r9886"
|
||||
inkscape:version="0.48.2 r9819"
|
||||
version="1.0"
|
||||
sodipodi:docname="blender_icons.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
@ -26927,6 +26927,129 @@
|
||||
x2="80.53125"
|
||||
y2="502"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient29761"
|
||||
id="linearGradient28981"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.8422958,0,0,0.8364537,82.535678,2.9394266)"
|
||||
x1="89.975014"
|
||||
y1="-32.339718"
|
||||
x2="88.492455"
|
||||
y2="-33.303608" />
|
||||
<linearGradient
|
||||
id="linearGradient29761">
|
||||
<stop
|
||||
style="stop-color:#b74125;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop29763" />
|
||||
<stop
|
||||
style="stop-color:#f9fbff;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop29765" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient29761"
|
||||
id="linearGradient28983"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="131.02808"
|
||||
y1="123.49161"
|
||||
x2="128.7139"
|
||||
y2="115.97001" />
|
||||
<linearGradient
|
||||
id="linearGradient67970">
|
||||
<stop
|
||||
style="stop-color:#b74125;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop67972" />
|
||||
<stop
|
||||
style="stop-color:#f9fbff;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop67974" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient29761"
|
||||
id="linearGradient28985"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="136.35806"
|
||||
y1="124.27161"
|
||||
x2="130.48389"
|
||||
y2="118" />
|
||||
<linearGradient
|
||||
id="linearGradient67977">
|
||||
<stop
|
||||
style="stop-color:#b74125;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop67979" />
|
||||
<stop
|
||||
style="stop-color:#f9fbff;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop67981" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient8864-1"
|
||||
id="linearGradient28987"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="115.15884"
|
||||
y1="88.476723"
|
||||
x2="109.18613"
|
||||
y2="82.308861" />
|
||||
<linearGradient
|
||||
id="linearGradient8864-1">
|
||||
<stop
|
||||
id="stop8866-0"
|
||||
offset="0"
|
||||
style="stop-color:#b43214;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop8868-1"
|
||||
offset="1"
|
||||
style="stop-color:#e86830;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient1610-8-8"
|
||||
id="linearGradient28989"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(21,0)"
|
||||
x1="101"
|
||||
y1="84.25"
|
||||
x2="97.75"
|
||||
y2="81.5" />
|
||||
<linearGradient
|
||||
id="linearGradient1610-8-8">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop1611-7-7" />
|
||||
<stop
|
||||
style="stop-color:white;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop1612-4-6" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient319-77-0"
|
||||
id="linearGradient28991"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(21,0)"
|
||||
x1="87.44548"
|
||||
y1="81.439644"
|
||||
x2="96.592278"
|
||||
y2="89.708977" />
|
||||
<linearGradient
|
||||
id="linearGradient319-77-0">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop320-9-0" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop321-31-9" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
@ -86007,6 +86130,116 @@
|
||||
id="path18197"
|
||||
style="opacity:0.7;fill:url(#linearGradient18212);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98985863;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
sodipodi:type="arc" />
|
||||
<g
|
||||
inkscape:export-ydpi="90"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-filename="C:\Documents and Settings\Pracownia\Pulpit\sss.png"
|
||||
transform="translate(102.25002,373)"
|
||||
id="g28949"
|
||||
style="display:inline;enable-background:new">
|
||||
<rect
|
||||
style="opacity:0;fill:#808000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.89999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||
id="rect28951"
|
||||
width="15.999955"
|
||||
height="16"
|
||||
x="155"
|
||||
y="-27" />
|
||||
<g
|
||||
id="g28953"
|
||||
style="opacity:0.6;display:inline;enable-background:new">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path28955"
|
||||
d="m 157.5,-26.5 c -1.10457,0 -2,0.895431 -2,2 0,1.104569 0.89543,2 2,2 0.0211,0 0.0415,6.5e-4 0.0625,0 0.005,0.02296 0.0259,0.03977 0.0312,0.0625 -0.63487,0.174633 -1.09375,0.747145 -1.09375,1.4375 0,0.828426 0.67157,1.5 1.5,1.5 0.69036,0 1.26287,-0.45888 1.4375,-1.09375 0.18381,0.04305 0.36556,0.09375 0.5625,0.09375 1.38071,0 2.5,-1.119289 2.5,-2.5 0,-1.380711 -1.11929,-2.5 -2.5,-2.5 -0.25351,0 -0.48817,0.05484 -0.71875,0.125 -0.32553,-0.663426 -0.9924,-1.125 -1.78125,-1.125 l 5e-5,0 z"
|
||||
style="fill:url(#linearGradient28981);fill-opacity:1;fill-rule:nonzero;stroke:#0b1728;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new" />
|
||||
<path
|
||||
inkscape:export-ydpi="90"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
|
||||
d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
|
||||
sodipodi:ry="8"
|
||||
sodipodi:rx="8"
|
||||
sodipodi:cy="118"
|
||||
sodipodi:cx="132"
|
||||
id="path28957"
|
||||
style="fill:url(#linearGradient28983);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline;enable-background:new"
|
||||
sodipodi:type="arc"
|
||||
transform="matrix(0,0.1250004,0.1250004,0,143.24995,-37.50005)" />
|
||||
<path
|
||||
transform="matrix(0,0.25,0.2500001,0,130.49998,-56)"
|
||||
sodipodi:type="arc"
|
||||
style="fill:url(#linearGradient28985);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline;enable-background:new"
|
||||
id="path28959"
|
||||
sodipodi:cx="132"
|
||||
sodipodi:cy="118"
|
||||
sodipodi:rx="8"
|
||||
sodipodi:ry="8"
|
||||
d="m 140,118 c 0,4.41828 -3.58172,8 -8,8 -4.41828,0 -8,-3.58172 -8,-8 0,-4.41828 3.58172,-8 8,-8 4.41828,0 8,3.58172 8,8 z"
|
||||
inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\Kopia blender\.blender\icons\blender's iconset.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
</g>
|
||||
<g
|
||||
id="g28961"
|
||||
transform="translate(45,-100)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cszccccccccz"
|
||||
id="path28963"
|
||||
d="m 110.5,85.5 c 0,2.25 2,3 3.5,3 2.25,0 3.1933,-1.514034 4,-2.5 l 4.5,-5.5 3,0 0,-2 -4,0 -5.5,5.5 -1.25,-1.5 -3.25,0 -1,1 0,2 z"
|
||||
style="fill:#b43214;fill-opacity:1;stroke:none" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient28987);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||
d="m 110.5,85.5 c 0,2.25 2,3 3.5,3 2.25,0 3.46788,-1.244422 4.25,-2.25 L 120,84 l -2,-2 -1.5,1.5 -1,0 0,-1 -1,-1 -3,0 -1,1 0,3 z"
|
||||
id="path28965"
|
||||
sodipodi:nodetypes="cszccccccccz" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#0b1728;stroke-width:0.80000001;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="m 110.5,85 c 0,2.25 1.5,3.5 3.75,3.5 2.25,0 3.50071,-1.469729 4.25,-2.5 l 4,-5.5 0.5,0 0.5,0 1,0 1,0 0,-2 -1,0 -1.11272,0 -0.88728,0 -1,0 -5,5 -1,0 0,-1 -1,-1 -3,0 -1,1 0,2.5 z"
|
||||
id="path28967"
|
||||
sodipodi:nodetypes="cszccccccccccccccccz" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient28989);stroke-width:1px"
|
||||
d="m 118,83 1,0 0,1 1,0 0,-1 -1,0 0,-1 -1,0 0,1 z"
|
||||
id="path28969"
|
||||
sodipodi:nodetypes="ccccccccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="opacity:0.5;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round"
|
||||
d="m 111.5,82.5 0.75818,0.763059 1.5,0 0.75,-0.75"
|
||||
id="path28971"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<rect
|
||||
style="opacity:0.6;fill:#000000;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||
id="rect28973"
|
||||
width="2"
|
||||
height="1"
|
||||
x="112"
|
||||
y="82" />
|
||||
<rect
|
||||
style="opacity:0.4;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.80000001;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
|
||||
id="rect28975"
|
||||
width="0.99994147"
|
||||
height="1.4999981"
|
||||
x="115"
|
||||
y="83.5" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="opacity:0.4;fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round"
|
||||
d="m 124.5,79.5 -3,0 -5,5 -0.5,0"
|
||||
id="path28977"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:url(#linearGradient28991);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round"
|
||||
d="m 111.5,83.5 0,1.271428 c -0.0915,0.859266 0.18827,2.299909 2.00056,2.733557 3.70517,0.886581 6.00049,-3.943221 6.00049,-3.943221"
|
||||
id="path28979"
|
||||
sodipodi:nodetypes="ccsc" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
|
Before Width: | Height: | Size: 4.1 MiB After Width: | Height: | Size: 4.1 MiB |
Binary file not shown.
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 235 KiB |
Binary file not shown.
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 591 KiB |
@ -369,7 +369,6 @@ def reset_all(reload_scripts=False):
|
||||
Sets the addon state based on the user preferences.
|
||||
"""
|
||||
import sys
|
||||
import imp
|
||||
|
||||
# RELEASE SCRIPTS: official scripts distributed in Blender releases
|
||||
paths_list = paths()
|
||||
@ -381,6 +380,7 @@ def reset_all(reload_scripts=False):
|
||||
|
||||
# first check if reload is needed before changing state.
|
||||
if reload_scripts:
|
||||
import imp
|
||||
mod = sys.modules.get(mod_name)
|
||||
if mod:
|
||||
imp.reload(mod)
|
||||
|
@ -27,8 +27,6 @@ from bpy.props import (StringProperty,
|
||||
EnumProperty,
|
||||
)
|
||||
|
||||
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
||||
|
||||
from bpy.app.translations import pgettext_tip as tip_
|
||||
|
||||
|
||||
@ -1029,6 +1027,8 @@ class WM_OT_properties_edit(Operator):
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
||||
|
||||
data_path = self.data_path
|
||||
value = self.value
|
||||
prop = self.property
|
||||
@ -1080,6 +1080,8 @@ class WM_OT_properties_edit(Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
from rna_prop_ui import rna_idprop_ui_prop_get
|
||||
|
||||
data_path = self.data_path
|
||||
|
||||
if not data_path:
|
||||
@ -1109,6 +1111,8 @@ class WM_OT_properties_add(Operator):
|
||||
data_path = rna_path
|
||||
|
||||
def execute(self, context):
|
||||
from rna_prop_ui import rna_idprop_ui_prop_get
|
||||
|
||||
data_path = self.data_path
|
||||
item = eval("context.%s" % data_path)
|
||||
|
||||
|
@ -1938,8 +1938,8 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
|
||||
layout.operator("mesh.rip_move_fill")
|
||||
layout.operator("mesh.split")
|
||||
layout.operator_menu_enum("mesh.separate", "type")
|
||||
layout.operator("mesh.vert_connect")
|
||||
layout.operator("transform.vert_slide")
|
||||
layout.operator("mesh.vert_connect", text="Connect")
|
||||
layout.operator("transform.vert_slide", text="Slide")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@ -1115,10 +1115,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.active_object
|
||||
|
||||
col = layout.column()
|
||||
col.active = ob.vertex_groups.active is not None
|
||||
col.operator("object.vertex_group_normalize_all", text="Normalize All")
|
||||
col.operator("object.vertex_group_normalize", text="Normalize")
|
||||
col.operator("object.vertex_group_mirror", text="Mirror")
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,15 +15,7 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* General operations for brushes.
|
||||
*/
|
||||
|
||||
#ifndef __BKE_BRUSH_H__
|
||||
@ -31,6 +23,8 @@
|
||||
|
||||
/** \file BKE_brush.h
|
||||
* \ingroup bke
|
||||
*
|
||||
* General operations for brushes.
|
||||
*/
|
||||
|
||||
struct ID;
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Joseph Eagar
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -366,6 +366,7 @@ void BKE_mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData
|
||||
const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace);
|
||||
|
||||
void BKE_mesh_poly_edgehash_insert(struct EdgeHash *ehash, const struct MPoly *mp, const struct MLoop *mloop);
|
||||
void BKE_mesh_poly_edgebitmap_insert(unsigned int *edge_bitmap, const struct MPoly *mp, const struct MLoop *mloop);
|
||||
|
||||
void BKE_mesh_do_versions_cd_flag_init(struct Mesh *mesh);
|
||||
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
@ -79,6 +76,8 @@ void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
|
||||
void BKE_object_unlink(struct Object *ob);
|
||||
bool BKE_object_exists_check(struct Object *obtest);
|
||||
bool BKE_object_is_in_editmode(struct Object *ob);
|
||||
bool BKE_object_is_in_editmode_vgroup(struct Object *ob);
|
||||
bool BKE_object_is_in_wpaint_select_vert(struct Object *ob);
|
||||
|
||||
struct Object *BKE_object_add_only_object(struct Main *bmain, int type, const char *name);
|
||||
struct Object *BKE_object_add(struct Main *bmain, struct Scene *scene, int type);
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributors: Matt Ebb
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation (2008).
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef __BKE_SCRIPT_H__
|
||||
#define __BKE_SCRIPT_H__
|
||||
|
||||
/** \file BKE_script.h
|
||||
* \ingroup bke
|
||||
* \since March 2001
|
||||
* \author nzc
|
||||
* \author Willian P. Germano
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Script;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BKE_SCRIPT_H__ */
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Jörg Müller.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -230,7 +230,6 @@ set(SRC
|
||||
BKE_sca.h
|
||||
BKE_scene.h
|
||||
BKE_screen.h
|
||||
BKE_script.h
|
||||
BKE_sequencer.h
|
||||
BKE_shrinkwrap.h
|
||||
BKE_sketch.h
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file blender/blenkernel/intern/CCGSubSurf.c
|
||||
* \ingroup bke
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file blender/blenkernel/intern/CCGSubSurf.h
|
||||
* \ingroup bke
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Campbell barton, Alex Fraser
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation (2008).
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_edgehash.h"
|
||||
#include "BLI_bitmap.h"
|
||||
#include "BLI_scanfill.h"
|
||||
#include "BLI_array.h"
|
||||
|
||||
@ -3802,6 +3803,19 @@ void BKE_mesh_poly_edgehash_insert(EdgeHash *ehash, const MPoly *mp, const MLoop
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_mesh_poly_edgebitmap_insert(unsigned int *edge_bitmap, const MPoly *mp, const MLoop *mloop)
|
||||
{
|
||||
const MLoop *ml;
|
||||
int i = mp->totloop;
|
||||
|
||||
ml = mloop;
|
||||
|
||||
while (i-- != 0) {
|
||||
BLI_BITMAP_SET(edge_bitmap, ml->e);
|
||||
ml++;
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_mesh_do_versions_cd_flag_init(Mesh *mesh)
|
||||
{
|
||||
if (UNLIKELY(mesh->cd_flag)) {
|
||||
|
@ -2301,10 +2301,12 @@ static bNode *node_get_active_id_recursive(bNodeInstanceKey active_key, bNodeIns
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
if (node->type == NODE_GROUP) {
|
||||
bNodeTree *group = (bNodeTree *)node->id;
|
||||
bNodeInstanceKey group_key = BKE_node_instance_key(parent_key, ntree, node);
|
||||
tnode = node_get_active_id_recursive(active_key, group_key, group, idtype);
|
||||
if (tnode)
|
||||
return tnode;
|
||||
if (group) {
|
||||
bNodeInstanceKey group_key = BKE_node_instance_key(parent_key, ntree, node);
|
||||
tnode = node_get_active_id_recursive(active_key, group_key, group, idtype);
|
||||
if (tnode)
|
||||
return tnode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -764,6 +764,24 @@ bool BKE_object_is_in_editmode(Object *ob)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BKE_object_is_in_editmode_vgroup(Object *ob)
|
||||
{
|
||||
return (OB_TYPE_SUPPORT_VGROUP(ob->type) &&
|
||||
BKE_object_is_in_editmode(ob));
|
||||
}
|
||||
|
||||
bool BKE_object_is_in_wpaint_select_vert(Object *ob)
|
||||
{
|
||||
if (ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
return ( (ob->mode & OB_MODE_WEIGHT_PAINT) &&
|
||||
(me->edit_btmesh == NULL) &&
|
||||
(ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX) );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BKE_object_exists_check(Object *obtest)
|
||||
{
|
||||
Object *ob;
|
||||
|
@ -421,23 +421,24 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (psys->part->from == PART_FROM_VERT) {
|
||||
if (pa->num < totelem && nodearray[pa->num])
|
||||
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
|
||||
if (use_modifier_stack) {
|
||||
if (pa->num < totelem)
|
||||
pa->num_dmcache = DMCACHE_ISCHILD;
|
||||
else
|
||||
pa->num_dmcache = DMCACHE_NOTFOUND;
|
||||
}
|
||||
else { /* FROM_FACE/FROM_VOLUME */
|
||||
/* Note that sometimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
|
||||
* but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
|
||||
if (use_modifier_stack) {
|
||||
else {
|
||||
if (psys->part->from == PART_FROM_VERT) {
|
||||
if (pa->num < totelem && nodearray[pa->num])
|
||||
pa->num_dmcache = GET_INT_FROM_POINTER(nodearray[pa->num]->link);
|
||||
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
|
||||
else
|
||||
pa->num_dmcache = DMCACHE_NOTFOUND;
|
||||
}
|
||||
else
|
||||
else { /* FROM_FACE/FROM_VOLUME */
|
||||
/* Note that sometimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
|
||||
* but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
|
||||
pa->num_dmcache= psys_particle_dm_face_lookup(ob, dm, pa->num, pa->fuv, pa->num < totelem ? nodearray[pa->num] : NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Jörg Müller.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -290,7 +290,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
|
||||
MVert *mvert = dm->getVertArray(dm);
|
||||
int totvert = dm->getNumVerts(dm);
|
||||
int totface = dm->getNumPolys(dm);
|
||||
int i, j, j_next, seam;
|
||||
int i, seam;
|
||||
UvMapVert *v;
|
||||
UvVertMap *vmap;
|
||||
float limit[2];
|
||||
@ -339,6 +339,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
|
||||
for (i = 0; i < totface; i++) {
|
||||
MPoly *mp = &((MPoly *) mpoly)[i];
|
||||
int nverts = mp->totloop;
|
||||
int j, j_next;
|
||||
CCGFace *origf = ccgSubSurf_getFace(origss, SET_INT_IN_POINTER(i));
|
||||
/* unsigned int *fv = &mp->v1; */
|
||||
MLoop *ml = mloop + mp->loopstart;
|
||||
@ -353,14 +354,14 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
|
||||
get_face_uv_map_vert(vmap, mpoly, ml, i, fverts);
|
||||
|
||||
for (j = 0, j_next = nverts - 1; j < nverts; j_next = j++) {
|
||||
unsigned int v0 = GET_UINT_FROM_POINTER(fverts[j]);
|
||||
unsigned int v1 = GET_UINT_FROM_POINTER(fverts[j_next]);
|
||||
MVert *mv0 = mvert + (ml[j].v);
|
||||
MVert *mv1 = mvert + (ml[j_next].v);
|
||||
unsigned int v0 = GET_UINT_FROM_POINTER(fverts[j_next]);
|
||||
unsigned int v1 = GET_UINT_FROM_POINTER(fverts[j]);
|
||||
MVert *mv0 = mvert + (ml[j_next].v);
|
||||
MVert *mv1 = mvert + (ml[j].v);
|
||||
|
||||
if (!BLI_edgehash_haskey(ehash, v0, v1)) {
|
||||
CCGEdge *e, *orige = ccgSubSurf_getFaceEdge(origf, j);
|
||||
CCGEdgeHDL ehdl = SET_INT_IN_POINTER(mp->loopstart + j);
|
||||
CCGEdge *e, *orige = ccgSubSurf_getFaceEdge(origf, j_next);
|
||||
CCGEdgeHDL ehdl = SET_INT_IN_POINTER(mp->loopstart + j_next);
|
||||
float crease;
|
||||
|
||||
if ((mv0->flag & mv1->flag) & ME_VERT_MERGED)
|
||||
@ -368,7 +369,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
|
||||
else
|
||||
crease = ccgSubSurf_getEdgeCrease(orige);
|
||||
|
||||
ccgSubSurf_syncEdge(ss, ehdl, fverts[j], fverts[j_next], crease, &e);
|
||||
ccgSubSurf_syncEdge(ss, ehdl, fverts[j_next], fverts[j], crease, &e);
|
||||
BLI_edgehash_insert(ehash, v0, v1, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): mar 2001 Nzc
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Daniel Dunbar
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,13 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Brecht Van Lommel
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Janne Karhu
|
||||
* Brecht Van Lommel
|
||||
*
|
||||
|
@ -15,19 +15,15 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Brecht Van Lommel
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* A heap / priority queue ADT.
|
||||
*/
|
||||
|
||||
/** \file blender/blenlib/intern/BLI_heap.c
|
||||
* \ingroup bli
|
||||
*
|
||||
* A heap / priority queue ADT.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Janne Karhu
|
||||
* Brecht Van Lommel
|
||||
*
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Daniel Dunbar, Joseph Eagar
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,10 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -290,6 +290,6 @@ extern void bpy_bm_generic_invalidate(struct BPy_BMGeneric *self);
|
||||
* but should not error on valid cases */
|
||||
#define BM_LOOP_RADIAL_MAX 10000
|
||||
#define BM_NGON_MAX 100000
|
||||
#define BM_OMP_LIMIT 0 /* 10000 */ /* setting zero so we can catch bugs in OpenMP/BMesh */
|
||||
#define BM_OMP_LIMIT 10000 /* 10000 */ /* setting zero so we can catch bugs in OpenMP/BMesh */
|
||||
|
||||
#endif /* __BMESH_CLASS_H__ */
|
||||
|
@ -69,10 +69,11 @@ typedef struct EdgeHalf {
|
||||
BMFace *fnext; /* face between this edge and next, if any */
|
||||
struct BoundVert *leftv; /* left boundary vert (looking along edge to end) */
|
||||
struct BoundVert *rightv; /* right boundary vert, if beveled */
|
||||
short is_bev; /* is this edge beveled? */
|
||||
short is_rev; /* is e->v2 the vertex at this end? */
|
||||
int seg; /* how many segments for the bevel */
|
||||
float offset; /* offset for this edge */
|
||||
bool is_bev; /* is this edge beveled? */
|
||||
bool is_rev; /* is e->v2 the vertex at this end? */
|
||||
bool is_seam; /* is e a seam for custom loopdata (e.g., UVs)? */
|
||||
// int _pad;
|
||||
} EdgeHalf;
|
||||
|
||||
@ -84,6 +85,7 @@ typedef struct BoundVert {
|
||||
EdgeHalf *elast;
|
||||
EdgeHalf *ebev; /* beveled edge whose left side is attached here, if any */
|
||||
int index; /* used for vmesh indexing */
|
||||
bool any_seam; /* are any of the edges attached here seams? */
|
||||
// int _pad;
|
||||
} BoundVert;
|
||||
|
||||
@ -110,6 +112,7 @@ typedef struct BevVert {
|
||||
int edgecount; /* total number of edges around the vertex */
|
||||
int selcount; /* number of selected edges around the vertex */
|
||||
float offset; /* offset for this vertex, if vertex_only bevel */
|
||||
bool any_seam; /* any seams on attached edges? */
|
||||
EdgeHalf *edges; /* array of size edgecount; CCW order from vertex normal side */
|
||||
VMesh *vmesh; /* mesh structure for replacing vertex */
|
||||
} BevVert;
|
||||
@ -227,43 +230,29 @@ static BevVert *find_bevvert(BevelParams *bp, BMVert *bmv)
|
||||
* created around/near BoundVert v */
|
||||
static BMFace *boundvert_rep_face(BoundVert *v)
|
||||
{
|
||||
BMFace *fans = NULL;
|
||||
BMFace *firstf = NULL;
|
||||
BMEdge *e1, *e2;
|
||||
BMFace *f1, *f2;
|
||||
BMIter iter1, iter2;
|
||||
|
||||
BLI_assert(v->efirst != NULL && v->elast != NULL);
|
||||
e1 = v->efirst->e;
|
||||
e2 = v->elast->e;
|
||||
BM_ITER_ELEM (f1, &iter1, e1, BM_FACES_OF_EDGE) {
|
||||
if (!firstf)
|
||||
firstf = f1;
|
||||
BM_ITER_ELEM (f2, &iter2, e2, BM_FACES_OF_EDGE) {
|
||||
if (f1 == f2) {
|
||||
fans = f1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!fans)
|
||||
fans = firstf;
|
||||
|
||||
return fans;
|
||||
if (v->efirst->fnext == v->elast->fprev)
|
||||
return v->efirst->fnext;
|
||||
else if (v->efirst->fnext)
|
||||
return v->efirst->fnext;
|
||||
else
|
||||
return v->elast->fprev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make ngon from verts alone.
|
||||
* Make sure to properly copy face attributes and do custom data interpolation from
|
||||
* example face, facerep.
|
||||
* corresponding elements of face_arr, if that is non-NULL, else from facerep.
|
||||
*
|
||||
* \note ALL face creation goes through this function, this is important to keep!
|
||||
*/
|
||||
static BMFace *bev_create_ngon(BMesh *bm, BMVert **vert_arr, const int totv, BMFace *facerep)
|
||||
static BMFace *bev_create_ngon(BMesh *bm, BMVert **vert_arr, const int totv,
|
||||
BMFace **face_arr, BMFace *facerep, bool do_interp)
|
||||
{
|
||||
BMIter iter;
|
||||
BMLoop *l;
|
||||
BMFace *f;
|
||||
BMFace *f, *interp_f;
|
||||
int i;
|
||||
|
||||
if (totv == 3) {
|
||||
f = BM_face_create_quad_tri_v(bm, vert_arr, 3, facerep, FALSE);
|
||||
@ -272,25 +261,30 @@ static BMFace *bev_create_ngon(BMesh *bm, BMVert **vert_arr, const int totv, BMF
|
||||
f = BM_face_create_quad_tri_v(bm, vert_arr, 4, facerep, FALSE);
|
||||
}
|
||||
else {
|
||||
int i;
|
||||
BMEdge **ee = BLI_array_alloca(ee, totv);
|
||||
|
||||
for (i = 0; i < totv; i++) {
|
||||
ee[i] = BM_edge_create(bm, vert_arr[i], vert_arr[(i + 1) % totv], NULL, BM_CREATE_NO_DOUBLE);
|
||||
}
|
||||
#if 0
|
||||
f = BM_face_create_ngon(bm, vert_arr[0], vert_arr[1], ee, totv, 0);
|
||||
#else
|
||||
f = BM_face_create(bm, vert_arr, ee, totv, 0);
|
||||
#endif
|
||||
}
|
||||
if (facerep && f) {
|
||||
int has_mdisps = CustomData_has_layer(&bm->ldata, CD_MDISPS);
|
||||
BM_elem_attrs_copy(bm, bm, facerep, f);
|
||||
BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
|
||||
BM_loop_interp_from_face(bm, l, facerep, TRUE, TRUE);
|
||||
if (has_mdisps)
|
||||
BM_loop_interp_multires(bm, l, facerep);
|
||||
if ((facerep || (face_arr && face_arr[0])) && f) {
|
||||
BM_elem_attrs_copy(bm, bm, facerep ? facerep : face_arr[0], f);
|
||||
if (do_interp) {
|
||||
i = 0;
|
||||
BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
|
||||
if (face_arr) {
|
||||
/* assume loops of created face are in same order as verts */
|
||||
BLI_assert(l->v == vert_arr[i]);
|
||||
interp_f = face_arr[i];
|
||||
}
|
||||
else {
|
||||
interp_f = facerep;
|
||||
}
|
||||
if (interp_f)
|
||||
BM_loop_interp_from_face(bm, l, interp_f, TRUE, TRUE);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,10 +298,147 @@ static BMFace *bev_create_ngon(BMesh *bm, BMVert **vert_arr, const int totv, BMF
|
||||
}
|
||||
|
||||
static BMFace *bev_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
|
||||
BMFace *facerep)
|
||||
BMFace *facerep, bool do_interp)
|
||||
{
|
||||
BMVert *varr[4] = {v1, v2, v3, v4};
|
||||
return bev_create_ngon(bm, varr, v4 ? 4 : 3, facerep);
|
||||
return bev_create_ngon(bm, varr, v4 ? 4 : 3, NULL, facerep, do_interp);
|
||||
}
|
||||
|
||||
static BMFace *bev_create_quad_tri_ex(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
|
||||
BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4)
|
||||
{
|
||||
BMVert *varr[4] = {v1, v2, v3, v4};
|
||||
BMFace *farr[4] = {f1, f2, f3, f4};
|
||||
return bev_create_ngon(bm, varr, v4 ? 4 : 3, farr, f1, true);
|
||||
}
|
||||
|
||||
|
||||
/* Is Loop layer layer_index contiguous across shared vertex of l1 and l2? */
|
||||
static bool contig_ldata_across_loops(BMesh *bm, BMLoop *l1, BMLoop *l2,
|
||||
int layer_index)
|
||||
{
|
||||
const int offset = bm->ldata.layers[layer_index].offset;
|
||||
const int type = bm->ldata.layers[layer_index].type;
|
||||
|
||||
return CustomData_data_equals(type,
|
||||
(char *)l1->head.data + offset,
|
||||
(char *)l2->head.data + offset);
|
||||
}
|
||||
|
||||
/* Are all loop layers with have math (e.g., UVs) contiguous from face f1 to face f2 across edge e? */
|
||||
static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace *f1, BMFace *f2)
|
||||
{
|
||||
BMLoop *lef1, *lef2;
|
||||
BMLoop *lv1f1, *lv1f2, *lv2f1, *lv2f2;
|
||||
BMVert *v1, *v2;
|
||||
int i;
|
||||
|
||||
if (bm->ldata.totlayer == 0)
|
||||
return true;
|
||||
|
||||
v1 = e->v1;
|
||||
v2 = e->v2;
|
||||
if (!BM_edge_loop_pair(e, &lef1, &lef2))
|
||||
return false;
|
||||
if (lef1->f == f2) {
|
||||
SWAP(BMLoop *, lef1, lef2);
|
||||
}
|
||||
|
||||
if (lef1->v == v1) {
|
||||
lv1f1 = lef1;
|
||||
lv2f1 = BM_face_other_edge_loop(f1, e, v2);
|
||||
}
|
||||
else {
|
||||
lv2f1 = lef1;
|
||||
lv1f1 = BM_face_other_edge_loop(f1, e, v1);
|
||||
}
|
||||
|
||||
if (lef2->v == v1) {
|
||||
lv1f2 = lef2;
|
||||
lv2f2 = BM_face_other_edge_loop(f2, e, v2);
|
||||
}
|
||||
else {
|
||||
lv2f2 = lef2;
|
||||
lv1f2 = BM_face_other_edge_loop(f2, e, v1);
|
||||
}
|
||||
|
||||
for (i = 0; i < bm->ldata.totlayer; i++) {
|
||||
if (CustomData_layer_has_math(&bm->ldata, i) &&
|
||||
(!contig_ldata_across_loops(bm, lv1f1, lv1f2, i) ||
|
||||
!contig_ldata_across_loops(bm, lv2f1, lv2f2, i)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Like bev_create_quad_tri, but when verts straddle an old edge.
|
||||
* e
|
||||
* |
|
||||
* v1+---|---+v4
|
||||
* | | |
|
||||
* | | |
|
||||
* v2+---|---+v3
|
||||
* |
|
||||
* f1 | f2
|
||||
*
|
||||
* Most CustomData for loops can be interpolated in their respective
|
||||
* faces' loops, but for UVs and other 'has_math_cd' layers, only
|
||||
* do this if the UVs are continuous across the edge e, otherwise pick
|
||||
* one side (f1, arbitrarily), and interpolate them all on that side.
|
||||
* For face data, use f1 (arbitrarily) as face representative. */
|
||||
static BMFace *bev_create_quad_straddle(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
|
||||
BMFace *f1, BMFace *f2, bool is_seam)
|
||||
{
|
||||
BMFace *f, *facerep;
|
||||
BMLoop *l;
|
||||
BMIter iter;
|
||||
|
||||
f = bev_create_quad_tri(bm, v1, v2, v3, v4, f1, false);
|
||||
|
||||
if (!f)
|
||||
return NULL;
|
||||
|
||||
BM_ITER_ELEM (l, &iter, f, BM_LOOPS_OF_FACE) {
|
||||
if (is_seam || l->v == v1 || l->v == v2)
|
||||
facerep = f1;
|
||||
else
|
||||
facerep = f2;
|
||||
if (facerep)
|
||||
BM_loop_interp_from_face(bm, l, facerep, TRUE, TRUE);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
/* Merge (using average) all the UV values for loops of v's faces.
|
||||
* Caller should ensure that no seams are violated by doing this. */
|
||||
static void bev_merge_uvs(BMesh *bm, BMVert *v)
|
||||
{
|
||||
BMIter iter;
|
||||
MLoopUV *luv;
|
||||
BMLoop *l;
|
||||
float uv[2];
|
||||
int n;
|
||||
int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
|
||||
|
||||
if (cd_loop_uv_offset == -1)
|
||||
return;
|
||||
|
||||
n = 0;
|
||||
zero_v2(uv);
|
||||
BM_ITER_ELEM(l, &iter, v, BM_LOOPS_OF_VERT) {
|
||||
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
|
||||
add_v2_v2(uv, luv->uv);
|
||||
n++;
|
||||
}
|
||||
if (n > 1) {
|
||||
mul_v2_fl(uv, 1.0f / (float)n);
|
||||
BM_ITER_ELEM(l, &iter, v, BM_LOOPS_OF_VERT) {
|
||||
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
|
||||
copy_v2_v2(luv->uv, uv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate coordinates of a point a distance d from v on e->e and return it in slideco */
|
||||
@ -641,6 +772,25 @@ static void snap_to_edge_profile(EdgeHalf *e, const float va[3], const float vb[
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the any_seam property for a BevVert and all its BoundVerts */
|
||||
static void set_bound_vert_seams(BevVert *bv)
|
||||
{
|
||||
BoundVert *v;
|
||||
EdgeHalf *e;
|
||||
|
||||
bv->any_seam = false;
|
||||
v = bv->vmesh->boundstart;
|
||||
do {
|
||||
v->any_seam = false;
|
||||
for (e = v->efirst; e; e = e->next) {
|
||||
v->any_seam |= e->is_seam;
|
||||
if (e == v->elast)
|
||||
break;
|
||||
}
|
||||
bv->any_seam |= v->any_seam;
|
||||
} while ((v = v->next) != bv->vmesh->boundstart);
|
||||
}
|
||||
|
||||
/* Make a circular list of BoundVerts for bv, each of which has the coordinates
|
||||
* of a vertex on the the boundary of the beveled vertex bv->v.
|
||||
* Also decide on the mesh pattern that will be used inside the boundary.
|
||||
@ -683,6 +833,7 @@ static void build_boundary(BevelParams *bp, BevVert *bv)
|
||||
e->next->leftv = e->next->rightv = v;
|
||||
/* could use M_POLY too, but tri-fan looks nicer)*/
|
||||
vm->mesh_kind = M_TRI_FAN;
|
||||
set_bound_vert_seams(bv);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -754,6 +905,8 @@ static void build_boundary(BevelParams *bp, BevVert *bv)
|
||||
}
|
||||
} while ((e = e->next) != efirst);
|
||||
|
||||
set_bound_vert_seams(bv);
|
||||
|
||||
BLI_assert(vm->count >= 2);
|
||||
if (bp->vertex_only) {
|
||||
vm->mesh_kind = bp->seg > 1 ? M_ADJ_SUBDIV : M_POLY;
|
||||
@ -783,19 +936,20 @@ static void build_boundary(BevelParams *bp, BevVert *bv)
|
||||
* then make the BMVerts and the new faces. */
|
||||
static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
{
|
||||
int k, ring, i, n, ns, ns2, nn;
|
||||
int k, ring, i, n, ns, ns2, nn, odd;
|
||||
VMesh *vm = bv->vmesh;
|
||||
BoundVert *v, *vprev, *vnext;
|
||||
NewVert *nv, *nvprev, *nvnext;
|
||||
EdgeHalf *e1, *e2, *epipe;
|
||||
BMVert *bmv, *bmv1, *bmv2, *bmv3, *bmv4;
|
||||
BMFace *f;
|
||||
BMFace *f, *f2, *f23;
|
||||
float co[3], coa[3], cob[3], midco[3];
|
||||
float va_pipe[3], vb_pipe[3];
|
||||
|
||||
n = vm->count;
|
||||
ns = vm->seg;
|
||||
ns2 = ns / 2;
|
||||
odd = (ns % 2) != 0;
|
||||
BLI_assert(n > 2 && ns > 1);
|
||||
|
||||
/* special case: two beveled edges are in line and share a face, making a "pipe" */
|
||||
@ -884,7 +1038,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
if (vprev->ebev) {
|
||||
for (ring = 1; ring <= ns2; ring++) {
|
||||
for (k = 1; k <= ns2; k++) {
|
||||
if (ns % 2 == 0 && (k == ns2 || ring == ns2))
|
||||
if (!odd && (k == ns2 || ring == ns2))
|
||||
continue; /* center line is special case: do after the rest are done */
|
||||
nv = mesh_vert(vm, i, ring, k);
|
||||
nvprev = mesh_vert(vm, vprev->index, k, ns - ring);
|
||||
@ -901,7 +1055,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
if (!vprev->prev->ebev) {
|
||||
for (ring = 1; ring <= ns2; ring++) {
|
||||
for (k = 1; k <= ns2; k++) {
|
||||
if (ns % 2 == 0 && (k == ns2 || ring == ns2))
|
||||
if (!odd && (k == ns2 || ring == ns2))
|
||||
continue;
|
||||
create_mesh_bmvert(bm, vm, vprev->index, ring, k, bv->v);
|
||||
}
|
||||
@ -910,7 +1064,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
if (!vnext->ebev) {
|
||||
for (ring = 1; ring <= ns2; ring++) {
|
||||
for (k = ns - ns2; k < ns; k++) {
|
||||
if (ns % 2 == 0 && (k == ns2 || ring == ns2))
|
||||
if (!odd && (k == ns2 || ring == ns2))
|
||||
continue;
|
||||
create_mesh_bmvert(bm, vm, i, ring, k, bv->v);
|
||||
}
|
||||
@ -920,7 +1074,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
}
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
|
||||
if (ns % 2 == 0) {
|
||||
if (!odd) {
|
||||
/* Do special case center lines.
|
||||
* This loop makes verts for (i, ns2, k) for 1 <= k <= ns-1, k!=ns2
|
||||
* and for (i, r, ns2) for 1 <= r <= ns2-1,
|
||||
@ -1006,8 +1160,9 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
do {
|
||||
i = v->index;
|
||||
f = boundvert_rep_face(v);
|
||||
f2 = boundvert_rep_face(v->next);
|
||||
if (v->ebev && (v->prev->ebev || v->next->ebev)) {
|
||||
for (k = 0; k < ns2 + (ns % 2); k++) {
|
||||
for (k = 0; k < ns2 + odd; k++) {
|
||||
bmv1 = mesh_vert(vm, i, ring, k)->v;
|
||||
bmv2 = mesh_vert(vm, i, ring, k + 1)->v;
|
||||
bmv3 = mesh_vert(vm, i, ring + 1, k + 1)->v;
|
||||
@ -1015,13 +1170,19 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
BLI_assert(bmv1 && bmv2 && bmv3 && bmv4);
|
||||
if (bmv3 == bmv4 || bmv1 == bmv4)
|
||||
bmv4 = NULL;
|
||||
bev_create_quad_tri(bm, bmv1, bmv2, bmv3, bmv4, f);
|
||||
/* f23 is interp face for bmv2 and bmv3 */
|
||||
f23 = f;
|
||||
if (odd && k == ns2 && f2 && !v->any_seam)
|
||||
f23 = f2;
|
||||
bev_create_quad_tri_ex(bm, bmv1, bmv2, bmv3, bmv4,
|
||||
f, f23, f23, f);
|
||||
}
|
||||
}
|
||||
else if (v->prev->ebev && v->prev->prev->ebev) {
|
||||
/* finish off a sequence of beveled edges */
|
||||
i = v->prev->index;
|
||||
f = boundvert_rep_face(v->prev);
|
||||
f2 = boundvert_rep_face(v);
|
||||
for (k = ns2 + (ns % 2); k < ns; k++) {
|
||||
bmv1 = mesh_vert(vm, i, ring, k)->v;
|
||||
bmv2 = mesh_vert(vm, i, ring, k + 1)->v;
|
||||
@ -1032,30 +1193,54 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
bmv3 = bmv4;
|
||||
bmv4 = NULL;
|
||||
}
|
||||
bev_create_quad_tri(bm, bmv1, bmv2, bmv3, bmv4, f);
|
||||
f23 = f;
|
||||
if (odd && k == ns2 && f2 && !v->any_seam)
|
||||
f23 = f2;
|
||||
bev_create_quad_tri_ex(bm, bmv1, bmv2, bmv3, bmv4,
|
||||
f, f23, f23, f);
|
||||
}
|
||||
}
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
}
|
||||
|
||||
/* Fix UVs along center lines if even number of segments */
|
||||
if (!odd) {
|
||||
v = vm->boundstart;
|
||||
do {
|
||||
i = v->index;
|
||||
f = boundvert_rep_face(v);
|
||||
f2 = boundvert_rep_face(v->next);
|
||||
if (!v->any_seam) {
|
||||
for (ring = 1; ring < ns2; ring++)
|
||||
bev_merge_uvs(bm, mesh_vert(vm, i, ring, ns2)->v);
|
||||
}
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
if (!bv->any_seam)
|
||||
bev_merge_uvs(bm, mesh_vert(vm, 0, ns2, ns2)->v);
|
||||
}
|
||||
|
||||
/* Make center ngon if odd number of segments and fully beveled */
|
||||
if (ns % 2 == 1 && vm->count == bv->selcount) {
|
||||
if (odd && vm->count == bv->selcount) {
|
||||
BMVert **vv = NULL;
|
||||
BMFace **vf = NULL;
|
||||
BLI_array_staticdeclare(vv, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
BLI_array_staticdeclare(vf, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
|
||||
v = vm->boundstart;
|
||||
do {
|
||||
i = v->index;
|
||||
BLI_assert(v->ebev);
|
||||
BLI_array_append(vv, mesh_vert(vm, i, ns2, ns2)->v);
|
||||
BLI_array_append(vf, bv->any_seam ? f: boundvert_rep_face(v));
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
f = boundvert_rep_face(vm->boundstart);
|
||||
bev_create_ngon(bm, vv, BLI_array_count(vv), f);
|
||||
bev_create_ngon(bm, vv, BLI_array_count(vv), vf, f, true);
|
||||
|
||||
BLI_array_free(vv);
|
||||
}
|
||||
|
||||
/* Make 'rest-of-vmesh' polygon if not fully beveled */
|
||||
/* TODO: use interpolation face array here too */
|
||||
if (vm->count > bv->selcount) {
|
||||
int j;
|
||||
BMVert **vv = NULL;
|
||||
@ -1108,7 +1293,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
if (vv[0] == vv[j - 1])
|
||||
j--;
|
||||
bev_create_ngon(bm, vv, j, f);
|
||||
bev_create_ngon(bm, vv, j, NULL, f, true);
|
||||
|
||||
BLI_array_free(vv);
|
||||
}
|
||||
@ -1436,7 +1621,7 @@ static void bevel_build_rings_subdiv(BevelParams *bp, BMesh *bm, BevVert *bv)
|
||||
float coa[3], cob[3], coc[3];
|
||||
BoundVert *v;
|
||||
BMVert *bmv1, *bmv2, *bmv3, *bmv4;
|
||||
BMFace *f;
|
||||
BMFace *f, *f2, *f23;
|
||||
MemArena *mem_arena = bp->mem_arena;
|
||||
const float fullness = 0.5f;
|
||||
|
||||
@ -1488,6 +1673,7 @@ static void bevel_build_rings_subdiv(BevelParams *bp, BMesh *bm, BevVert *bv)
|
||||
do {
|
||||
i = v->index;
|
||||
f = boundvert_rep_face(v);
|
||||
f2 = boundvert_rep_face(v->next);
|
||||
/* For odd ns, make polys with lower left corner at (i,j,k) for
|
||||
* j in [0, ns2-1], k in [0, ns2]. And then the center ngon.
|
||||
* For even ns,
|
||||
@ -1499,7 +1685,11 @@ static void bevel_build_rings_subdiv(BevelParams *bp, BMesh *bm, BevVert *bv)
|
||||
bmv3 = mesh_vert(vm, i, j + 1, k + 1)->v;
|
||||
bmv4 = mesh_vert(vm, i, j + 1, k)->v;
|
||||
BLI_assert(bmv1 && bmv2 && bmv3 && bmv4);
|
||||
bev_create_quad_tri(bm, bmv1, bmv2, bmv3, bmv4, f);
|
||||
f23 = f;
|
||||
if (odd && k == ns2 && f2 && !v->any_seam)
|
||||
f23 = f2;
|
||||
bev_create_quad_tri_ex(bm, bmv1, bmv2, bmv3, bmv4,
|
||||
f, f23, f23, f);
|
||||
}
|
||||
}
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
@ -1507,44 +1697,54 @@ static void bevel_build_rings_subdiv(BevelParams *bp, BMesh *bm, BevVert *bv)
|
||||
/* center ngon */
|
||||
if (odd) {
|
||||
BMVert **vv = NULL;
|
||||
BMFace **vf = NULL;
|
||||
BLI_array_staticdeclare(vv, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
BLI_array_staticdeclare(vf, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
|
||||
v = vm->boundstart;
|
||||
do {
|
||||
i = v->index;
|
||||
BLI_array_append(vv, mesh_vert(vm, i, ns2, ns2)->v);
|
||||
BLI_array_append(vf, v->any_seam ? f : boundvert_rep_face(v));
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
f = boundvert_rep_face(vm->boundstart);
|
||||
bev_create_ngon(bm, vv, BLI_array_count(vv), f);
|
||||
bev_create_ngon(bm, vv, BLI_array_count(vv), vf, f, true);
|
||||
|
||||
BLI_array_free(vv);
|
||||
}
|
||||
}
|
||||
|
||||
static BMFace *bevel_build_poly_ex(BMesh *bm, BevVert *bv)
|
||||
static BMFace *bevel_build_poly(BMesh *bm, BevVert *bv)
|
||||
{
|
||||
BMFace *f;
|
||||
int n, k;
|
||||
VMesh *vm = bv->vmesh;
|
||||
BoundVert *v;
|
||||
BMFace *frep;
|
||||
BMVert **vv = NULL;
|
||||
BMFace **vf = NULL;
|
||||
BLI_array_staticdeclare(vv, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
BLI_array_staticdeclare(vf, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
|
||||
frep = boundvert_rep_face(vm->boundstart);
|
||||
v = vm->boundstart;
|
||||
n = 0;
|
||||
do {
|
||||
/* accumulate vertices for vertex ngon */
|
||||
/* also accumulate faces in which uv interpolation is to happen for each */
|
||||
BLI_array_append(vv, v->nv.v);
|
||||
BLI_array_append(vf, bv->any_seam ? frep : boundvert_rep_face(v));
|
||||
n++;
|
||||
if (v->ebev && v->ebev->seg > 1) {
|
||||
for (k = 1; k < v->ebev->seg; k++) {
|
||||
BLI_array_append(vv, mesh_vert(vm, v->index, 0, k)->v);
|
||||
BLI_array_append(vf, bv->any_seam ? frep : boundvert_rep_face(v));
|
||||
n++;
|
||||
}
|
||||
}
|
||||
} while ((v = v->next) != vm->boundstart);
|
||||
if (n > 2) {
|
||||
f = bev_create_ngon(bm, vv, n, boundvert_rep_face(v));
|
||||
f = bev_create_ngon(bm, vv, n, vf, boundvert_rep_face(v), true);
|
||||
}
|
||||
else {
|
||||
f = NULL;
|
||||
@ -1553,17 +1753,12 @@ static BMFace *bevel_build_poly_ex(BMesh *bm, BevVert *bv)
|
||||
return f;
|
||||
}
|
||||
|
||||
static void bevel_build_poly(BMesh *bm, BevVert *bv)
|
||||
{
|
||||
bevel_build_poly_ex(bm, bv);
|
||||
}
|
||||
|
||||
static void bevel_build_trifan(BMesh *bm, BevVert *bv)
|
||||
{
|
||||
BMFace *f;
|
||||
BLI_assert(next_bev(bv, NULL)->seg == 1 || bv->selcount == 1);
|
||||
|
||||
f = bevel_build_poly_ex(bm, bv);
|
||||
f = bevel_build_poly(bm, bv);
|
||||
|
||||
if (f) {
|
||||
/* we have a polygon which we know starts at the previous vertex, make it into a fan */
|
||||
@ -1598,7 +1793,7 @@ static void bevel_build_quadstrip(BMesh *bm, BevVert *bv)
|
||||
BMFace *f;
|
||||
BLI_assert(bv->selcount == 2);
|
||||
|
||||
f = bevel_build_poly_ex(bm, bv);
|
||||
f = bevel_build_poly(bm, bv);
|
||||
|
||||
if (f) {
|
||||
/* we have a polygon which we know starts at this vertex, make it into strips */
|
||||
@ -1871,14 +2066,6 @@ static void bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
|
||||
}
|
||||
}
|
||||
|
||||
/* do later when we loop over edges */
|
||||
#if 0
|
||||
/* clear BEVEL_EDGE_TAG now that we are finished with it*/
|
||||
for (i = 0; i < ntot; i++) {
|
||||
BM_BEVEL_EDGE_TAG_DISABLE(bv->edges[i].e);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* if edge array doesn't go CCW around vertex from average normal side,
|
||||
* reverse the array, being careful to reverse face pointers too */
|
||||
if (ntot > 1) {
|
||||
@ -1903,6 +2090,10 @@ static void bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
|
||||
e->next = &bv->edges[(i + 1) % ntot];
|
||||
e->prev = &bv->edges[(i + ntot - 1) % ntot];
|
||||
BM_BEVEL_EDGE_TAG_DISABLE(e->e);
|
||||
if (e->fprev && e->fnext)
|
||||
e->is_seam = !contig_ldata_across_edge(bm, e->e, e->fprev, e->fnext);
|
||||
else
|
||||
e->is_seam = true;
|
||||
}
|
||||
|
||||
build_boundary(bp, bv);
|
||||
@ -1922,7 +2113,9 @@ static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
|
||||
int do_rebuild = FALSE;
|
||||
BMVert *bmv;
|
||||
BMVert **vv = NULL;
|
||||
BMVert **vv_fix = NULL;
|
||||
BLI_array_staticdeclare(vv, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
BLI_array_staticdeclare(vv_fix, BM_DEFAULT_NGON_STACK_SIZE);
|
||||
|
||||
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
|
||||
if (BM_elem_flag_test(l->v, BM_ELEM_TAG)) {
|
||||
@ -1947,6 +2140,9 @@ static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
|
||||
for (k = 1; k < e->seg; k++) {
|
||||
bmv = mesh_vert(vm, i, 0, k)->v;
|
||||
BLI_array_append(vv, bmv);
|
||||
/* may want to merge UVs of these later */
|
||||
if (!e->is_seam)
|
||||
BLI_array_append(vv_fix, bmv);
|
||||
}
|
||||
}
|
||||
else if (bp->vertex_only && vm->mesh_kind == M_ADJ_SUBDIV && vm->seg > 1) {
|
||||
@ -1968,7 +2164,11 @@ static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
|
||||
}
|
||||
}
|
||||
if (do_rebuild) {
|
||||
BMFace *f_new = bev_create_ngon(bm, vv, BLI_array_count(vv), f);
|
||||
BMFace *f_new = bev_create_ngon(bm, vv, BLI_array_count(vv), NULL, f, true);
|
||||
|
||||
for (k = 0; k < BLI_array_count(vv_fix); k++) {
|
||||
bev_merge_uvs(bm, vv_fix[k]);
|
||||
}
|
||||
|
||||
/* don't select newly created boundary faces... */
|
||||
if (f_new) {
|
||||
@ -2002,6 +2202,17 @@ static void bevel_rebuild_existing_polygons(BMesh *bm, BevelParams *bp, BMVert *
|
||||
}
|
||||
}
|
||||
|
||||
static void bev_merge_end_uvs(BMesh *bm, BevVert *bv, EdgeHalf *e)
|
||||
{
|
||||
VMesh *vm = bv->vmesh;
|
||||
int i, k, nseg;
|
||||
|
||||
nseg = e->seg;
|
||||
i = e->leftv->index;
|
||||
for (k = 1; k < nseg; k++) {
|
||||
bev_merge_uvs(bm, mesh_vert(vm, i, 0, k)->v);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Build the polygons along the selected Edge
|
||||
@ -2013,7 +2224,7 @@ static void bevel_build_edge_polygons(BMesh *bm, BevelParams *bp, BMEdge *bme)
|
||||
VMesh *vm1, *vm2;
|
||||
EdgeHalf *e1, *e2;
|
||||
BMFace *f1, *f2, *f;
|
||||
int k, nseg, i1, i2;
|
||||
int k, nseg, i1, i2, odd, mid;
|
||||
|
||||
if (!BM_edge_is_manifold(bme))
|
||||
return;
|
||||
@ -2044,11 +2255,11 @@ static void bevel_build_edge_polygons(BMesh *bm, BevelParams *bp, BMEdge *bme)
|
||||
|
||||
BLI_assert(bmv1 && bmv2 && bmv3 && bmv4);
|
||||
|
||||
f1 = boundvert_rep_face(e1->leftv);
|
||||
f2 = boundvert_rep_face(e1->rightv);
|
||||
f1 = e1->fprev;
|
||||
f2 = e1->fnext;
|
||||
|
||||
if (nseg == 1) {
|
||||
bev_create_quad_tri(bm, bmv1, bmv2, bmv3, bmv4, f1);
|
||||
bev_create_quad_straddle(bm, bmv1, bmv2, bmv3, bmv4, f1, f2, e1->is_seam);
|
||||
}
|
||||
else {
|
||||
i1 = e1->leftv->index;
|
||||
@ -2057,15 +2268,32 @@ static void bevel_build_edge_polygons(BMesh *bm, BevelParams *bp, BMEdge *bme)
|
||||
vm2 = bv2->vmesh;
|
||||
bmv1i = bmv1;
|
||||
bmv2i = bmv2;
|
||||
odd = nseg % 2;
|
||||
mid = nseg / 2;
|
||||
for (k = 1; k <= nseg; k++) {
|
||||
bmv4i = mesh_vert(vm1, i1, 0, k)->v;
|
||||
bmv3i = mesh_vert(vm2, i2, 0, nseg - k)->v;
|
||||
f = (k <= nseg / 2 + (nseg % 2)) ? f1 : f2;
|
||||
bev_create_quad_tri(bm, bmv1i, bmv2i, bmv3i, bmv4i, f);
|
||||
if (odd && k == mid + 1) {
|
||||
bev_create_quad_straddle(bm, bmv1i, bmv2i, bmv3i, bmv4i, f1, f2, e1->is_seam);
|
||||
}
|
||||
else {
|
||||
f = (k <= mid) ? f1 : f2;
|
||||
bev_create_quad_tri(bm, bmv1i, bmv2i, bmv3i, bmv4i, f, true);
|
||||
}
|
||||
bmv1i = bmv4i;
|
||||
bmv2i = bmv3i;
|
||||
}
|
||||
if (!odd && !e1->is_seam) {
|
||||
bev_merge_uvs(bm, mesh_vert(vm1, i1, 0, mid)->v);
|
||||
bev_merge_uvs(bm, mesh_vert(vm2, i2, 0, mid)->v);
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix UVs along end edge joints. A nop unless other side built already. */
|
||||
if (!e1->is_seam && bv1->vmesh->mesh_kind == M_NONE)
|
||||
bev_merge_end_uvs(bm, bv1, e1);
|
||||
if (!e2->is_seam && bv2->vmesh->mesh_kind == M_NONE)
|
||||
bev_merge_end_uvs(bm, bv2, e2);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2150,7 +2378,7 @@ void BM_mesh_bevel(BMesh *bm, const float offset, const float segments,
|
||||
if (limit_offset)
|
||||
bp.offset = bevel_limit_offset(bm, &bp);
|
||||
|
||||
/* The analysis of the input vertices and execution additional constructions */
|
||||
/* Analyze input vertices and build vertex meshes */
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
|
||||
bevel_vert_construct(bm, &bp, v);
|
||||
@ -2166,6 +2394,7 @@ void BM_mesh_bevel(BMesh *bm, const float offset, const float segments,
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild face polygons around affected vertices */
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
|
||||
bevel_rebuild_existing_polygons(bm, &bp, v);
|
||||
|
@ -42,12 +42,14 @@ void WrapOperation::deinitExecution()
|
||||
|
||||
inline float WrapOperation::getWrappedOriginalXPos(float x)
|
||||
{
|
||||
if (this->getWidth() == 0) return 0;
|
||||
while (x < 0) x += this->m_width;
|
||||
return fmodf(x, this->getWidth());
|
||||
}
|
||||
|
||||
inline float WrapOperation::getWrappedOriginalYPos(float y)
|
||||
{
|
||||
if (this->getHeight() == 0) return 0;
|
||||
while (y < 0) y += this->m_height;
|
||||
return fmodf(y, this->getHeight());
|
||||
}
|
||||
|
@ -15,15 +15,7 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* editarmature.c: Interface for creating and posing armature objects
|
||||
*/
|
||||
|
||||
/** \file blender/editors/armature/editarmature_generate.c
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,13 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
* BIF_meshlaplacian.h: Algorithms using the mesh laplacian.
|
||||
*/
|
||||
|
@ -82,6 +82,8 @@ void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const int ax
|
||||
const bool use_self, const bool use_select, const bool use_toplogy);
|
||||
void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to);
|
||||
struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
|
||||
struct BMEdge *EDBM_verts_mirror_get_edge(struct BMEditMesh *em, struct BMEdge *e);
|
||||
struct BMFace *EDBM_verts_mirror_get_face(struct BMEditMesh *em, struct BMFace *f);
|
||||
void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
|
||||
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em);
|
||||
|
||||
@ -202,7 +204,7 @@ void paintface_flush_flags(struct Object *ob);
|
||||
bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, bool select, bool extend);
|
||||
void paintface_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
|
||||
void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], int mode);
|
||||
void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], const bool select);
|
||||
bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
|
||||
|
||||
void paintface_hide(struct Object *ob, const bool unselected);
|
||||
@ -281,6 +283,8 @@ bool ED_mesh_color_remove_active(struct Mesh *me);
|
||||
bool ED_mesh_color_remove_named(struct Mesh *me, const char *name);
|
||||
|
||||
void ED_mesh_report_mirror(struct wmOperator *op, int totmirr, int totfail);
|
||||
void ED_mesh_report_mirror_ex(struct wmOperator *op, int totmirr, int totfail,
|
||||
char selectmode);
|
||||
|
||||
/* mesh backup */
|
||||
typedef struct BMBackup {
|
||||
|
@ -5317,7 +5317,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
|
||||
/* this should become disabled button .. */
|
||||
if (but->lock == true) {
|
||||
if (but->lockstr) {
|
||||
BKE_report(NULL, RPT_WARNING, but->lockstr);
|
||||
WM_report(C, RPT_INFO, but->lockstr);
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
return WM_UI_HANDLER_BREAK;
|
||||
}
|
||||
@ -5740,6 +5740,10 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
|
||||
}
|
||||
else if (data->state == BUTTON_STATE_NUM_EDITING) {
|
||||
ui_numedit_end(but, data);
|
||||
|
||||
if (but->flag & UI_BUT_DRIVEN)
|
||||
WM_report(C, RPT_INFO, "Can't edit driven number value, see graph editor for the driver setup.");
|
||||
|
||||
if (ui_is_a_warp_but(but)) {
|
||||
|
||||
#ifdef USE_CONT_MOUSE_CORRECT
|
||||
|
@ -2048,8 +2048,8 @@ void init_userdef_do_versions(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Freestyle color settings */
|
||||
{
|
||||
if (U.versionfile < 267) {
|
||||
/* Freestyle color settings */
|
||||
bTheme *btheme;
|
||||
|
||||
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
|
||||
@ -2063,50 +2063,50 @@ void init_userdef_do_versions(void)
|
||||
rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* GL Texture Garbage Collection (variable abused above!) */
|
||||
if (U.textimeout == 0) {
|
||||
U.texcollectrate = 60;
|
||||
U.textimeout = 120;
|
||||
}
|
||||
if (U.memcachelimit <= 0) {
|
||||
U.memcachelimit = 32;
|
||||
}
|
||||
if (U.frameserverport == 0) {
|
||||
U.frameserverport = 8080;
|
||||
}
|
||||
if (U.dbl_click_time == 0) {
|
||||
U.dbl_click_time = 350;
|
||||
}
|
||||
if (U.scrcastfps == 0) {
|
||||
U.scrcastfps = 10;
|
||||
U.scrcastwait = 50;
|
||||
}
|
||||
if (U.v2d_min_gridsize == 0) {
|
||||
U.v2d_min_gridsize = 35;
|
||||
}
|
||||
if (U.dragthreshold == 0)
|
||||
U.dragthreshold = 5;
|
||||
if (U.widget_unit == 0)
|
||||
U.widget_unit = 20;
|
||||
if (U.anisotropic_filter <= 0)
|
||||
U.anisotropic_filter = 1;
|
||||
/* GL Texture Garbage Collection */
|
||||
if (U.textimeout == 0) {
|
||||
U.texcollectrate = 60;
|
||||
U.textimeout = 120;
|
||||
}
|
||||
if (U.memcachelimit <= 0) {
|
||||
U.memcachelimit = 32;
|
||||
}
|
||||
if (U.frameserverport == 0) {
|
||||
U.frameserverport = 8080;
|
||||
}
|
||||
if (U.dbl_click_time == 0) {
|
||||
U.dbl_click_time = 350;
|
||||
}
|
||||
if (U.scrcastfps == 0) {
|
||||
U.scrcastfps = 10;
|
||||
U.scrcastwait = 50;
|
||||
}
|
||||
if (U.v2d_min_gridsize == 0) {
|
||||
U.v2d_min_gridsize = 35;
|
||||
}
|
||||
if (U.dragthreshold == 0)
|
||||
U.dragthreshold = 5;
|
||||
if (U.widget_unit == 0)
|
||||
U.widget_unit = 20;
|
||||
if (U.anisotropic_filter <= 0)
|
||||
U.anisotropic_filter = 1;
|
||||
|
||||
if (U.ndof_sensitivity == 0.0f) {
|
||||
U.ndof_sensitivity = 1.0f;
|
||||
U.ndof_flag = NDOF_LOCK_HORIZON |
|
||||
NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
|
||||
}
|
||||
|
||||
if (U.ndof_orbit_sensitivity == 0.0f) {
|
||||
U.ndof_orbit_sensitivity = U.ndof_sensitivity;
|
||||
if (U.ndof_sensitivity == 0.0f) {
|
||||
U.ndof_sensitivity = 1.0f;
|
||||
U.ndof_flag = NDOF_LOCK_HORIZON |
|
||||
NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
|
||||
}
|
||||
|
||||
if (U.ndof_orbit_sensitivity == 0.0f) {
|
||||
U.ndof_orbit_sensitivity = U.ndof_sensitivity;
|
||||
|
||||
if (!(U.flag & USER_TRACKBALL))
|
||||
U.ndof_flag |= NDOF_TURNTABLE;
|
||||
if (!(U.flag & USER_TRACKBALL))
|
||||
U.ndof_flag |= NDOF_TURNTABLE;
|
||||
}
|
||||
if (U.tweak_threshold == 0)
|
||||
U.tweak_threshold = 10;
|
||||
}
|
||||
if (U.tweak_threshold == 0)
|
||||
U.tweak_threshold = 10;
|
||||
|
||||
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 1)) {
|
||||
bTheme *btheme;
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
@ -33,6 +30,7 @@
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_edgehash.h"
|
||||
#include "BLI_bitmap.h"
|
||||
|
||||
#include "BLF_translation.h"
|
||||
|
||||
@ -47,6 +45,7 @@
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_editmesh.h"
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
#include "BIF_gl.h"
|
||||
|
||||
@ -185,29 +184,22 @@ void paintface_reveal(Object *ob)
|
||||
|
||||
/* Set tface seams based on edge data, uses hash table to find seam edges. */
|
||||
|
||||
static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index)
|
||||
static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index, const bool select)
|
||||
{
|
||||
EdgeHash *ehash, *seamhash;
|
||||
MPoly *mp;
|
||||
MLoop *ml;
|
||||
MEdge *med;
|
||||
char *linkflag;
|
||||
int a, b, mark = 0;
|
||||
int a, b;
|
||||
bool do_it = true;
|
||||
bool mark = false;
|
||||
|
||||
ehash = BLI_edgehash_new();
|
||||
seamhash = BLI_edgehash_new();
|
||||
linkflag = MEM_callocN(sizeof(char) * me->totpoly, "linkflaguv");
|
||||
BLI_bitmap edge_tag = BLI_BITMAP_NEW(me->totedge, __func__);
|
||||
BLI_bitmap poly_tag = BLI_BITMAP_NEW(me->totpoly, __func__);
|
||||
|
||||
for (med = me->medge, a = 0; a < me->totedge; a++, med++)
|
||||
if (med->flag & ME_SEAM)
|
||||
BLI_edgehash_insert(seamhash, med->v1, med->v2, NULL);
|
||||
|
||||
if (mode == 0 || mode == 1) {
|
||||
if (index != (unsigned int)-1) {
|
||||
/* only put face under cursor in array */
|
||||
mp = ((MPoly *)me->mpoly) + index;
|
||||
BKE_mesh_poly_edgehash_insert(ehash, mp, me->mloop + mp->loopstart);
|
||||
linkflag[index] = 1;
|
||||
mp = &me->mpoly[index];
|
||||
BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart);
|
||||
BLI_BITMAP_SET(poly_tag, index);
|
||||
}
|
||||
else {
|
||||
/* fill array by selection */
|
||||
@ -217,8 +209,8 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
|
||||
/* pass */
|
||||
}
|
||||
else if (mp->flag & ME_FACE_SEL) {
|
||||
BKE_mesh_poly_edgehash_insert(ehash, mp, me->mloop + mp->loopstart);
|
||||
linkflag[a] = 1;
|
||||
BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart);
|
||||
BLI_BITMAP_SET(poly_tag, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -232,75 +224,54 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
|
||||
if (mp->flag & ME_HIDE)
|
||||
continue;
|
||||
|
||||
if (!linkflag[a]) {
|
||||
MLoop *mnextl;
|
||||
mark = 0;
|
||||
if (!BLI_BITMAP_GET(poly_tag, a)) {
|
||||
mark = false;
|
||||
|
||||
ml = me->mloop + mp->loopstart;
|
||||
for (b = 0; b < mp->totloop; b++, ml++) {
|
||||
mnextl = b < mp->totloop - 1 ? ml - 1 : me->mloop + mp->loopstart;
|
||||
if (!BLI_edgehash_haskey(seamhash, ml->v, mnextl->v))
|
||||
if (!BLI_edgehash_haskey(ehash, ml->v, mnextl->v))
|
||||
mark = 1;
|
||||
if ((me->medge[ml->e].flag & ME_SEAM) == 0) {
|
||||
if (BLI_BITMAP_GET(edge_tag, ml->e)) {
|
||||
mark = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mark) {
|
||||
linkflag[a] = 1;
|
||||
BKE_mesh_poly_edgehash_insert(ehash, mp, me->mloop + mp->loopstart);
|
||||
BLI_BITMAP_SET(poly_tag, a);
|
||||
BKE_mesh_poly_edgebitmap_insert(edge_tag, mp, me->mloop + mp->loopstart);
|
||||
do_it = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BLI_edgehash_free(ehash, NULL);
|
||||
BLI_edgehash_free(seamhash, NULL);
|
||||
MEM_freeN(edge_tag);
|
||||
|
||||
if (mode == 0 || mode == 2) {
|
||||
for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++)
|
||||
if (linkflag[a])
|
||||
mp->flag |= ME_FACE_SEL;
|
||||
else
|
||||
mp->flag &= ~ME_FACE_SEL;
|
||||
}
|
||||
else if (mode == 1) {
|
||||
for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++)
|
||||
if (linkflag[a] && (mp->flag & ME_FACE_SEL))
|
||||
break;
|
||||
|
||||
if (a < me->totpoly) {
|
||||
for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++)
|
||||
if (linkflag[a])
|
||||
mp->flag &= ~ME_FACE_SEL;
|
||||
}
|
||||
else {
|
||||
for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++)
|
||||
if (linkflag[a])
|
||||
mp->flag |= ME_FACE_SEL;
|
||||
for (a = 0, mp = me->mpoly; a < me->totpoly; a++, mp++) {
|
||||
if (BLI_BITMAP_GET(poly_tag, a)) {
|
||||
BKE_BIT_TEST_SET(mp->flag, select, ME_FACE_SEL);
|
||||
}
|
||||
}
|
||||
|
||||
MEM_freeN(linkflag);
|
||||
MEM_freeN(poly_tag);
|
||||
}
|
||||
|
||||
void paintface_select_linked(bContext *UNUSED(C), Object *ob, const int UNUSED(mval[2]), int mode)
|
||||
void paintface_select_linked(bContext *C, Object *ob, const int mval[2], const bool select)
|
||||
{
|
||||
Mesh *me;
|
||||
unsigned int index = 0;
|
||||
unsigned int index = (unsigned int)-1;
|
||||
|
||||
me = BKE_mesh_from_object(ob);
|
||||
if (me == NULL || me->totpoly == 0) return;
|
||||
|
||||
if (mode == 0 || mode == 1) {
|
||||
/* XXX - Causes glitches, not sure why */
|
||||
#if 0
|
||||
if (!ED_mesh_pick_face(C, me, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE))
|
||||
if (mval) {
|
||||
if (!ED_mesh_pick_face(C, ob, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE)) {
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
select_linked_tfaces_with_seams(mode, me, index);
|
||||
select_linked_tfaces_with_seams(me, index, select);
|
||||
|
||||
paintface_flush_flags(ob);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void EDBM_select_mirrored(BMEditMesh *em, bool extend,
|
||||
int *r_totmirr, int *r_totfail)
|
||||
{
|
||||
Mesh *me = (Mesh *)em->ob->data;
|
||||
BMVert *v1, *v2;
|
||||
BMesh *bm = em->bm;
|
||||
BMIter iter;
|
||||
int totmirr = 0;
|
||||
int totfail = 0;
|
||||
@ -86,12 +86,23 @@ void EDBM_select_mirrored(BMEditMesh *em, bool extend,
|
||||
|
||||
*r_totmirr = *r_totfail = 0;
|
||||
|
||||
BM_ITER_MESH (v1, &iter, em->bm, BM_VERTS_OF_MESH) {
|
||||
if (!BM_elem_flag_test(v1, BM_ELEM_SELECT) || BM_elem_flag_test(v1, BM_ELEM_HIDDEN)) {
|
||||
BM_elem_flag_disable(v1, BM_ELEM_TAG);
|
||||
/* select -> tag */
|
||||
if (bm->selectmode & SCE_SELECT_VERTEX) {
|
||||
BMVert *v;
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
BM_elem_flag_set(v, BM_ELEM_TAG, BM_elem_flag_test(v, BM_ELEM_SELECT));
|
||||
}
|
||||
else {
|
||||
BM_elem_flag_enable(v1, BM_ELEM_TAG);
|
||||
}
|
||||
else if (em->selectmode & SCE_SELECT_EDGE) {
|
||||
BMEdge *e;
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
BM_elem_flag_set(e, BM_ELEM_TAG, BM_elem_flag_test(e, BM_ELEM_SELECT));
|
||||
}
|
||||
}
|
||||
else {
|
||||
BMFace *f;
|
||||
BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
|
||||
BM_elem_flag_set(f, BM_ELEM_TAG, BM_elem_flag_test(f, BM_ELEM_SELECT));
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,19 +111,50 @@ void EDBM_select_mirrored(BMEditMesh *em, bool extend,
|
||||
if (!extend)
|
||||
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
|
||||
|
||||
BM_ITER_MESH (v1, &iter, em->bm, BM_VERTS_OF_MESH) {
|
||||
if (!BM_elem_flag_test(v1, BM_ELEM_TAG) || BM_elem_flag_test(v1, BM_ELEM_HIDDEN))
|
||||
continue;
|
||||
|
||||
v2 = EDBM_verts_mirror_get(em, v1);
|
||||
if (v2) {
|
||||
if (!BM_elem_flag_test(v2, BM_ELEM_HIDDEN)) {
|
||||
BM_vert_select_set(em->bm, v2, true);
|
||||
totmirr++;
|
||||
if (bm->selectmode & SCE_SELECT_VERTEX) {
|
||||
BMVert *v;
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && BM_elem_flag_test(v, BM_ELEM_TAG)) {
|
||||
BMVert *v_mirr = EDBM_verts_mirror_get(em, v);
|
||||
if (v_mirr && !BM_elem_flag_test(v_mirr, BM_ELEM_HIDDEN)) {
|
||||
BM_vert_select_set(bm, v_mirr, true);
|
||||
totmirr++;
|
||||
}
|
||||
else {
|
||||
totfail++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
totfail++;
|
||||
}
|
||||
else if (em->selectmode & SCE_SELECT_EDGE) {
|
||||
BMEdge *e;
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, BM_ELEM_TAG)) {
|
||||
BMEdge *e_mirr = EDBM_verts_mirror_get_edge(em, e);
|
||||
if (e_mirr && !BM_elem_flag_test(e_mirr, BM_ELEM_HIDDEN)) {
|
||||
BM_edge_select_set(bm, e_mirr, true);
|
||||
totmirr++;
|
||||
}
|
||||
else {
|
||||
totfail++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
BMFace *f;
|
||||
BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
|
||||
if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN) && BM_elem_flag_test(f, BM_ELEM_TAG)) {
|
||||
BMFace *f_mirr = EDBM_verts_mirror_get_face(em, f);
|
||||
if (f_mirr && !BM_elem_flag_test(f_mirr, BM_ELEM_HIDDEN)) {
|
||||
BM_face_select_set(bm, f_mirr, true);
|
||||
totmirr++;
|
||||
}
|
||||
else {
|
||||
totfail++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2215,13 +2257,14 @@ static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (em->bm->totvert && em->bm->totvertsel) {
|
||||
int totmirr, totfail;
|
||||
|
||||
EDBM_select_mirrored(em, extend, &totmirr, &totfail);
|
||||
if (totmirr) {
|
||||
EDBM_selectmode_flush(em);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||
}
|
||||
|
||||
ED_mesh_report_mirror(op, totmirr, totfail);
|
||||
ED_mesh_report_mirror_ex(op, totmirr, totfail, em->bm->selectmode);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_array.h"
|
||||
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_context.h"
|
||||
@ -1270,6 +1271,38 @@ BMVert *EDBM_verts_mirror_get(BMEditMesh *em, BMVert *v)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BMEdge *EDBM_verts_mirror_get_edge(BMEditMesh *em, BMEdge *e)
|
||||
{
|
||||
BMVert *v1_mirr = EDBM_verts_mirror_get(em, e->v1);
|
||||
if (v1_mirr) {
|
||||
BMVert *v2_mirr = EDBM_verts_mirror_get(em, e->v2);
|
||||
if (v2_mirr) {
|
||||
return BM_edge_exists(v1_mirr, v2_mirr);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BMFace *EDBM_verts_mirror_get_face(BMEditMesh *em, BMFace *f)
|
||||
{
|
||||
BMFace *f_mirr = NULL;
|
||||
BMVert **v_mirr_arr = BLI_array_alloca(v_mirr_arr, f->len);
|
||||
|
||||
BMLoop *l_iter, *l_first;
|
||||
unsigned int i = 0;
|
||||
|
||||
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
|
||||
do {
|
||||
if ((v_mirr_arr[i++] = EDBM_verts_mirror_get(em, l_iter->v)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
} while ((l_iter = l_iter->next) != l_first);
|
||||
|
||||
BM_face_exists(v_mirr_arr, f->len, &f_mirr);
|
||||
return f_mirr;
|
||||
}
|
||||
|
||||
void EDBM_verts_mirror_cache_clear(BMEditMesh *em, BMVert *v)
|
||||
{
|
||||
int *mirr = CustomData_bmesh_get_layer_n(&em->bm->vdata, v->head.data, em->mirror_cdlayer);
|
||||
|
@ -1244,12 +1244,30 @@ void ED_mesh_calc_tessface(Mesh *mesh)
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail)
|
||||
void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail,
|
||||
char selectmode)
|
||||
{
|
||||
if (totfail) {
|
||||
BKE_reportf(op->reports, RPT_WARNING, "%d vertices mirrored, %d failed", totmirr, totfail);
|
||||
const char *elem_type;
|
||||
|
||||
if (selectmode & SCE_SELECT_VERTEX) {
|
||||
elem_type = "vertices";
|
||||
}
|
||||
else if (selectmode & SCE_SELECT_EDGE) {
|
||||
elem_type = "edges";
|
||||
}
|
||||
else {
|
||||
BKE_reportf(op->reports, RPT_INFO, "%d vertices mirrored", totmirr);
|
||||
elem_type = "faces";
|
||||
}
|
||||
|
||||
if (totfail) {
|
||||
BKE_reportf(op->reports, RPT_WARNING, "%d %s mirrored, %d failed", totmirr, elem_type, totfail);
|
||||
}
|
||||
else {
|
||||
BKE_reportf(op->reports, RPT_INFO, "%d %s mirrored", totmirr, elem_type);
|
||||
}
|
||||
}
|
||||
|
||||
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail)
|
||||
{
|
||||
ED_mesh_report_mirror_ex(op, totmirr, totfail, SCE_SELECT_VERTEX);
|
||||
}
|
||||
|
@ -1472,14 +1472,18 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
|
||||
Material *ma = give_current_material(ob_src, a + 1);
|
||||
assign_material(ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */
|
||||
}
|
||||
DAG_id_tag_update(&ob_dst->id, 0);
|
||||
break;
|
||||
case MAKE_LINKS_ANIMDATA:
|
||||
BKE_copy_animdata_id((ID *)ob_dst, (ID *)ob_src, FALSE);
|
||||
if (obdata_id->lib) {
|
||||
is_lib = true;
|
||||
break;
|
||||
if (ob_dst->data && ob_src->data) {
|
||||
if (obdata_id->lib) {
|
||||
is_lib = true;
|
||||
break;
|
||||
}
|
||||
BKE_copy_animdata_id((ID *)ob_dst->data, (ID *)ob_src->data, FALSE);
|
||||
}
|
||||
BKE_copy_animdata_id((ID *)ob_dst->data, (ID *)ob_src->data, FALSE);
|
||||
DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
|
||||
break;
|
||||
case MAKE_LINKS_GROUP:
|
||||
{
|
||||
@ -1497,6 +1501,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
|
||||
is_cycle = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MAKE_LINKS_DUPLIGROUP:
|
||||
ob_dst->dup_group = ob_src->dup_group;
|
||||
|
@ -67,6 +67,7 @@
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_lattice.h"
|
||||
|
||||
#include "DNA_armature_types.h"
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
#include "RNA_enum_types.h"
|
||||
@ -2775,35 +2776,13 @@ static void vgroup_delete_edit_mode(Object *ob, bDeformGroup *dg)
|
||||
}
|
||||
}
|
||||
|
||||
static bool vgroup_object_in_edit_mode(Object *ob)
|
||||
{
|
||||
if (ob->type == OB_MESH)
|
||||
return (BKE_editmesh_from_object(ob) != NULL);
|
||||
else if (ob->type == OB_LATTICE)
|
||||
return (((Lattice *)ob->data)->editlatt != NULL);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool vgroup_object_in_wpaint_vert_select(Object *ob)
|
||||
{
|
||||
if (ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
return ( (ob->mode & OB_MODE_WEIGHT_PAINT) &&
|
||||
(me->edit_btmesh == NULL) &&
|
||||
(ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX) );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void vgroup_delete(Object *ob)
|
||||
{
|
||||
bDeformGroup *dg = BLI_findlink(&ob->defbase, ob->actdef - 1);
|
||||
if (!dg)
|
||||
return;
|
||||
|
||||
if (vgroup_object_in_edit_mode(ob))
|
||||
if (BKE_object_is_in_editmode_vgroup(ob))
|
||||
vgroup_delete_edit_mode(ob, dg);
|
||||
else
|
||||
vgroup_delete_object_mode(ob, dg);
|
||||
@ -2956,7 +2935,7 @@ static int UNUSED_FUNCTION(vertex_group_poll_edit) (bContext *C)
|
||||
if (!(ob && !ob->id.lib && data && !data->lib))
|
||||
return 0;
|
||||
|
||||
return vgroup_object_in_edit_mode(ob);
|
||||
return BKE_object_is_in_editmode_vgroup(ob);
|
||||
}
|
||||
|
||||
/* editmode _or_ weight paint vertex sel */
|
||||
@ -2968,8 +2947,8 @@ static int vertex_group_vert_select_poll(bContext *C)
|
||||
if (!(ob && !ob->id.lib && data && !data->lib))
|
||||
return 0;
|
||||
|
||||
return (vgroup_object_in_edit_mode(ob) ||
|
||||
vgroup_object_in_wpaint_vert_select(ob));
|
||||
return (BKE_object_is_in_editmode_vgroup(ob) ||
|
||||
BKE_object_is_in_wpaint_select_vert(ob));
|
||||
}
|
||||
|
||||
/* editmode _or_ weight paint vertex sel and active group unlocked */
|
||||
@ -2981,8 +2960,8 @@ static int vertex_group_vert_select_unlocked_poll(bContext *C)
|
||||
if (!(ob && !ob->id.lib && data && !data->lib))
|
||||
return 0;
|
||||
|
||||
if (!(vgroup_object_in_edit_mode(ob) ||
|
||||
vgroup_object_in_wpaint_vert_select(ob)))
|
||||
if (!(BKE_object_is_in_editmode_vgroup(ob) ||
|
||||
BKE_object_is_in_wpaint_select_vert(ob)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -3008,8 +2987,8 @@ static int vertex_group_vert_select_mesh_poll(bContext *C)
|
||||
if (ob->type != OB_MESH)
|
||||
return 0;
|
||||
|
||||
return (vgroup_object_in_edit_mode(ob) ||
|
||||
vgroup_object_in_wpaint_vert_select(ob));
|
||||
return (BKE_object_is_in_editmode_vgroup(ob) ||
|
||||
BKE_object_is_in_wpaint_select_vert(ob));
|
||||
}
|
||||
|
||||
static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
@ -3076,7 +3055,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
|
||||
RNA_def_boolean(ot->srna, "all", 0, "All", "Remove all vertex groups");
|
||||
}
|
||||
|
||||
static int vertex_group_assign_exec(bContext *C, wmOperator *op)
|
||||
static int vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Object *ob = ED_object_context(C);
|
||||
@ -3513,7 +3492,7 @@ static int vertex_group_blend_poll(bContext *C)
|
||||
if (!(ob && !ob->id.lib && data && !data->lib))
|
||||
return false;
|
||||
|
||||
if (vgroup_object_in_edit_mode(ob)) {
|
||||
if (BKE_object_is_in_editmode_vgroup(ob)) {
|
||||
return true;
|
||||
}
|
||||
else if ((ob->type == OB_MESH) && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
|
||||
@ -3770,55 +3749,74 @@ static int vertex_group_transfer_weight_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob_act = CTX_data_active_object(C);
|
||||
bDeformGroup *dg_src;
|
||||
int fail = 0;
|
||||
bool change = false;
|
||||
|
||||
WT_VertexGroupMode vertex_group_mode = RNA_enum_get(op->ptr, "WT_vertex_group_mode");
|
||||
WT_Method method = RNA_enum_get(op->ptr, "WT_method");
|
||||
WT_ReplaceMode replace_mode = RNA_enum_get(op->ptr, "WT_replace_mode");
|
||||
WT_VertexGroupMode vertex_group_mode = RNA_enum_get(op->ptr, "group_select_mode");
|
||||
WT_Method method = RNA_enum_get(op->ptr, "method");
|
||||
WT_ReplaceMode replace_mode = RNA_enum_get(op->ptr, "replace_mode");
|
||||
|
||||
/* Macro to loop through selected objects and perform operation depending on function, option and method.*/
|
||||
CTX_DATA_BEGIN (C, Object *, ob_slc, selected_editable_objects)
|
||||
CTX_DATA_BEGIN (C, Object *, ob_src, selected_editable_objects)
|
||||
{
|
||||
if (ob_act != ob_src) {
|
||||
|
||||
if (ob_src->defbase.first == NULL) {
|
||||
BKE_reportf(op->reports, RPT_WARNING,
|
||||
"Skipping object '%s' it has no vertex groups", ob_src->id.name + 2);
|
||||
continue;
|
||||
}
|
||||
else if (ob_src->type != OB_MESH) {
|
||||
BKE_reportf(op->reports, RPT_WARNING,
|
||||
"Skipping object '%s' only copying from meshes is supported", ob_src->id.name + 2);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ob_act != ob_slc && ob_slc->defbase.first) {
|
||||
switch (vertex_group_mode) {
|
||||
|
||||
case WT_REPLACE_ACTIVE_VERTEX_GROUP:
|
||||
if (!ed_vgroup_transfer_weight(ob_act, ob_slc, BLI_findlink(&ob_slc->defbase, ob_slc->actdef - 1),
|
||||
scene, method, replace_mode, op))
|
||||
{
|
||||
{
|
||||
bDeformGroup *dg_src;
|
||||
dg_src = BLI_findlink(&ob_src->defbase, ob_src->actdef - 1);
|
||||
if (ed_vgroup_transfer_weight(ob_act, ob_src, dg_src, scene, method, replace_mode, op)) {
|
||||
change = true;
|
||||
}
|
||||
else {
|
||||
fail++;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case WT_REPLACE_ALL_VERTEX_GROUPS:
|
||||
for (dg_src = ob_slc->defbase.first; dg_src; dg_src = dg_src->next) {
|
||||
if (!ed_vgroup_transfer_weight(ob_act, ob_slc, dg_src, scene, method, replace_mode, op)) {
|
||||
{
|
||||
bDeformGroup *dg_src;
|
||||
for (dg_src = ob_src->defbase.first; dg_src; dg_src = dg_src->next) {
|
||||
if (ed_vgroup_transfer_weight(ob_act, ob_src, dg_src, scene, method, replace_mode, op)) {
|
||||
change = true;
|
||||
}
|
||||
else {
|
||||
fail++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
BLI_assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Event notifiers for correct display of data.*/
|
||||
DAG_id_tag_update(&ob_slc->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob_slc);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob_slc->data);
|
||||
|
||||
CTX_DATA_END;
|
||||
|
||||
if (fail != 0) {
|
||||
return OPERATOR_CANCELLED;
|
||||
if (change) {
|
||||
/* Event notifiers for correct display of data.*/
|
||||
DAG_id_tag_update(&ob_act->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob_act);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
else {
|
||||
return OPERATOR_FINISHED;
|
||||
BKE_report(op->reports, RPT_WARNING, "Failed, no other selected objects with vertex groups found.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3831,16 +3829,17 @@ void OBJECT_OT_vertex_group_transfer_weight(wmOperatorType *ot)
|
||||
ot->description = "Transfer weight paint to active from selected mesh";
|
||||
|
||||
/* API callbacks.*/
|
||||
ot->poll = vertex_group_poll;
|
||||
ot->poll = vertex_group_mesh_poll;
|
||||
ot->exec = vertex_group_transfer_weight_exec;
|
||||
|
||||
/* Flags.*/
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* Properties.*/
|
||||
ot->prop = RNA_def_enum(ot->srna, "WT_vertex_group_mode", WT_vertex_group_mode_item, 1, "Group", "");
|
||||
ot->prop = RNA_def_enum(ot->srna, "WT_method", WT_method_item, 3, "Method", "");
|
||||
ot->prop = RNA_def_enum(ot->srna, "WT_replace_mode", WT_replace_mode_item, 1, "Replace", "");
|
||||
/* TODO, use vgroup_operator_subset_select_props for group_select_mode */
|
||||
ot->prop = RNA_def_enum(ot->srna, "group_select_mode", WT_vertex_group_mode_item, WT_REPLACE_ACTIVE_VERTEX_GROUP, "Group", "");
|
||||
ot->prop = RNA_def_enum(ot->srna, "method", WT_method_item, WT_BY_NEAREST_FACE, "Method", "");
|
||||
ot->prop = RNA_def_enum(ot->srna, "replace_mode", WT_replace_mode_item, WT_REPLACE_ALL_WEIGHTS, "Replace", "");
|
||||
}
|
||||
|
||||
static int set_active_group_exec(bContext *C, wmOperator *op)
|
||||
|
@ -1295,7 +1295,10 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "PAINT_OT_face_select_reveal", HKEY, KM_PRESS, KM_ALT, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0);
|
||||
kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", false);
|
||||
kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", true);
|
||||
|
||||
keymap = WM_keymap_find(keyconf, "UV Sculpt", 0, 0);
|
||||
keymap->poll = uv_sculpt_poll;
|
||||
|
@ -431,8 +431,9 @@ void PAINT_OT_face_select_linked(wmOperatorType *ot)
|
||||
|
||||
static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
int mode = RNA_boolean_get(op->ptr, "extend") ? 1 : 0;
|
||||
paintface_select_linked(C, CTX_data_active_object(C), event->mval, mode);
|
||||
const bool select = !RNA_boolean_get(op->ptr, "deselect");
|
||||
view3d_operator_needs_opengl(C);
|
||||
paintface_select_linked(C, CTX_data_active_object(C), event->mval, select);
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -448,7 +449,7 @@ void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
|
||||
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the existing selection");
|
||||
RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items");
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,13 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
@ -14,13 +14,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
@ -14,13 +14,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
@ -14,13 +14,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
@ -770,14 +770,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
|
||||
}
|
||||
#undef NBR_TRANSFORM_PROPERTIES
|
||||
|
||||
|
||||
#define B_VGRP_PNL_COPY 1
|
||||
#define B_VGRP_PNL_NORMALIZE 2
|
||||
#define B_VGRP_PNL_TOGGLE_USE_ALL 4
|
||||
#define B_VGRP_PNL_EDIT_SINGLE 8 /* or greater */
|
||||
#define B_VGRP_PNL_DELETE_SINGLE 4096 /* or greater */
|
||||
#define B_VGRP_PNL_COPY_SINGLE 8192 /* or greater */
|
||||
#define B_VGRP_PNL_ACTIVE 16384 /* or greater */
|
||||
|
||||
static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
|
||||
{
|
||||
@ -798,7 +791,9 @@ static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = OBACT;
|
||||
if (ob && ((ob->mode & OB_MODE_EDIT) || (ob->mode & OB_MODE_WEIGHT_PAINT))) {
|
||||
if (ob && (BKE_object_is_in_editmode_vgroup(ob) ||
|
||||
BKE_object_is_in_wpaint_select_vert(ob)))
|
||||
{
|
||||
MDeformVert *dvert_act = ED_mesh_active_dvert_get_only(ob);
|
||||
if (dvert_act) {
|
||||
return (dvert_act->totweight != 0);
|
||||
|
@ -310,8 +310,9 @@ float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3], bool *r_f
|
||||
* \param ar The region (used for the window width and height).
|
||||
* \param v3d The 3d viewport (used for near clipping value).
|
||||
* \param mval The area relative 2d location (such as event->mval, converted into float[2]).
|
||||
* \param ray_start The world-space starting point of the segment.
|
||||
* \param ray_normal The normalized world-space direction of towards mval.
|
||||
* \param r_ray_start The world-space starting point of the segment.
|
||||
* \param r_ray_normal The normalized world-space direction of towards mval.
|
||||
* \param do_clip Optionally clip the ray by the view clipping planes.
|
||||
* \return success, false if the segment is totally clipped.
|
||||
*/
|
||||
bool ED_view3d_win_to_ray(const ARegion *ar, View3D *v3d, const float mval[2],
|
||||
@ -504,7 +505,7 @@ void ED_view3d_win_to_vector(const ARegion *ar, const float mval[2], float out[3
|
||||
* \return success, false if the segment is totally clipped.
|
||||
*/
|
||||
bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2],
|
||||
float ray_start[3], float ray_end[3], const bool do_clip)
|
||||
float r_ray_start[3], float r_ray_end[3], const bool do_clip)
|
||||
{
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
|
||||
@ -512,9 +513,9 @@ bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2
|
||||
float vec[3];
|
||||
ED_view3d_win_to_vector(ar, mval, vec);
|
||||
|
||||
copy_v3_v3(ray_start, rv3d->viewinv[3]);
|
||||
madd_v3_v3v3fl(ray_start, rv3d->viewinv[3], vec, v3d->near);
|
||||
madd_v3_v3v3fl(ray_end, rv3d->viewinv[3], vec, v3d->far);
|
||||
copy_v3_v3(r_ray_start, rv3d->viewinv[3]);
|
||||
madd_v3_v3v3fl(r_ray_start, rv3d->viewinv[3], vec, v3d->near);
|
||||
madd_v3_v3v3fl(r_ray_end, rv3d->viewinv[3], vec, v3d->far);
|
||||
}
|
||||
else {
|
||||
float vec[4];
|
||||
@ -525,13 +526,13 @@ bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2
|
||||
|
||||
mul_m4_v4(rv3d->persinv, vec);
|
||||
|
||||
madd_v3_v3v3fl(ray_start, vec, rv3d->viewinv[2], 1000.0f);
|
||||
madd_v3_v3v3fl(ray_end, vec, rv3d->viewinv[2], -1000.0f);
|
||||
madd_v3_v3v3fl(r_ray_start, vec, rv3d->viewinv[2], 1000.0f);
|
||||
madd_v3_v3v3fl(r_ray_end, vec, rv3d->viewinv[2], -1000.0f);
|
||||
}
|
||||
|
||||
/* bounds clipping */
|
||||
if (do_clip && (rv3d->rflag & RV3D_CLIPPING)) {
|
||||
if (clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6) == false) {
|
||||
if (clip_segment_v3_plane_n(r_ray_start, r_ray_end, rv3d->clip, 6) == false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Jonathan Smith
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
|
||||
/*! operator=
|
||||
* \attention In the scripting language, you must call \code it2 = StrokeVertexIterator(it1) \endcode instead of
|
||||
* \code it2 = it1 \endcode, where \a it1 and \a it2 are 2 StrokeVertexIterator.
|
||||
* \code it2 = it1 \endcode where \a it1 and \a it2 are 2 StrokeVertexIterator.
|
||||
* Otherwise, incrementing \a it1 will also increment \a it2.
|
||||
*/
|
||||
StrokeVertexIterator& operator=(const StrokeVertexIterator& vi)
|
||||
|
@ -1871,7 +1871,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde
|
||||
|
||||
int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
|
||||
BoolPropertyRNA *bprop = (BoolPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
|
||||
BLI_assert(RNA_property_array_check(prop) == false);
|
||||
@ -1881,7 +1881,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
|
||||
void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values)
|
||||
{
|
||||
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
|
||||
BoolPropertyRNA *bprop = (BoolPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
|
||||
BLI_assert(RNA_property_array_check(prop) != false);
|
||||
@ -2124,13 +2124,13 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i
|
||||
|
||||
int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
|
||||
IntPropertyRNA *iprop = (IntPropertyRNA *)rna_ensure_property(prop);
|
||||
return iprop->defaultvalue;
|
||||
}
|
||||
|
||||
void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values)
|
||||
{
|
||||
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
|
||||
IntPropertyRNA *iprop = (IntPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_INT);
|
||||
BLI_assert(RNA_property_array_check(prop) != false);
|
||||
@ -2401,7 +2401,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index,
|
||||
|
||||
float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
|
||||
FloatPropertyRNA *fprop = (FloatPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
|
||||
BLI_assert(RNA_property_array_check(prop) == false);
|
||||
@ -2411,7 +2411,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
|
||||
void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, float *values)
|
||||
{
|
||||
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
|
||||
FloatPropertyRNA *fprop = (FloatPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_FLOAT);
|
||||
BLI_assert(RNA_property_array_check(prop) != false);
|
||||
@ -2566,7 +2566,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val
|
||||
|
||||
void RNA_property_string_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop, char *value)
|
||||
{
|
||||
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
|
||||
StringPropertyRNA *sprop = (StringPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_STRING);
|
||||
|
||||
@ -2650,7 +2650,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
|
||||
|
||||
int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
|
||||
EnumPropertyRNA *eprop = (EnumPropertyRNA *)rna_ensure_property(prop);
|
||||
|
||||
BLI_assert(RNA_property_type(prop) == PROP_ENUM);
|
||||
|
||||
|
@ -158,8 +158,12 @@ static char *rna_ImageUser_path(PointerRNA *ptr)
|
||||
/* ImageUser *iuser = ptr->data; */
|
||||
|
||||
switch (GS(((ID *)ptr->id.data)->name)) {
|
||||
case ID_TE:
|
||||
case ID_TE: {
|
||||
return BLI_strdup("image_user");
|
||||
}
|
||||
case ID_NT: {
|
||||
return rna_Node_ImageUser_path(ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,6 +246,7 @@ int rna_Action_id_poll(struct PointerRNA *ptr, struct PointerRNA value);
|
||||
int rna_Action_actedit_assign_poll(struct PointerRNA *ptr, struct PointerRNA value);
|
||||
|
||||
char *rna_TextureSlot_path(struct PointerRNA *ptr);
|
||||
char *rna_Node_ImageUser_path(struct PointerRNA *ptr);
|
||||
|
||||
/* API functions */
|
||||
|
||||
|
@ -1818,7 +1818,7 @@ void RNA_def_material(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "index");
|
||||
RNA_def_property_ui_text(prop, "Pass Index", "Index number for the IndexMA render pass");
|
||||
RNA_def_property_update(prop, NC_OBJECT, NULL);
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_Material_update");
|
||||
|
||||
/* flags */
|
||||
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Andrew Wiggin
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -1126,6 +1126,33 @@ static char *rna_Node_path(PointerRNA *ptr)
|
||||
return BLI_sprintfN("nodes[\"%s\"]", name_esc);
|
||||
}
|
||||
|
||||
char *rna_Node_ImageUser_path(PointerRNA *ptr)
|
||||
{
|
||||
bNodeTree *ntree = (bNodeTree *)ptr->id.data;
|
||||
bNode *node;
|
||||
char name_esc[sizeof(node->name) * 2];
|
||||
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
if (node->type == SH_NODE_TEX_ENVIRONMENT) {
|
||||
NodeTexEnvironment *data = node->storage;
|
||||
if (&data->iuser != ptr->data)
|
||||
continue;
|
||||
}
|
||||
else if (node->type == SH_NODE_TEX_IMAGE) {
|
||||
NodeTexImage *data = node->storage;
|
||||
if (&data->iuser != ptr->data)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
BLI_strescape(name_esc, node->name, sizeof(name_esc));
|
||||
return BLI_sprintfN("nodes[\"%s\"].image_user", name_esc);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int rna_Node_poll(bNodeType *ntype, bNodeTree *ntree)
|
||||
{
|
||||
extern FunctionRNA rna_Node_poll_func;
|
||||
|
@ -2395,7 +2395,7 @@ static void rna_def_object(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "index");
|
||||
RNA_def_property_ui_text(prop, "Pass Index", "Index number for the IndexOB render pass");
|
||||
RNA_def_property_update(prop, NC_OBJECT, NULL);
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_Object_internal_update");
|
||||
|
||||
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "col");
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code was in: source/blender/bpython/include/BPY_extern.h
|
||||
*
|
||||
* Contributor(s): Michel Selten,
|
||||
* Willian P. Germano,
|
||||
* Chris Keith,
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,8 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,10 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Michel Selten & Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,15 +15,9 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file blender/python/mathutils/mathutils_Matrix.h
|
||||
|
@ -15,10 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,10 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,15 +15,9 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano & Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file blender/python/mathutils/mathutils_Vector.h
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Joseph Gilbert
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): eeshlo, Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributor(s): Brecht Van Lommel.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributors: 2004/2005/2006 Blender Foundation, full recode
|
||||
* Contributors: Vertex color baking, Copyright 2011 AutoCRC
|
||||
*
|
||||
|
@ -468,6 +468,30 @@ void RE_FreePersistentData(void)
|
||||
|
||||
/* ********* initialize state ******** */
|
||||
|
||||
/* clear full sample and tile flags if needed */
|
||||
static int check_mode_full_sample(RenderData *rd)
|
||||
{
|
||||
int scemode = rd->scemode;
|
||||
|
||||
if ((rd->mode & R_OSA) == 0)
|
||||
scemode &= ~R_FULL_SAMPLE;
|
||||
|
||||
#ifdef WITH_OPENEXR
|
||||
if (scemode & R_FULL_SAMPLE)
|
||||
scemode |= R_EXR_TILE_FILE; /* enable automatic */
|
||||
|
||||
/* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/
|
||||
if (rd->mode & R_BORDER) {
|
||||
scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
|
||||
}
|
||||
|
||||
#else
|
||||
/* can't do this without openexr support */
|
||||
scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
|
||||
#endif
|
||||
|
||||
return scemode;
|
||||
}
|
||||
|
||||
/* what doesn't change during entire render sequence */
|
||||
/* disprect is optional, if NULL it assumes full window render */
|
||||
@ -533,22 +557,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
|
||||
return;
|
||||
}
|
||||
|
||||
if ((re->r.mode & (R_OSA)) == 0)
|
||||
re->r.scemode &= ~R_FULL_SAMPLE;
|
||||
|
||||
#ifdef WITH_OPENEXR
|
||||
if (re->r.scemode & R_FULL_SAMPLE)
|
||||
re->r.scemode |= R_EXR_TILE_FILE; /* enable automatic */
|
||||
|
||||
/* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/
|
||||
if (re->r.mode & R_BORDER) {
|
||||
re->r.scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
|
||||
}
|
||||
|
||||
#else
|
||||
/* can't do this without openexr support */
|
||||
re->r.scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
|
||||
#endif
|
||||
re->r.scemode = check_mode_full_sample(&re->r);
|
||||
|
||||
/* fullsample wants uniform osa levels */
|
||||
if (source && (re->r.scemode & R_FULL_SAMPLE)) {
|
||||
@ -2222,6 +2231,7 @@ static int check_composite_output(Scene *scene)
|
||||
int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *reports)
|
||||
{
|
||||
SceneRenderLayer *srl;
|
||||
int scemode = check_mode_full_sample(&scene->r);
|
||||
|
||||
if (scene->r.mode & R_BORDER) {
|
||||
if (scene->r.border.xmax <= scene->r.border.xmin ||
|
||||
@ -2232,7 +2242,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
|
||||
}
|
||||
}
|
||||
|
||||
if (scene->r.scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
|
||||
if (scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) {
|
||||
char str[FILE_MAX];
|
||||
|
||||
render_result_exr_file_path(scene, "", 0, str);
|
||||
@ -2243,16 +2253,14 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
|
||||
}
|
||||
|
||||
/* no fullsample and edge */
|
||||
if ((scene->r.scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
|
||||
if ((scemode & R_FULL_SAMPLE) && (scene->r.mode & R_EDGE)) {
|
||||
BKE_report(reports, RPT_ERROR, "Full sample does not support edge enhance");
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
scene->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
|
||||
|
||||
if (scene->r.scemode & R_DOCOMP) {
|
||||
if (scemode & R_DOCOMP) {
|
||||
if (scene->use_nodes) {
|
||||
if (!scene->nodetree) {
|
||||
BKE_report(reports, RPT_ERROR, "No node tree in scene");
|
||||
@ -2264,7 +2272,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (scene->r.scemode & R_FULL_SAMPLE) {
|
||||
if (scemode & R_FULL_SAMPLE) {
|
||||
if (composite_needs_render(scene, 0) == 0) {
|
||||
BKE_report(reports, RPT_ERROR, "Full sample AA not supported without 3D rendering");
|
||||
return 0;
|
||||
@ -2298,7 +2306,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
|
||||
}
|
||||
|
||||
/* layer flag tests */
|
||||
if (scene->r.scemode & R_SINGLE_LAYER) {
|
||||
if (scemode & R_SINGLE_LAYER) {
|
||||
srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
|
||||
/* force layer to be enabled */
|
||||
srl->layflag &= ~SCE_LAY_DISABLE;
|
||||
@ -2322,7 +2330,6 @@ static void validate_render_settings(Render *re)
|
||||
if (re->r.osa == 0)
|
||||
re->r.scemode &= ~R_FULL_SAMPLE;
|
||||
}
|
||||
else re->r.scemode &= ~R_FULL_SAMPLE; /* clear to be sure */
|
||||
|
||||
if (RE_engine_is_external(re)) {
|
||||
/* not supported yet */
|
||||
|
@ -15,11 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: none of this file.
|
||||
*
|
||||
* Contributors: Brecht Van Lommel.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
@ -178,6 +178,14 @@ void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *r
|
||||
void WM_main_add_notifier(unsigned int type, void *reference);
|
||||
void WM_main_remove_notifier_reference(const void *reference);
|
||||
|
||||
/* reports */
|
||||
void WM_report(const struct bContext *C, ReportType type, const char *message);
|
||||
void WM_reportf(const struct bContext *C, ReportType type, const char *format, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((format(printf, 3, 4)))
|
||||
#endif
|
||||
;
|
||||
|
||||
void wm_event_add(struct wmWindow *win, const struct wmEvent *event_to_add);
|
||||
|
||||
/* at maximum, every timestep seconds it triggers event_type events */
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "GHOST_C-api.h"
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_dynstr.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_math.h"
|
||||
|
||||
@ -533,6 +534,56 @@ void WM_event_print(const wmEvent *event)
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
static void wm_add_reports(const bContext *C, ReportList *reports)
|
||||
{
|
||||
/* if the caller owns them, handle this */
|
||||
if (reports->list.first && (reports->flag & RPT_OP_HOLD) == 0) {
|
||||
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
ReportList *wm_reports = CTX_wm_reports(C);
|
||||
ReportTimerInfo *rti;
|
||||
|
||||
/* add reports to the global list, otherwise they are not seen */
|
||||
BLI_movelisttolist(&wm_reports->list, &reports->list);
|
||||
|
||||
/* After adding reports to the global list, reset the report timer. */
|
||||
WM_event_remove_timer(wm, NULL, wm_reports->reporttimer);
|
||||
|
||||
/* Records time since last report was added */
|
||||
wm_reports->reporttimer = WM_event_add_timer(wm, CTX_wm_window(C), TIMERREPORT, 0.05);
|
||||
|
||||
rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
|
||||
wm_reports->reporttimer->customdata = rti;
|
||||
}
|
||||
}
|
||||
|
||||
void WM_report(const bContext *C, ReportType type, const char *message)
|
||||
{
|
||||
ReportList reports;
|
||||
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
BKE_report(&reports, type, message);
|
||||
|
||||
wm_add_reports(C, &reports);
|
||||
|
||||
BKE_reports_clear(&reports);
|
||||
}
|
||||
|
||||
void WM_reportf(const bContext *C, ReportType type, const char *format, ...)
|
||||
{
|
||||
DynStr *ds;
|
||||
va_list args;
|
||||
|
||||
ds = BLI_dynstr_new();
|
||||
va_start(args, format);
|
||||
BLI_dynstr_vappendf(ds, format, args);
|
||||
va_end(args);
|
||||
|
||||
WM_report(C, type, BLI_dynstr_get_cstring(ds));
|
||||
|
||||
BLI_dynstr_free(ds);
|
||||
}
|
||||
|
||||
/* (caller_owns_reports == TRUE) when called from python */
|
||||
static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int caller_owns_reports)
|
||||
{
|
||||
@ -575,24 +626,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int cal
|
||||
}
|
||||
|
||||
/* if the caller owns them, handle this */
|
||||
if (op->reports->list.first && (op->reports->flag & RPT_OP_HOLD) == 0) {
|
||||
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
ReportList *wm_reports = CTX_wm_reports(C);
|
||||
ReportTimerInfo *rti;
|
||||
|
||||
/* add reports to the global list, otherwise they are not seen */
|
||||
BLI_movelisttolist(&wm_reports->list, &op->reports->list);
|
||||
|
||||
/* After adding reports to the global list, reset the report timer. */
|
||||
WM_event_remove_timer(wm, NULL, wm_reports->reporttimer);
|
||||
|
||||
/* Records time since last report was added */
|
||||
wm_reports->reporttimer = WM_event_add_timer(wm, CTX_wm_window(C), TIMERREPORT, 0.05);
|
||||
|
||||
rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
|
||||
wm_reports->reporttimer->customdata = rti;
|
||||
}
|
||||
wm_add_reports(C, op->reports);
|
||||
}
|
||||
|
||||
/* this function is mainly to check that the rules for freeing
|
||||
@ -1480,15 +1514,17 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
|
||||
if (ot->flag & OPTYPE_UNDO)
|
||||
wm->op_undo_depth++;
|
||||
|
||||
/* warning, after this call all context data and 'event' may be freed. see check below */
|
||||
retval = ot->modal(C, op, event);
|
||||
OPERATOR_RETVAL_CHECK(retval);
|
||||
wm_event_modalmap_end(event);
|
||||
|
||||
/* when this is _not_ the case the modal modifier may have loaded
|
||||
* a new blend file (demo mode does this), so we have to assume
|
||||
* the event, operator etc have all been freed. - campbell */
|
||||
if (CTX_wm_manager(C) == wm) {
|
||||
|
||||
wm_event_modalmap_end(event);
|
||||
|
||||
if (ot->flag & OPTYPE_UNDO)
|
||||
wm->op_undo_depth--;
|
||||
|
||||
|
@ -1297,7 +1297,11 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
|
||||
km = WM_keymap_find_all(C, "3D View", sl->spacetype, 0);
|
||||
}
|
||||
else if (strstr(opname, "OBJECT_OT")) {
|
||||
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
|
||||
/* exception, this needs to work outside object mode too */
|
||||
if (strstr(opname, "OBJECT_OT_mode_set"))
|
||||
km = WM_keymap_find_all(C, "Object Non-modal", 0, 0);
|
||||
else
|
||||
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,9 +15,6 @@
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user