Merging r58362 through r58463 from trunk into soc-2013-depsgraph_mt

This commit is contained in:
2013-07-21 08:14:59 +00:00
200 changed files with 2188 additions and 13882 deletions
+2 -13
View File
@@ -538,9 +538,6 @@ set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "")
# disabled for now, not supported
# option(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
# On Unix:
# cmake ../blender \
@@ -1874,16 +1871,6 @@ if(WITH_IMAGE_REDCODE)
set(REDCODE_INC ${REDCODE})
endif()
#-----------------------------------------------------------------------------
# Blender WebPlugin
if(WITH_WEBPLUGIN)
set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
set(WITH_PLAYER ON)
endif()
#-----------------------------------------------------------------------------
# Configure OpenGL.
@@ -1977,6 +1964,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull) # C only
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2003,6 +1991,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -347,10 +347,6 @@ void AUD_FFMPEGReader::seek(int position)
uint64_t st_time = m_formatCtx->start_time;
uint64_t seek_pos = ((uint64_t)position) * ((uint64_t)AV_TIME_BASE) / ((uint64_t)m_specs.rate);
if (seek_pos < 0) {
seek_pos = 0;
}
if (st_time != AV_NOPTS_VALUE) {
seek_pos += st_time;
}
+30
View File
@@ -46,6 +46,36 @@ class AddPresetIntegrator(AddPresetBase, Operator):
preset_subdir = "cycles/integrator"
class AddPresetSampling(AddPresetBase, Operator):
'''Add a Sampling Preset'''
bl_idname = "render.cycles_sampling_preset_add"
bl_label = "Add Sampling Preset"
preset_menu = "CYCLES_MT_sampling_presets"
preset_defines = [
"cycles = bpy.context.scene.cycles"
]
preset_values = [
"cycles.samples",
"cycles.preview_samples",
"cycles.aa_samples",
"cycles.preview_aa_samples",
"cycles.diffuse_samples",
"cycles.glossy_samples",
"cycles.transmission_samples",
"cycles.ao_samples",
"cycles.mesh_light_samples",
"cycles.subsurface_samples",
"cycles.no_caustics",
"cycles.blur_glossy",
"cycles.squared_samples",
"cycles.progressive"
]
preset_subdir = "cycles/sampling"
def register():
pass
@@ -150,6 +150,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Use progressive sampling of lighting",
default=True,
)
cls.squared_samples = BoolProperty(
name="Squared Samples",
description="Square sampling values for easier artist control",
default=False,
)
cls.samples = IntProperty(
name="Samples",
+23 -7
View File
@@ -23,6 +23,14 @@ import bpy
from bpy.types import Panel, Menu, Operator
class CYCLES_MT_sampling_presets(Menu):
bl_label = "Sampling Presets"
preset_subdir = "cycles/sampling"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'CYCLES'}
draw = Menu.draw_preset
class CYCLES_MT_integrator_presets(Menu):
bl_label = "Integrator Presets"
preset_subdir = "cycles/integrator"
@@ -52,22 +60,30 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
scene = context.scene
cscene = scene.cycles
device_type = context.user_preferences.system.compute_device_type
row = layout.row(align=True)
row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label)
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN")
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
split = layout.split()
col = split.column()
sub = col.column()
row = layout.row()
sub = row.row()
sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
sub.prop(cscene, "progressive")
row.prop(cscene, "squared_samples")
split = layout.split()
col = split.column()
sub = col.column(align=True)
sub.label("Settings:")
sub.prop(cscene, "seed")
sub.prop(cscene, "sample_clamp")
if cscene.progressive or (device_type != 'NONE' and cscene.device == 'GPU'):
col = split.column()
col.label(text="Samples:")
sub = col.column(align=True)
sub.label(text="Samples:")
sub.prop(cscene, "samples", text="Render")
sub.prop(cscene, "preview_samples", text="Preview")
else:
@@ -76,8 +92,8 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
sub.prop(cscene, "preview_aa_samples", text="Preview")
col = split.column()
col.label(text="Samples:")
sub = col.column(align=True)
sub.label(text="Samples:")
sub.prop(cscene, "diffuse_samples", text="Diffuse")
sub.prop(cscene, "glossy_samples", text="Glossy")
sub.prop(cscene, "transmission_samples", text="Transmission")
+14 -2
View File
@@ -154,10 +154,16 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI
light->shader = used_shaders[0];
/* shadow */
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
light->cast_shadow = get_boolean(clamp, "cast_shadow");
light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling");
light->samples = get_int(clamp, "samples");
int samples = get_int(clamp, "samples");
if(get_boolean(cscene, "squared_samples"))
light->samples = samples * samples;
else
light->samples = samples;
/* visibility */
uint visibility = object_ray_visibility(b_ob);
@@ -174,6 +180,7 @@ void BlenderSync::sync_background_light()
BL::World b_world = b_scene.world();
if(b_world) {
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
bool sample_as_light = get_boolean(cworld, "sample_as_light");
@@ -188,8 +195,13 @@ void BlenderSync::sync_background_light()
{
light->type = LIGHT_BACKGROUND;
light->map_resolution = get_int(cworld, "sample_map_resolution");
light->samples = get_int(cworld, "samples");
light->shader = scene->default_background;
int samples = get_int(cworld, "samples");
if(get_boolean(cscene, "squared_samples"))
light->samples = samples * samples;
else
light->samples = samples;
light->tag_update(scene);
light_map.set_recalc(b_world);
+50 -14
View File
@@ -191,14 +191,33 @@ void BlenderSync::sync_integrator()
}
#endif
integrator->diffuse_samples = get_int(cscene, "diffuse_samples");
integrator->glossy_samples = get_int(cscene, "glossy_samples");
integrator->transmission_samples = get_int(cscene, "transmission_samples");
integrator->ao_samples = get_int(cscene, "ao_samples");
integrator->mesh_light_samples = get_int(cscene, "mesh_light_samples");
integrator->subsurface_samples = get_int(cscene, "subsurface_samples");
integrator->progressive = get_boolean(cscene, "progressive");
int diffuse_samples = get_int(cscene, "diffuse_samples");
int glossy_samples = get_int(cscene, "glossy_samples");
int transmission_samples = get_int(cscene, "transmission_samples");
int ao_samples = get_int(cscene, "ao_samples");
int mesh_light_samples = get_int(cscene, "mesh_light_samples");
int subsurface_samples = get_int(cscene, "subsurface_samples");
if(get_boolean(cscene, "squared_samples")) {
integrator->diffuse_samples = diffuse_samples * diffuse_samples;
integrator->glossy_samples = glossy_samples * glossy_samples;
integrator->transmission_samples = transmission_samples * transmission_samples;
integrator->ao_samples = ao_samples * ao_samples;
integrator->mesh_light_samples = mesh_light_samples * mesh_light_samples;
integrator->subsurface_samples = subsurface_samples * subsurface_samples;
}
else {
integrator->diffuse_samples = diffuse_samples;
integrator->glossy_samples = glossy_samples;
integrator->transmission_samples = transmission_samples;
integrator->ao_samples = ao_samples;
integrator->mesh_light_samples = mesh_light_samples;
integrator->subsurface_samples = subsurface_samples;
}
if(experimental)
integrator->sampling_pattern = (SamplingPattern)RNA_enum_get(&cscene, "sampling_pattern");
@@ -300,8 +319,13 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
render_layer.use_localview = false;
render_layer.bound_samples = (use_layer_samples == 1);
if(use_layer_samples != 2)
render_layer.samples = b_rlay->samples();
if(use_layer_samples != 2) {
int samples = b_rlay->samples();
if(get_boolean(cscene, "squared_samples"))
render_layer.samples = samples * samples;
else
render_layer.samples = samples;
}
}
first_layer = false;
@@ -385,24 +409,36 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
params.background = background;
/* samples */
int samples = get_int(cscene, "samples");
int aa_samples = get_int(cscene, "aa_samples");
int preview_samples = get_int(cscene, "preview_samples");
int preview_aa_samples = get_int(cscene, "preview_aa_samples");
if(get_boolean(cscene, "squared_samples")) {
samples = samples * samples;
aa_samples = aa_samples * aa_samples;
preview_samples = preview_samples * preview_samples;
preview_aa_samples = preview_aa_samples * preview_aa_samples;
}
if(get_boolean(cscene, "progressive") == 0 && params.device.type == DEVICE_CPU) {
if(background) {
params.samples = get_int(cscene, "aa_samples");
params.samples = aa_samples;
}
else {
params.samples = get_int(cscene, "preview_aa_samples");
params.samples = preview_aa_samples;
if(params.samples == 0)
params.samples = INT_MAX;
params.samples = USHRT_MAX;
}
}
else {
if(background) {
params.samples = get_int(cscene, "samples");
params.samples = samples;
}
else {
params.samples = get_int(cscene, "preview_samples");
params.samples = preview_samples;
if(params.samples == 0)
params.samples = INT_MAX;
params.samples = USHRT_MAX;
}
}
+1 -2
View File
@@ -307,8 +307,7 @@ public:
void task_add(DeviceTask& task)
{
/* split task into smaller ones, more than number of threads for uneven
* workloads where some parts of the image render slower than others */
/* split task into smaller ones */
list<DeviceTask> tasks;
task.split(tasks, TaskScheduler::num_threads());
+1 -1
View File
@@ -786,7 +786,7 @@ void Session::update_status_time(bool show_pause, bool show_done)
substatus += string_printf(", Sample %d/%d", sample, num_samples);
}
}
else if(tile_manager.num_samples == INT_MAX)
else if(tile_manager.num_samples == USHRT_MAX)
substatus = string_printf("Path Tracing Sample %d", sample+1);
else
substatus = string_printf("Path Tracing Sample %d/%d", sample+1, tile_manager.num_samples);
+3 -3
View File
@@ -186,12 +186,12 @@ void TaskScheduler::init(int num_threads)
do_exit = false;
if(num_threads == 0) {
/* automatic number of threads will be main thread + num cores */
/* automatic number of threads */
num_threads = system_cpu_thread_count();
}
else {
/* main thread will also work, for fixed threads we count it too */
num_threads -= 1;
/* manual number of threads */
num_threads;
}
/* launch threads that will be waiting for work */
+2 -2
View File
@@ -94,8 +94,8 @@ public:
static void init(int num_threads = 0);
static void exit();
/* number of threads that can work on tasks, main thread counts too */
static int num_threads() { return threads.size() + 1; }
/* number of threads that can work on task */
static int num_threads() { return threads.size(); }
/* test if any session is using the scheduler */
static bool active() { return users != 0; }
+1 -1
View File
@@ -191,7 +191,7 @@ void GHOST_DropTargetX11::UrlDecode(char *decodedOut, int bufferSize, const char
char *GHOST_DropTargetX11::FileUrlDecode(char *fileUrl)
{
if (!strncpy(fileUrl, "file://", 7) == 0) {
if (strncpy(fileUrl, "file://", 7) != 0) {
/* assume one character of encoded URL can be expanded to 4 chars max */
int decodedSize = 4 * strlen(fileUrl) + 1;
char *decodedPath = (char *)malloc(decodedSize);
+2 -1
View File
@@ -858,7 +858,8 @@ OSStatus GHOST_SystemCarbon::handleMouseEvent(EventRef event)
break;
case kEventMouseMoved:
case kEventMouseDragged: {
case kEventMouseDragged:
{
Point mousePos;
if (window) {
+10 -9
View File
@@ -1139,7 +1139,8 @@ GHOST_SystemX11::processEvent(XEvent *xe)
break;
}
default: {
default:
{
#ifdef WITH_X11_XINPUT
if (xe->type == m_xtablet.MotionEvent) {
XDeviceMotionEvent *data = (XDeviceMotionEvent *)xe;
@@ -1505,7 +1506,7 @@ convertXKey(KeySym key)
#define XCLIB_XCOUT_FALLBACK_TEXT 6
/* Retrieves the contents of a selections. */
void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
void GHOST_SystemX11::getClipboard_xcout(const XEvent *evt,
Atom sel, Atom target, unsigned char **txt,
unsigned long *len, unsigned int *context) const
{
@@ -1535,18 +1536,18 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
return;
case XCLIB_XCOUT_SENTCONVSEL:
if (evt.type != SelectionNotify)
if (evt->type != SelectionNotify)
return;
if (target == m_atom.UTF8_STRING && evt.xselection.property == None) {
if (target == m_atom.UTF8_STRING && evt->xselection.property == None) {
*context = XCLIB_XCOUT_FALLBACK_UTF8;
return;
}
else if (target == m_atom.COMPOUND_TEXT && evt.xselection.property == None) {
else if (target == m_atom.COMPOUND_TEXT && evt->xselection.property == None) {
*context = XCLIB_XCOUT_FALLBACK_COMP;
return;
}
else if (target == m_atom.TEXT && evt.xselection.property == None) {
else if (target == m_atom.TEXT && evt->xselection.property == None) {
*context = XCLIB_XCOUT_FALLBACK_TEXT;
return;
}
@@ -1604,11 +1605,11 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
* then read it, delete it, etc. */
/* make sure that the event is relevant */
if (evt.type != PropertyNotify)
if (evt->type != PropertyNotify)
return;
/* skip unless the property has a new value */
if (evt.xproperty.state != PropertyNewValue)
if (evt->xproperty.state != PropertyNewValue)
return;
/* check size and format of the property */
@@ -1713,7 +1714,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
XNextEvent(m_display, &evt);
/* fetch the selection, or part of it */
getClipboard_xcout(evt, sseln, target, &sel_buf, &sel_len, &context);
getClipboard_xcout(&evt, sseln, target, &sel_buf, &sel_len, &context);
/* fallback is needed. set XA_STRING to target and restart the loop. */
if (context == XCLIB_XCOUT_FALLBACK) {
+1 -1
View File
@@ -238,7 +238,7 @@ public:
#endif
/* Helped function for get data from the clipboard. */
void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
void getClipboard_xcout(const XEvent *evt, Atom sel, Atom target,
unsigned char **txt, unsigned long *len,
unsigned int *context) const;
+2 -1
View File
@@ -1032,7 +1032,8 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
[m_window zoom:nil];
break;
case GHOST_kWindowStateFullScreen: {
case GHOST_kWindowStateFullScreen:
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
NSUInteger masks = [m_window styleMask];
+2 -1
View File
@@ -5,6 +5,7 @@ Blender Main I18n font ("droidsans.ttf") includes glyphs imported from the follo
3. Samyak-devanagari
4. Droid Sans Hebrew Regular
5. Droid Sans Ethiopic Regular
6. Samyak-tamil
These were merged using FontForge in (approximately) the above order. For each glyph,
a license of the font from which it was imported is applied.
@@ -30,7 +31,7 @@ Copyright:
License: Apache-2.0
See Appendix A.
(3) Samyak-devanagari
(3) Samyak-devanagari and (6) Samyak-tamil
Copyright: 2005-2006, Rahul Bhalerao <b.rahul.pm@gmail.com>
2005-2006, Bageshri Salvi <sbageshri@gmail.com>
2005-2006, Pravin Satpute <pravin.d.s@gmail.com>
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 174 KiB

@@ -0,0 +1,16 @@
import bpy
cycles = bpy.context.scene.cycles
cycles.squared_samples = True
cycles.samples = 24
cycles.preview_samples = 24
cycles.aa_samples = 8
cycles.preview_aa_samples = 8
cycles.diffuse_samples = 3
cycles.glossy_samples = 2
cycles.transmission_samples = 2
cycles.ao_samples = 1
cycles.mesh_light_samples = 2
cycles.subsurface_samples = 2
@@ -0,0 +1,16 @@
import bpy
cycles = bpy.context.scene.cycles
cycles.squared_samples = True
cycles.samples = 12
cycles.preview_samples = 12
cycles.aa_samples = 4
cycles.preview_aa_samples = 4
cycles.diffuse_samples = 3
cycles.glossy_samples = 2
cycles.transmission_samples = 2
cycles.ao_samples = 1
cycles.mesh_light_samples = 2
cycles.subsurface_samples = 2
@@ -364,7 +364,7 @@ class DATA_PT_paragraph(CurveButtonsPanel, Panel):
col = split.column(align=True)
col.label(text="Spacing:")
col.prop(text, "space_character", text="Character")
col.prop(text, "space_character", text="Letter")
col.prop(text, "space_word", text="Word")
col.prop(text, "space_line", text="Line")
@@ -339,6 +339,11 @@ class MASK_MT_select(Menu):
layout.separator()
layout.operator("mask.select_more")
layout.operator("mask.select_less")
layout.separator()
layout.operator("mask.select_all").action = 'TOGGLE'
layout.operator("mask.select_all", text="Inverse").action = 'INVERT'
+13 -2
View File
@@ -293,7 +293,10 @@ class VIEW3D_MT_snap(Menu):
layout = self.layout
layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
props = layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
props.use_offset = False
props = layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor (Offset)")
props.use_offset = True
layout.separator()
@@ -723,6 +726,7 @@ class VIEW3D_MT_select_edit_lattice(Menu):
layout.separator()
layout.operator("lattice.select_random")
layout.operator("lattice.select_all").action = 'TOGGLE'
layout.operator("lattice.select_all", text="Inverse").action = 'INVERT'
@@ -747,6 +751,11 @@ class VIEW3D_MT_select_edit_armature(Menu):
layout.separator()
layout.operator("armature.select_more", text="More")
layout.operator("armature.select_less", text="Less")
layout.separator()
layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
@@ -2534,7 +2543,7 @@ class VIEW3D_PT_view3d_display(Panel):
view = context.space_data
scene = context.scene
gs = scene.game_settings
ob = context.object
obj = context.object
col = layout.column()
col.prop(view, "show_only_render")
@@ -2574,6 +2583,8 @@ class VIEW3D_PT_view3d_display(Panel):
if view.use_matcap:
col.template_icon_view(view, "matcap_icon")
col.prop(view, "show_backface_culling")
if obj and obj.mode == 'EDIT' and view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'}:
col.prop(view, "show_occlude_wire")
layout.separator()
+1 -1
View File
@@ -438,7 +438,7 @@ struct DerivedMesh {
*/
void (*drawMappedFacesMat)(DerivedMesh *dm,
void (*setMaterial)(void *userData, int, void *attribs),
int (*setFace)(void *userData, int index), void *userData);
bool (*setFace)(void *userData, int index), void *userData);
/** Release reference to the DerivedMesh. This function decides internally
* if the DerivedMesh will be freed, or cached for later use. */
+4 -4
View File
@@ -41,8 +41,8 @@ extern "C" {
/* these lines are grep'd, watch out for our not-so-awesome regex
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 267
#define BLENDER_SUBVERSION 1
#define BLENDER_VERSION 268
#define BLENDER_SUBVERSION 0
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
#define BLENDER_MINVERSION 262
@@ -50,9 +50,9 @@ extern "C" {
/* used by packaging tools */
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR b
#define BLENDER_VERSION_CHAR
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE rc
#define BLENDER_VERSION_CYCLE alpha
extern char versionstr[]; /* from blender.c */
+2
View File
@@ -59,6 +59,8 @@ void key_curve_position_weights(float t, float data[4], int type);
void key_curve_tangent_weights(float t, float data[4], int type);
void key_curve_normal_weights(float t, float data[4], int type);
float *BKE_key_evaluate_object_ex(struct Scene *scene, struct Object *ob, int *r_totelem,
float *arr, size_t arr_size);
float *BKE_key_evaluate_object(struct Scene *scene, struct Object *ob, int *r_totelem);
struct Key *BKE_key_from_object(struct Object *ob);
@@ -3107,7 +3107,7 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm)
}
}
else {
printf("%s: Error during creation polygon infos\n", __func__);
printf("Navmesh: Unable to generate valid Navmesh");
}
/* clean up */
+2 -4
View File
@@ -930,9 +930,8 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
if (fmd->flag & FCM_LIMIT_XMAX) {
max = max_ff(max, fmd->rect.xmax);
}
break;
}
break;
case FMODIFIER_TYPE_CYCLES: /* Cycles F-Modifier */
{
FMod_Cycles *fmd = (FMod_Cycles *)fcm->data;
@@ -941,9 +940,8 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
min = MINAFRAMEF;
if (fmd->after_mode != FCM_EXTRAPOLATE_NONE)
max = MAXFRAMEF;
break;
}
break;
/* TODO: function modifier may need some special limits */
default: /* all other standard modifiers are on the infinite range... */
+2 -2
View File
@@ -2092,8 +2092,8 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
/* z-axis scale */
scale = len_v3(pchan->pose_mat[2]);
mul_v3_fl(poseMat[2], scale);
break;
}
break;
case CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC:
{
/* 'volume preservation' */
@@ -2115,8 +2115,8 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
/* apply the scaling */
mul_v3_fl(poseMat[0], scale);
mul_v3_fl(poseMat[2], scale);
break;
}
break;
}
/* finally, multiply the x and z scaling by the radius of the curve too,
@@ -1424,7 +1424,7 @@ static void cdDM_drawFacesGLSL(DerivedMesh *dm, DMSetMaterial setMaterial)
static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
void (*setMaterial)(void *userData, int, void *attribs),
int (*setFace)(void *userData, int index), void *userData)
bool (*setFace)(void *userData, int index), void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh *) dm;
GPUVertexAttribs gattribs;
@@ -328,8 +328,8 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
cuma->curve[i].x = i / ((float)cuma->totpoint - 1);
cuma->curve[i].y = 0.5;
}
break;
}
break;
case CURVE_PRESET_ROUND:
cuma->curve[0].x = 0;
cuma->curve[0].y = 1;
+30 -31
View File
@@ -133,8 +133,8 @@ bConstraintOb *BKE_constraints_make_evalob(Scene *scene, Object *ob, void *subda
unit_m4(cob->matrix);
copy_m4_m4(cob->startmat, cob->matrix);
break;
}
break;
case CONSTRAINT_OBTYPE_BONE:
{
/* only set if we have valid bone, otherwise default */
@@ -159,9 +159,8 @@ bConstraintOb *BKE_constraints_make_evalob(Scene *scene, Object *ob, void *subda
unit_m4(cob->matrix);
copy_m4_m4(cob->startmat, cob->matrix);
break;
}
break;
default: /* other types not yet handled */
unit_m4(cob->matrix);
unit_m4(cob->startmat);
@@ -196,8 +195,8 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
/* copy inverse of delta back to owner */
invert_m4_m4(cob->ob->constinv, delta);
}
break;
}
break;
case CONSTRAINT_OBTYPE_BONE:
{
/* cob->ob or cob->pchan might not exist */
@@ -208,8 +207,8 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
/* copy inverse of delta back to owner */
invert_m4_m4(cob->pchan->constinv, delta);
}
break;
}
break;
}
/* free tempolary struct */
@@ -247,8 +246,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
/* call self with slightly different values */
BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
}
break;
}
break;
case CONSTRAINT_SPACE_POSE: /* ---------- FROM POSESPACE ---------- */
{
/* pose to world */
@@ -268,8 +267,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
mul_m4_m4m4(mat, imat, mat);
}
}
break;
}
break;
case CONSTRAINT_SPACE_LOCAL: /* ------------ FROM LOCALSPACE --------- */
{
/* local to pose - do inverse procedure that was done for pose to local */
@@ -283,8 +282,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
/* call self with slightly different values */
BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
}
break;
}
break;
case CONSTRAINT_SPACE_PARLOCAL: /* -------------- FROM LOCAL WITH PARENT ---------- */
{
/* local + parent to pose */
@@ -298,8 +297,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
/* call self with slightly different values */
BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
}
break;
}
break;
}
}
else {
@@ -2234,8 +2233,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
break;
}
break;
case TRACK_Z: /* LOCK X TRACK Z */
{
/* Projection of Vector on the plane */
@@ -2248,8 +2247,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
break;
}
break;
case TRACK_nY: /* LOCK X TRACK -Y */
{
/* Projection of Vector on the plane */
@@ -2263,8 +2262,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
break;
}
break;
case TRACK_nZ: /* LOCK X TRACK -Z */
{
/* Projection of Vector on the plane */
@@ -2278,16 +2277,16 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
break;
}
break;
default:
{
unit_m3(totmat);
break;
}
break;
}
break;
}
break;
case LOCK_Y: /* LOCK Y */
{
switch (data->trackflag) {
@@ -2303,8 +2302,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
break;
}
break;
case TRACK_Z: /* LOCK Y TRACK Z */
{
/* Projection of Vector on the plane */
@@ -2317,8 +2316,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
break;
}
break;
case TRACK_nX: /* LOCK Y TRACK -X */
{
/* Projection of Vector on the plane */
@@ -2332,8 +2331,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
break;
}
break;
case TRACK_nZ: /* LOCK Y TRACK -Z */
{
/* Projection of Vector on the plane */
@@ -2347,16 +2346,16 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the z axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
break;
}
break;
default:
{
unit_m3(totmat);
break;
}
break;
}
break;
}
break;
case LOCK_Z: /* LOCK Z */
{
switch (data->trackflag) {
@@ -2372,8 +2371,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
break;
}
break;
case TRACK_Y: /* LOCK Z TRACK Y */
{
/* Projection of Vector on the plane */
@@ -2386,8 +2385,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
break;
}
break;
case TRACK_nX: /* LOCK Z TRACK -X */
{
/* Projection of Vector on the plane */
@@ -2401,8 +2400,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
break;
}
break;
case TRACK_nY: /* LOCK Z TRACK -Y */
{
/* Projection of Vector on the plane */
@@ -2416,21 +2415,21 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
/* the x axis gets mapped onto a third orthogonal vector */
cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
break;
}
break;
default:
{
unit_m3(totmat);
break;
}
break;
}
break;
}
break;
default:
{
unit_m3(totmat);
break;
}
break;
}
/* Block to keep matrix heading */
copy_m3_m4(tmpmat, cob->matrix);
@@ -4408,8 +4407,8 @@ static bConstraint *add_new_constraint(Object *ob, bPoseChannel *pchan, const ch
con->ownspace = CONSTRAINT_SPACE_POSE;
con->flag |= CONSTRAINT_SPACEONCE;
}
break;
}
break;
}
return con;
@@ -4634,8 +4633,8 @@ void BKE_get_constraint_target_matrix(Scene *scene, bConstraint *con, int index,
unit_m4(cob->matrix);
unit_m4(cob->startmat);
}
break;
}
break;
case CONSTRAINT_OBTYPE_BONE: /* this may occur in some cases */
{
cob->ob = NULL; /* this might not work at all :/ */
@@ -4648,8 +4647,8 @@ void BKE_get_constraint_target_matrix(Scene *scene, bConstraint *con, int index,
unit_m4(cob->matrix);
unit_m4(cob->startmat);
}
break;
}
break;
}
/* get targets - we only need the first one though (and there should only be one) */
@@ -158,7 +158,7 @@ static void layerCopy_mdeformvert(const void *source, void *dest,
MDeformVert *dvert = (MDeformVert *)((char *)dest + i * size);
if (dvert->totweight) {
MDeformWeight *dw = MEM_callocN(dvert->totweight * sizeof(*dw),
MDeformWeight *dw = MEM_mallocN(dvert->totweight * sizeof(*dw),
"layerCopy_mdeformvert dw");
memcpy(dw, dvert->dw, dvert->totweight * sizeof(*dw));
@@ -265,7 +265,7 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
if (dvert->dw) MEM_freeN(dvert->dw);
if (totweight) {
dvert->dw = MEM_callocN(sizeof(*dvert->dw) * totweight,
dvert->dw = MEM_mallocN(sizeof(*dvert->dw) * totweight,
"layerInterp_mdeformvert dvert->dw");
dvert->totweight = totweight;
+1 -1
View File
@@ -735,7 +735,7 @@ MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup)
if (dw_new)
return dw_new;
dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "deformWeight");
dw_new = MEM_mallocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "deformWeight");
if (dvert->dw) {
memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
MEM_freeN(dvert->dw);
@@ -920,7 +920,7 @@ static void emdm_pass_attrib_vertex_mat(DMVertexAttribs *attribs, BMLoop *loop,
static void emDM_drawMappedFacesMat(DerivedMesh *dm,
void (*setMaterial)(void *userData, int, void *attribs),
int (*setFace)(void *userData, int index), void *userData)
bool (*setFace)(void *userData, int index), void *userData)
{
EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm;
BMEditMesh *em = bmdm->em;
+5 -9
View File
@@ -667,17 +667,16 @@ short fcurve_are_keyframes_usable(FCurve *fcu)
if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
return 0;
break;
}
break;
case FMODIFIER_TYPE_FN_GENERATOR:
{
FMod_FunctionGenerator *data = (FMod_FunctionGenerator *)fcm->data;
if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
return 0;
break;
}
break;
/* always harmful - cannot allow */
default:
return 0;
@@ -1703,9 +1702,8 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
else
driver->curval = value;
}
break;
}
break;
case DRIVER_TYPE_MIN: /* smallest value */
case DRIVER_TYPE_MAX: /* largest value */
{
@@ -1738,9 +1736,8 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
/* store value in driver */
driver->curval = value;
break;
}
break;
case DRIVER_TYPE_PYTHON: /* expression */
{
#ifdef WITH_PYTHON
@@ -1759,9 +1756,8 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
#else /* WITH_PYTHON*/
(void)evaltime;
#endif /* WITH_PYTHON*/
break;
}
break;
default:
{
/* special 'hack' - just use stored value
+5 -7
View File
@@ -213,9 +213,8 @@ static void fcm_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *c
/* cleanup */
if (powers)
MEM_freeN(powers);
break;
}
break;
case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial */
{
float value = 1.0f, *cp = NULL;
@@ -232,8 +231,8 @@ static void fcm_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *c
else
*cvalue = value;
}
break;
}
break;
}
}
@@ -316,8 +315,8 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
}
else
fn = tan;
break;
}
break;
case FCM_GENERATOR_FN_LN: /* natural log */
{
/* check that value is greater than 1? */
@@ -328,8 +327,8 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
*cvalue = 0.0f; /* no value possible here */
}
break;
}
break;
case FCM_GENERATOR_FN_SQRT: /* square root */
{
/* no negative numbers */
@@ -340,9 +339,8 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
*cvalue = 0.0f; /* no value possible here */
}
break;
}
break;
default:
printf("Invalid Function-Generator for F-Modifier - %d\n", data->type);
}
@@ -48,6 +48,10 @@
#include "BKE_global.h"
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wtype-limits"
#endif
#ifdef _OPENMP
# define CLOTH_OPENMP_LIMIT 512
#endif
+2 -3
View File
@@ -1174,9 +1174,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
{
/* just copy, as the new defines match the old ones... */
fcu->extend = icu->extrap;
break;
}
break;
case IPO_CYCL: /* cyclic extrapolation */
case IPO_CYCLX: /* cyclic extrapolation + offset */
{
@@ -1191,8 +1190,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
data->before_mode = data->after_mode = FCM_EXTRAPOLATE_CYCLIC_OFFSET;
else
data->before_mode = data->after_mode = FCM_EXTRAPOLATE_CYCLIC;
break;
}
break;
}
/* -------- */
+17 -2
View File
@@ -1342,7 +1342,8 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
}
/* returns key coordinates (+ tilt) when key applied, NULL otherwise */
float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
float *BKE_key_evaluate_object_ex(Scene *scene, Object *ob, int *r_totelem,
float *arr, size_t arr_size)
{
Key *key = BKE_key_from_object(ob);
KeyBlock *actkb = BKE_keyblock_from_object(ob);
@@ -1386,7 +1387,16 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
return NULL;
/* allocate array */
out = MEM_callocN(size, "BKE_key_evaluate_object out");
if (arr == NULL) {
out = MEM_callocN(size, "BKE_key_evaluate_object out");
}
else {
if (arr_size != size) {
return NULL;
}
out = (char *)arr;
}
/* prevent python from screwing this up? anyhoo, the from pointer could be dropped */
key->from = (ID *)ob->data;
@@ -1427,6 +1437,11 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
return (float *)out;
}
float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
{
return BKE_key_evaluate_object_ex(scene, ob, r_totelem, NULL, 0);
}
Key *BKE_key_from_object(Object *ob)
{
if (ob == NULL) return NULL;
+268 -268
View File
@@ -201,20 +201,20 @@ static LineStyleModifier *alloc_color_modifier(int type)
size_t size;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
size = sizeof(LineStyleColorModifier_AlongStroke);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
size = sizeof(LineStyleColorModifier_DistanceFromCamera);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
size = sizeof(LineStyleColorModifier_DistanceFromObject);
break;
case LS_MODIFIER_MATERIAL:
size = sizeof(LineStyleColorModifier_Material);
break;
default:
return NULL; /* unknown modifier type */
case LS_MODIFIER_ALONG_STROKE:
size = sizeof(LineStyleColorModifier_AlongStroke);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
size = sizeof(LineStyleColorModifier_DistanceFromCamera);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
size = sizeof(LineStyleColorModifier_DistanceFromObject);
break;
case LS_MODIFIER_MATERIAL:
size = sizeof(LineStyleColorModifier_Material);
break;
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
@@ -228,26 +228,26 @@ LineStyleModifier *BKE_add_linestyle_color_modifier(FreestyleLineStyle *linestyl
m->blend = MA_RAMP_BLEND;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
((LineStyleColorModifier_AlongStroke *)m)->color_ramp = add_colorband(1);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp = add_colorband(1);
((LineStyleColorModifier_DistanceFromCamera *)m)->range_min = 0.0f;
((LineStyleColorModifier_DistanceFromCamera *)m)->range_max = 10000.0f;
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
((LineStyleColorModifier_DistanceFromObject *)m)->target = NULL;
((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp = add_colorband(1);
((LineStyleColorModifier_DistanceFromObject *)m)->range_min = 0.0f;
((LineStyleColorModifier_DistanceFromObject *)m)->range_max = 10000.0f;
break;
case LS_MODIFIER_MATERIAL:
((LineStyleColorModifier_Material *)m)->color_ramp = add_colorband(1);
((LineStyleColorModifier_Material *)m)->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
break;
default:
return NULL; /* unknown modifier type */
case LS_MODIFIER_ALONG_STROKE:
((LineStyleColorModifier_AlongStroke *)m)->color_ramp = add_colorband(1);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp = add_colorband(1);
((LineStyleColorModifier_DistanceFromCamera *)m)->range_min = 0.0f;
((LineStyleColorModifier_DistanceFromCamera *)m)->range_max = 10000.0f;
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
((LineStyleColorModifier_DistanceFromObject *)m)->target = NULL;
((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp = add_colorband(1);
((LineStyleColorModifier_DistanceFromObject *)m)->range_min = 0.0f;
((LineStyleColorModifier_DistanceFromObject *)m)->range_max = 10000.0f;
break;
case LS_MODIFIER_MATERIAL:
((LineStyleColorModifier_Material *)m)->color_ramp = add_colorband(1);
((LineStyleColorModifier_Material *)m)->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
break;
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->color_modifiers, m);
@@ -264,23 +264,23 @@ LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
new_m->blend = m->blend;
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
case LS_MODIFIER_ALONG_STROKE:
{
LineStyleColorModifier_AlongStroke *p = (LineStyleColorModifier_AlongStroke *)m;
LineStyleColorModifier_AlongStroke *q = (LineStyleColorModifier_AlongStroke *)new_m;
q->color_ramp = MEM_dupallocN(p->color_ramp);
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
{
LineStyleColorModifier_DistanceFromCamera *p = (LineStyleColorModifier_DistanceFromCamera *)m;
LineStyleColorModifier_DistanceFromCamera *q = (LineStyleColorModifier_DistanceFromCamera *)new_m;
q->color_ramp = MEM_dupallocN(p->color_ramp);
q->range_min = p->range_min;
q->range_max = p->range_max;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
{
LineStyleColorModifier_DistanceFromObject *p = (LineStyleColorModifier_DistanceFromObject *)m;
LineStyleColorModifier_DistanceFromObject *q = (LineStyleColorModifier_DistanceFromObject *)new_m;
@@ -290,19 +290,19 @@ LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
q->color_ramp = MEM_dupallocN(p->color_ramp);
q->range_min = p->range_min;
q->range_max = p->range_max;
break;
}
break;
case LS_MODIFIER_MATERIAL:
case LS_MODIFIER_MATERIAL:
{
LineStyleColorModifier_Material *p = (LineStyleColorModifier_Material *)m;
LineStyleColorModifier_Material *q = (LineStyleColorModifier_Material *)new_m;
q->color_ramp = MEM_dupallocN(p->color_ramp);
q->flags = p->flags;
q->mat_attr = p->mat_attr;
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->color_modifiers, new_m);
@@ -312,18 +312,18 @@ LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
void BKE_remove_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
MEM_freeN(((LineStyleColorModifier_AlongStroke *)m)->color_ramp);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
MEM_freeN(((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
MEM_freeN(((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp);
break;
case LS_MODIFIER_MATERIAL:
MEM_freeN(((LineStyleColorModifier_Material *)m)->color_ramp);
break;
case LS_MODIFIER_ALONG_STROKE:
MEM_freeN(((LineStyleColorModifier_AlongStroke *)m)->color_ramp);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
MEM_freeN(((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
MEM_freeN(((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp);
break;
case LS_MODIFIER_MATERIAL:
MEM_freeN(((LineStyleColorModifier_Material *)m)->color_ramp);
break;
}
BLI_freelinkN(&linestyle->color_modifiers, m);
}
@@ -333,20 +333,20 @@ static LineStyleModifier *alloc_alpha_modifier(int type)
size_t size;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
size = sizeof(LineStyleAlphaModifier_AlongStroke);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
size = sizeof(LineStyleAlphaModifier_DistanceFromCamera);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
size = sizeof(LineStyleAlphaModifier_DistanceFromObject);
break;
case LS_MODIFIER_MATERIAL:
size = sizeof(LineStyleAlphaModifier_Material);
break;
default:
return NULL; /* unknown modifier type */
case LS_MODIFIER_ALONG_STROKE:
size = sizeof(LineStyleAlphaModifier_AlongStroke);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
size = sizeof(LineStyleAlphaModifier_DistanceFromCamera);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
size = sizeof(LineStyleAlphaModifier_DistanceFromObject);
break;
case LS_MODIFIER_MATERIAL:
size = sizeof(LineStyleAlphaModifier_Material);
break;
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
}
@@ -359,38 +359,38 @@ LineStyleModifier *BKE_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyl
m->blend = LS_VALUE_BLEND;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
case LS_MODIFIER_ALONG_STROKE:
{
LineStyleAlphaModifier_AlongStroke *p = (LineStyleAlphaModifier_AlongStroke *)m;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
{
LineStyleAlphaModifier_DistanceFromCamera *p = (LineStyleAlphaModifier_DistanceFromCamera *)m;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
p->range_min = 0.0f;
p->range_max = 10000.0f;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
{
LineStyleAlphaModifier_DistanceFromObject *p = (LineStyleAlphaModifier_DistanceFromObject *)m;
p->target = NULL;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
p->range_min = 0.0f;
p->range_max = 10000.0f;
break;
}
break;
case LS_MODIFIER_MATERIAL:
case LS_MODIFIER_MATERIAL:
{
LineStyleAlphaModifier_Material *p = (LineStyleAlphaModifier_Material *)m;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
p->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->alpha_modifiers, m);
@@ -407,15 +407,15 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
new_m->blend = m->blend;
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
case LS_MODIFIER_ALONG_STROKE:
{
LineStyleAlphaModifier_AlongStroke *p = (LineStyleAlphaModifier_AlongStroke *)m;
LineStyleAlphaModifier_AlongStroke *q = (LineStyleAlphaModifier_AlongStroke *)new_m;
q->curve = curvemapping_copy(p->curve);
q->flags = p->flags;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
{
LineStyleAlphaModifier_DistanceFromCamera *p = (LineStyleAlphaModifier_DistanceFromCamera *)m;
LineStyleAlphaModifier_DistanceFromCamera *q = (LineStyleAlphaModifier_DistanceFromCamera *)new_m;
@@ -423,9 +423,9 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
q->flags = p->flags;
q->range_min = p->range_min;
q->range_max = p->range_max;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
{
LineStyleAlphaModifier_DistanceFromObject *p = (LineStyleAlphaModifier_DistanceFromObject *)m;
LineStyleAlphaModifier_DistanceFromObject *q = (LineStyleAlphaModifier_DistanceFromObject *)new_m;
@@ -436,19 +436,19 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
q->flags = p->flags;
q->range_min = p->range_min;
q->range_max = p->range_max;
break;
}
break;
case LS_MODIFIER_MATERIAL:
case LS_MODIFIER_MATERIAL:
{
LineStyleAlphaModifier_Material *p = (LineStyleAlphaModifier_Material *)m;
LineStyleAlphaModifier_Material *q = (LineStyleAlphaModifier_Material *)new_m;
q->curve = curvemapping_copy(p->curve);
q->flags = p->flags;
q->mat_attr = p->mat_attr;
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->alpha_modifiers, new_m);
@@ -458,18 +458,18 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
void BKE_remove_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
curvemapping_free(((LineStyleAlphaModifier_AlongStroke *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
curvemapping_free(((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
curvemapping_free(((LineStyleAlphaModifier_DistanceFromObject *)m)->curve);
break;
case LS_MODIFIER_MATERIAL:
curvemapping_free(((LineStyleAlphaModifier_Material *)m)->curve);
break;
case LS_MODIFIER_ALONG_STROKE:
curvemapping_free(((LineStyleAlphaModifier_AlongStroke *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
curvemapping_free(((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
curvemapping_free(((LineStyleAlphaModifier_DistanceFromObject *)m)->curve);
break;
case LS_MODIFIER_MATERIAL:
curvemapping_free(((LineStyleAlphaModifier_Material *)m)->curve);
break;
}
BLI_freelinkN(&linestyle->alpha_modifiers, m);
}
@@ -479,23 +479,23 @@ static LineStyleModifier *alloc_thickness_modifier(int type)
size_t size;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
size = sizeof(LineStyleThicknessModifier_AlongStroke);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
size = sizeof(LineStyleThicknessModifier_DistanceFromCamera);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
size = sizeof(LineStyleThicknessModifier_DistanceFromObject);
break;
case LS_MODIFIER_MATERIAL:
size = sizeof(LineStyleThicknessModifier_Material);
break;
case LS_MODIFIER_CALLIGRAPHY:
size = sizeof(LineStyleThicknessModifier_Calligraphy);
break;
default:
return NULL; /* unknown modifier type */
case LS_MODIFIER_ALONG_STROKE:
size = sizeof(LineStyleThicknessModifier_AlongStroke);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
size = sizeof(LineStyleThicknessModifier_DistanceFromCamera);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
size = sizeof(LineStyleThicknessModifier_DistanceFromObject);
break;
case LS_MODIFIER_MATERIAL:
size = sizeof(LineStyleThicknessModifier_Material);
break;
case LS_MODIFIER_CALLIGRAPHY:
size = sizeof(LineStyleThicknessModifier_Calligraphy);
break;
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
@@ -509,15 +509,15 @@ LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *line
m->blend = LS_VALUE_BLEND;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
case LS_MODIFIER_ALONG_STROKE:
{
LineStyleThicknessModifier_AlongStroke *p = (LineStyleThicknessModifier_AlongStroke *)m;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
p->value_min = 0.0f;
p->value_max = 1.0f;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
{
LineStyleThicknessModifier_DistanceFromCamera *p = (LineStyleThicknessModifier_DistanceFromCamera *)m;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -525,9 +525,9 @@ LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *line
p->range_max = 1000.0f;
p->value_min = 0.0f;
p->value_max = 1.0f;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
{
LineStyleThicknessModifier_DistanceFromObject *p = (LineStyleThicknessModifier_DistanceFromObject *)m;
p->target = NULL;
@@ -536,27 +536,27 @@ LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *line
p->range_max = 1000.0f;
p->value_min = 0.0f;
p->value_max = 1.0f;
break;
}
break;
case LS_MODIFIER_MATERIAL:
case LS_MODIFIER_MATERIAL:
{
LineStyleThicknessModifier_Material *p = (LineStyleThicknessModifier_Material *)m;
p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
p->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
p->value_min = 0.0f;
p->value_max = 1.0f;
break;
}
break;
case LS_MODIFIER_CALLIGRAPHY:
case LS_MODIFIER_CALLIGRAPHY:
{
LineStyleThicknessModifier_Calligraphy *p = (LineStyleThicknessModifier_Calligraphy *)m;
p->min_thickness = 1.0f;
p->max_thickness = 10.0f;
p->orientation = DEG2RADF(60.0f);
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->thickness_modifiers, m);
@@ -575,7 +575,7 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
new_m->blend = m->blend;
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
case LS_MODIFIER_ALONG_STROKE:
{
LineStyleThicknessModifier_AlongStroke *p = (LineStyleThicknessModifier_AlongStroke *)m;
LineStyleThicknessModifier_AlongStroke *q = (LineStyleThicknessModifier_AlongStroke *)new_m;
@@ -583,9 +583,9 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
q->flags = p->flags;
q->value_min = p->value_min;
q->value_max = p->value_max;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
{
LineStyleThicknessModifier_DistanceFromCamera *p = (LineStyleThicknessModifier_DistanceFromCamera *)m;
LineStyleThicknessModifier_DistanceFromCamera *q = (LineStyleThicknessModifier_DistanceFromCamera *)new_m;
@@ -595,9 +595,9 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
q->range_max = p->range_max;
q->value_min = p->value_min;
q->value_max = p->value_max;
break;
}
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
{
LineStyleThicknessModifier_DistanceFromObject *p = (LineStyleThicknessModifier_DistanceFromObject *)m;
LineStyleThicknessModifier_DistanceFromObject *q = (LineStyleThicknessModifier_DistanceFromObject *)new_m;
@@ -610,9 +610,9 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
q->range_max = p->range_max;
q->value_min = p->value_min;
q->value_max = p->value_max;
break;
}
break;
case LS_MODIFIER_MATERIAL:
case LS_MODIFIER_MATERIAL:
{
LineStyleThicknessModifier_Material *p = (LineStyleThicknessModifier_Material *)m;
LineStyleThicknessModifier_Material *q = (LineStyleThicknessModifier_Material *)new_m;
@@ -621,19 +621,19 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
q->mat_attr = p->mat_attr;
q->value_min = p->value_min;
q->value_max = p->value_max;
break;
}
break;
case LS_MODIFIER_CALLIGRAPHY:
case LS_MODIFIER_CALLIGRAPHY:
{
LineStyleThicknessModifier_Calligraphy *p = (LineStyleThicknessModifier_Calligraphy *)m;
LineStyleThicknessModifier_Calligraphy *q = (LineStyleThicknessModifier_Calligraphy *)new_m;
q->min_thickness = p->min_thickness;
q->max_thickness = p->max_thickness;
q->orientation = p->orientation;
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->thickness_modifiers, new_m);
@@ -643,20 +643,20 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
void BKE_remove_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
{
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
curvemapping_free(((LineStyleThicknessModifier_AlongStroke *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
curvemapping_free(((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
curvemapping_free(((LineStyleThicknessModifier_DistanceFromObject *)m)->curve);
break;
case LS_MODIFIER_MATERIAL:
curvemapping_free(((LineStyleThicknessModifier_Material *)m)->curve);
break;
case LS_MODIFIER_CALLIGRAPHY:
break;
case LS_MODIFIER_ALONG_STROKE:
curvemapping_free(((LineStyleThicknessModifier_AlongStroke *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
curvemapping_free(((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve);
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
curvemapping_free(((LineStyleThicknessModifier_DistanceFromObject *)m)->curve);
break;
case LS_MODIFIER_MATERIAL:
curvemapping_free(((LineStyleThicknessModifier_Material *)m)->curve);
break;
case LS_MODIFIER_CALLIGRAPHY:
break;
}
BLI_freelinkN(&linestyle->thickness_modifiers, m);
}
@@ -666,47 +666,47 @@ static LineStyleModifier *alloc_geometry_modifier(int type)
size_t size;
switch (type) {
case LS_MODIFIER_SAMPLING:
size = sizeof(LineStyleGeometryModifier_Sampling);
break;
case LS_MODIFIER_BEZIER_CURVE:
size = sizeof(LineStyleGeometryModifier_BezierCurve);
break;
case LS_MODIFIER_SINUS_DISPLACEMENT:
size = sizeof(LineStyleGeometryModifier_SinusDisplacement);
break;
case LS_MODIFIER_SPATIAL_NOISE:
size = sizeof(LineStyleGeometryModifier_SpatialNoise);
break;
case LS_MODIFIER_PERLIN_NOISE_1D:
size = sizeof(LineStyleGeometryModifier_PerlinNoise1D);
break;
case LS_MODIFIER_PERLIN_NOISE_2D:
size = sizeof(LineStyleGeometryModifier_PerlinNoise2D);
break;
case LS_MODIFIER_BACKBONE_STRETCHER:
size = sizeof(LineStyleGeometryModifier_BackboneStretcher);
break;
case LS_MODIFIER_TIP_REMOVER:
size = sizeof(LineStyleGeometryModifier_TipRemover);
break;
case LS_MODIFIER_POLYGONIZATION:
size = sizeof(LineStyleGeometryModifier_Polygonalization);
break;
case LS_MODIFIER_GUIDING_LINES:
size = sizeof(LineStyleGeometryModifier_GuidingLines);
break;
case LS_MODIFIER_BLUEPRINT:
size = sizeof(LineStyleGeometryModifier_Blueprint);
break;
case LS_MODIFIER_2D_OFFSET:
size = sizeof(LineStyleGeometryModifier_2DOffset);
break;
case LS_MODIFIER_2D_TRANSFORM:
size = sizeof(LineStyleGeometryModifier_2DTransform);
break;
default:
return NULL; /* unknown modifier type */
case LS_MODIFIER_SAMPLING:
size = sizeof(LineStyleGeometryModifier_Sampling);
break;
case LS_MODIFIER_BEZIER_CURVE:
size = sizeof(LineStyleGeometryModifier_BezierCurve);
break;
case LS_MODIFIER_SINUS_DISPLACEMENT:
size = sizeof(LineStyleGeometryModifier_SinusDisplacement);
break;
case LS_MODIFIER_SPATIAL_NOISE:
size = sizeof(LineStyleGeometryModifier_SpatialNoise);
break;
case LS_MODIFIER_PERLIN_NOISE_1D:
size = sizeof(LineStyleGeometryModifier_PerlinNoise1D);
break;
case LS_MODIFIER_PERLIN_NOISE_2D:
size = sizeof(LineStyleGeometryModifier_PerlinNoise2D);
break;
case LS_MODIFIER_BACKBONE_STRETCHER:
size = sizeof(LineStyleGeometryModifier_BackboneStretcher);
break;
case LS_MODIFIER_TIP_REMOVER:
size = sizeof(LineStyleGeometryModifier_TipRemover);
break;
case LS_MODIFIER_POLYGONIZATION:
size = sizeof(LineStyleGeometryModifier_Polygonalization);
break;
case LS_MODIFIER_GUIDING_LINES:
size = sizeof(LineStyleGeometryModifier_GuidingLines);
break;
case LS_MODIFIER_BLUEPRINT:
size = sizeof(LineStyleGeometryModifier_Blueprint);
break;
case LS_MODIFIER_2D_OFFSET:
size = sizeof(LineStyleGeometryModifier_2DOffset);
break;
case LS_MODIFIER_2D_TRANSFORM:
size = sizeof(LineStyleGeometryModifier_2DTransform);
break;
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
@@ -719,78 +719,78 @@ LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
m = alloc_geometry_modifier(type);
switch (type) {
case LS_MODIFIER_SAMPLING:
case LS_MODIFIER_SAMPLING:
{
LineStyleGeometryModifier_Sampling *p = (LineStyleGeometryModifier_Sampling *)m;
p->sampling = 10.0f;
break;
}
break;
case LS_MODIFIER_BEZIER_CURVE:
case LS_MODIFIER_BEZIER_CURVE:
{
LineStyleGeometryModifier_BezierCurve *p = (LineStyleGeometryModifier_BezierCurve *)m;
p->error = 10.0f;
break;
}
break;
case LS_MODIFIER_SINUS_DISPLACEMENT:
case LS_MODIFIER_SINUS_DISPLACEMENT:
{
LineStyleGeometryModifier_SinusDisplacement *p = (LineStyleGeometryModifier_SinusDisplacement *)m;
p->wavelength = 20.0f;
p->amplitude = 5.0f;
p->phase = 0.0f;
break;
}
break;
case LS_MODIFIER_SPATIAL_NOISE:
case LS_MODIFIER_SPATIAL_NOISE:
{
LineStyleGeometryModifier_SpatialNoise *p = (LineStyleGeometryModifier_SpatialNoise *)m;
p->amplitude = 5.0f;
p->scale = 20.0f;
p->octaves = 4;
p->flags = LS_MODIFIER_SPATIAL_NOISE_SMOOTH | LS_MODIFIER_SPATIAL_NOISE_PURERANDOM;
break;
}
break;
case LS_MODIFIER_PERLIN_NOISE_1D:
case LS_MODIFIER_PERLIN_NOISE_1D:
{
LineStyleGeometryModifier_PerlinNoise1D *p = (LineStyleGeometryModifier_PerlinNoise1D *)m;
p->frequency = 10.0f;
p->amplitude = 10.0f;
p->octaves = 4;
p->angle = DEG2RADF(45.0f);
break;
}
break;
case LS_MODIFIER_PERLIN_NOISE_2D:
case LS_MODIFIER_PERLIN_NOISE_2D:
{
LineStyleGeometryModifier_PerlinNoise2D *p = (LineStyleGeometryModifier_PerlinNoise2D *)m;
p->frequency = 10.0f;
p->amplitude = 10.0f;
p->octaves = 4;
p->angle = DEG2RADF(45.0f);
break;
}
break;
case LS_MODIFIER_BACKBONE_STRETCHER:
case LS_MODIFIER_BACKBONE_STRETCHER:
{
LineStyleGeometryModifier_BackboneStretcher *p = (LineStyleGeometryModifier_BackboneStretcher *)m;
p->backbone_length = 10.0f;
break;
}
break;
case LS_MODIFIER_TIP_REMOVER:
case LS_MODIFIER_TIP_REMOVER:
{
LineStyleGeometryModifier_TipRemover *p = (LineStyleGeometryModifier_TipRemover *)m;
p->tip_length = 10.0f;
break;
}
break;
case LS_MODIFIER_POLYGONIZATION:
case LS_MODIFIER_POLYGONIZATION:
{
LineStyleGeometryModifier_Polygonalization *p = (LineStyleGeometryModifier_Polygonalization *)m;
p->error = 10.0f;
break;
}
break;
case LS_MODIFIER_GUIDING_LINES:
case LS_MODIFIER_GUIDING_LINES:
{
LineStyleGeometryModifier_GuidingLines *p = (LineStyleGeometryModifier_GuidingLines *)m;
p->offset = 0.0f;
break;
}
break;
case LS_MODIFIER_BLUEPRINT:
case LS_MODIFIER_BLUEPRINT:
{
LineStyleGeometryModifier_Blueprint *p = (LineStyleGeometryModifier_Blueprint *)m;
p->flags = LS_MODIFIER_BLUEPRINT_CIRCLES;
@@ -799,18 +799,18 @@ LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
p->random_radius = 3;
p->random_center = 5;
p->random_backbone = 5;
break;
}
break;
case LS_MODIFIER_2D_OFFSET:
case LS_MODIFIER_2D_OFFSET:
{
LineStyleGeometryModifier_2DOffset *p = (LineStyleGeometryModifier_2DOffset *)m;
p->start = 0.0f;
p->end = 0.0f;
p->x = 0.0f;
p->y = 0.0f;
break;
}
break;
case LS_MODIFIER_2D_TRANSFORM:
case LS_MODIFIER_2D_TRANSFORM:
{
LineStyleGeometryModifier_2DTransform *p = (LineStyleGeometryModifier_2DTransform *)m;
p->pivot = LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER;
@@ -820,10 +820,10 @@ LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
p->pivot_u = 0.5f;
p->pivot_x = 0.0f;
p->pivot_y = 0.0f;
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->geometry_modifiers, m);
@@ -838,30 +838,30 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
new_m->flags = m->flags;
switch (m->type) {
case LS_MODIFIER_SAMPLING:
case LS_MODIFIER_SAMPLING:
{
LineStyleGeometryModifier_Sampling *p = (LineStyleGeometryModifier_Sampling *)m;
LineStyleGeometryModifier_Sampling *q = (LineStyleGeometryModifier_Sampling *)new_m;
q->sampling = p->sampling;
break;
}
break;
case LS_MODIFIER_BEZIER_CURVE:
case LS_MODIFIER_BEZIER_CURVE:
{
LineStyleGeometryModifier_BezierCurve *p = (LineStyleGeometryModifier_BezierCurve *)m;
LineStyleGeometryModifier_BezierCurve *q = (LineStyleGeometryModifier_BezierCurve *)new_m;
q->error = p->error;
break;
}
break;
case LS_MODIFIER_SINUS_DISPLACEMENT:
case LS_MODIFIER_SINUS_DISPLACEMENT:
{
LineStyleGeometryModifier_SinusDisplacement *p = (LineStyleGeometryModifier_SinusDisplacement *)m;
LineStyleGeometryModifier_SinusDisplacement *q = (LineStyleGeometryModifier_SinusDisplacement *)new_m;
q->wavelength = p->wavelength;
q->amplitude = p->amplitude;
q->phase = p->phase;
break;
}
break;
case LS_MODIFIER_SPATIAL_NOISE:
case LS_MODIFIER_SPATIAL_NOISE:
{
LineStyleGeometryModifier_SpatialNoise *p = (LineStyleGeometryModifier_SpatialNoise *)m;
LineStyleGeometryModifier_SpatialNoise *q = (LineStyleGeometryModifier_SpatialNoise *)new_m;
@@ -869,9 +869,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
q->scale = p->scale;
q->octaves = p->octaves;
q->flags = p->flags;
break;
}
break;
case LS_MODIFIER_PERLIN_NOISE_1D:
case LS_MODIFIER_PERLIN_NOISE_1D:
{
LineStyleGeometryModifier_PerlinNoise1D *p = (LineStyleGeometryModifier_PerlinNoise1D *)m;
LineStyleGeometryModifier_PerlinNoise1D *q = (LineStyleGeometryModifier_PerlinNoise1D *)new_m;
@@ -880,9 +880,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
q->angle = p->angle;
q->octaves = p->octaves;
q->seed = p->seed;
break;
}
break;
case LS_MODIFIER_PERLIN_NOISE_2D:
case LS_MODIFIER_PERLIN_NOISE_2D:
{
LineStyleGeometryModifier_PerlinNoise2D *p = (LineStyleGeometryModifier_PerlinNoise2D *)m;
LineStyleGeometryModifier_PerlinNoise2D *q = (LineStyleGeometryModifier_PerlinNoise2D *)new_m;
@@ -891,37 +891,37 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
q->angle = p->angle;
q->octaves = p->octaves;
q->seed = p->seed;
break;
}
break;
case LS_MODIFIER_BACKBONE_STRETCHER:
case LS_MODIFIER_BACKBONE_STRETCHER:
{
LineStyleGeometryModifier_BackboneStretcher *p = (LineStyleGeometryModifier_BackboneStretcher *)m;
LineStyleGeometryModifier_BackboneStretcher *q = (LineStyleGeometryModifier_BackboneStretcher *)new_m;
q->backbone_length = p->backbone_length;
break;
}
break;
case LS_MODIFIER_TIP_REMOVER:
case LS_MODIFIER_TIP_REMOVER:
{
LineStyleGeometryModifier_TipRemover *p = (LineStyleGeometryModifier_TipRemover *)m;
LineStyleGeometryModifier_TipRemover *q = (LineStyleGeometryModifier_TipRemover *)new_m;
q->tip_length = p->tip_length;
break;
}
break;
case LS_MODIFIER_POLYGONIZATION:
case LS_MODIFIER_POLYGONIZATION:
{
LineStyleGeometryModifier_Polygonalization *p = (LineStyleGeometryModifier_Polygonalization *)m;
LineStyleGeometryModifier_Polygonalization *q = (LineStyleGeometryModifier_Polygonalization *)new_m;
q->error = p->error;
break;
}
break;
case LS_MODIFIER_GUIDING_LINES:
case LS_MODIFIER_GUIDING_LINES:
{
LineStyleGeometryModifier_GuidingLines *p = (LineStyleGeometryModifier_GuidingLines *)m;
LineStyleGeometryModifier_GuidingLines *q = (LineStyleGeometryModifier_GuidingLines *)new_m;
q->offset = p->offset;
break;
}
break;
case LS_MODIFIER_BLUEPRINT:
case LS_MODIFIER_BLUEPRINT:
{
LineStyleGeometryModifier_Blueprint *p = (LineStyleGeometryModifier_Blueprint *)m;
LineStyleGeometryModifier_Blueprint *q = (LineStyleGeometryModifier_Blueprint *)new_m;
@@ -931,9 +931,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
q->random_radius = p->random_radius;
q->random_center = p->random_center;
q->random_backbone = p->random_backbone;
break;
}
break;
case LS_MODIFIER_2D_OFFSET:
case LS_MODIFIER_2D_OFFSET:
{
LineStyleGeometryModifier_2DOffset *p = (LineStyleGeometryModifier_2DOffset *)m;
LineStyleGeometryModifier_2DOffset *q = (LineStyleGeometryModifier_2DOffset *)new_m;
@@ -941,9 +941,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
q->end = p->end;
q->x = p->x;
q->y = p->y;
break;
}
break;
case LS_MODIFIER_2D_TRANSFORM:
case LS_MODIFIER_2D_TRANSFORM:
{
LineStyleGeometryModifier_2DTransform *p = (LineStyleGeometryModifier_2DTransform *)m;
LineStyleGeometryModifier_2DTransform *q = (LineStyleGeometryModifier_2DTransform *)new_m;
@@ -954,10 +954,10 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
q->pivot_u = p->pivot_u;
q->pivot_x = p->pivot_x;
q->pivot_y = p->pivot_y;
break;
}
break;
default:
return NULL; /* unknown modifier type */
default:
return NULL; /* unknown modifier type */
}
add_to_modifier_list(&linestyle->geometry_modifiers, new_m);
@@ -1007,20 +1007,20 @@ void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *list
listbase->first = listbase->last = NULL;
for (m = (LineStyleModifier *)linestyle->color_modifiers.first; m; m = m->next) {
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
color_ramp = ((LineStyleColorModifier_AlongStroke *)m)->color_ramp;
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
color_ramp = ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp;
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
color_ramp = ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp;
break;
case LS_MODIFIER_MATERIAL:
color_ramp = ((LineStyleColorModifier_Material *)m)->color_ramp;
break;
default:
continue;
case LS_MODIFIER_ALONG_STROKE:
color_ramp = ((LineStyleColorModifier_AlongStroke *)m)->color_ramp;
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
color_ramp = ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp;
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
color_ramp = ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp;
break;
case LS_MODIFIER_MATERIAL:
color_ramp = ((LineStyleColorModifier_Material *)m)->color_ramp;
break;
default:
continue;
}
link = (LinkData *) MEM_callocN( sizeof(LinkData), "link to color ramp");
link->data = color_ramp;
@@ -496,10 +496,10 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
/* this should _almost_ never happen but since it can in extreme cases,
* we have to clamp the values or we overrun the buffer and crash */
CLAMP(xi_min, 0, layer->buckets_x - 1);
CLAMP(xi_max, 0, layer->buckets_x - 1);
CLAMP(yi_min, 0, layer->buckets_y - 1);
CLAMP(yi_max, 0, layer->buckets_y - 1);
if (xi_min >= layer->buckets_x) xi_min = layer->buckets_x - 1;
if (xi_max >= layer->buckets_x) xi_max = layer->buckets_x - 1;
if (yi_min >= layer->buckets_y) yi_min = layer->buckets_y - 1;
if (yi_max >= layer->buckets_y) yi_max = layer->buckets_y - 1;
for (yi = yi_min; yi <= yi_max; yi++) {
unsigned int bucket_index = (layer->buckets_x * yi) + xi_min;
+5 -5
View File
@@ -1432,8 +1432,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
r_col[1] = facm * (r_col[1]) + fac * tmpg;
r_col[2] = facm * (r_col[2]) + fac * tmpb;
}
break;
}
break;
case MA_RAMP_SAT:
{
float rH, rS, rV;
@@ -1443,8 +1443,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
hsv_to_rgb(rH, (facm * rS + fac * colS), rV, r_col + 0, r_col + 1, r_col + 2);
}
break;
}
break;
case MA_RAMP_VAL:
{
float rH, rS, rV;
@@ -1452,8 +1452,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
hsv_to_rgb(rH, rS, (facm * rV + fac * colV), r_col + 0, r_col + 1, r_col + 2);
break;
}
break;
case MA_RAMP_COLOR:
{
float rH, rS, rV;
@@ -1467,8 +1467,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
r_col[1] = facm * (r_col[1]) + fac * tmpg;
r_col[2] = facm * (r_col[2]) + fac * tmpb;
}
break;
}
break;
case MA_RAMP_SOFT:
{
float scr, scg, scb;
@@ -1481,8 +1481,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
r_col[0] = facm * (r_col[0]) + fac * (((1.0f - r_col[0]) * col[0] * (r_col[0])) + (r_col[0] * scr));
r_col[1] = facm * (r_col[1]) + fac * (((1.0f - r_col[1]) * col[1] * (r_col[1])) + (r_col[1] * scg));
r_col[2] = facm * (r_col[2]) + fac * (((1.0f - r_col[2]) * col[2] * (r_col[2])) + (r_col[2] * scb));
break;
}
break;
case MA_RAMP_LINEAR:
if (col[0] > 0.5f)
r_col[0] = r_col[0] + fac * (2.0f * (col[0] - 0.5f));
+4 -1
View File
@@ -2203,10 +2203,13 @@ static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata,
if (ld->disps)
MEM_freeN(ld->disps);
ld->disps = MEM_callocN(sizeof(float) * 3 * side * side, "converted loop mdisps");
ld->disps = MEM_mallocN(sizeof(float) * 3 * side * side, "converted loop mdisps");
if (fd->disps) {
memcpy(ld->disps, disps, sizeof(float) * 3 * side * side);
}
else {
memset(ld->disps, 0, sizeof(float) * 3 * side * side);
}
}
}
}
@@ -440,6 +440,9 @@ int buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int *vertsPerPoly,
int ntris = 0, *recastData = NULL;
unsigned short *tris = NULL;
/* Don't bother converting if there is nothing to convert */
if (!*nverts) return 0;
res = buildRawVertIndicesData(dm, nverts, verts, &ntris, &tris, trisToFacesMap, &recastData);
if (!res) {
printf("Converting navmesh: Error! Can't get vertices and indices from mesh\n");
+108 -108
View File
@@ -525,60 +525,60 @@ bNodeSocket *nodeInsertSocket(bNodeTree *ntree, bNode *node, int in_out, const c
const char *nodeStaticSocketType(int type, int subtype)
{
switch (type) {
case SOCK_FLOAT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketFloatUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketFloatPercentage";
case PROP_FACTOR:
return "NodeSocketFloatFactor";
case PROP_ANGLE:
return "NodeSocketFloatAngle";
case PROP_TIME:
return "NodeSocketFloatTime";
case PROP_NONE:
default:
return "NodeSocketFloat";
}
case SOCK_INT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketIntUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketIntPercentage";
case PROP_FACTOR:
return "NodeSocketIntFactor";
case PROP_NONE:
default:
return "NodeSocketInt";
}
case SOCK_BOOLEAN:
return "NodeSocketBool";
case SOCK_VECTOR:
switch (subtype) {
case PROP_TRANSLATION:
return "NodeSocketVectorTranslation";
case PROP_DIRECTION:
return "NodeSocketVectorDirection";
case PROP_VELOCITY:
return "NodeSocketVectorVelocity";
case PROP_ACCELERATION:
return "NodeSocketVectorAcceleration";
case PROP_EULER:
return "NodeSocketVectorEuler";
case PROP_XYZ:
return "NodeSocketVectorXYZ";
case PROP_NONE:
default:
return "NodeSocketVector";
}
case SOCK_RGBA:
return "NodeSocketColor";
case SOCK_STRING:
return "NodeSocketString";
case SOCK_SHADER:
return "NodeSocketShader";
case SOCK_FLOAT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketFloatUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketFloatPercentage";
case PROP_FACTOR:
return "NodeSocketFloatFactor";
case PROP_ANGLE:
return "NodeSocketFloatAngle";
case PROP_TIME:
return "NodeSocketFloatTime";
case PROP_NONE:
default:
return "NodeSocketFloat";
}
case SOCK_INT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketIntUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketIntPercentage";
case PROP_FACTOR:
return "NodeSocketIntFactor";
case PROP_NONE:
default:
return "NodeSocketInt";
}
case SOCK_BOOLEAN:
return "NodeSocketBool";
case SOCK_VECTOR:
switch (subtype) {
case PROP_TRANSLATION:
return "NodeSocketVectorTranslation";
case PROP_DIRECTION:
return "NodeSocketVectorDirection";
case PROP_VELOCITY:
return "NodeSocketVectorVelocity";
case PROP_ACCELERATION:
return "NodeSocketVectorAcceleration";
case PROP_EULER:
return "NodeSocketVectorEuler";
case PROP_XYZ:
return "NodeSocketVectorXYZ";
case PROP_NONE:
default:
return "NodeSocketVector";
}
case SOCK_RGBA:
return "NodeSocketColor";
case SOCK_STRING:
return "NodeSocketString";
case SOCK_SHADER:
return "NodeSocketShader";
}
return NULL;
}
@@ -586,60 +586,60 @@ const char *nodeStaticSocketType(int type, int subtype)
const char *nodeStaticSocketInterfaceType(int type, int subtype)
{
switch (type) {
case SOCK_FLOAT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketInterfaceFloatUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketInterfaceFloatPercentage";
case PROP_FACTOR:
return "NodeSocketInterfaceFloatFactor";
case PROP_ANGLE:
return "NodeSocketInterfaceFloatAngle";
case PROP_TIME:
return "NodeSocketInterfaceFloatTime";
case PROP_NONE:
default:
return "NodeSocketInterfaceFloat";
}
case SOCK_INT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketInterfaceIntUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketInterfaceIntPercentage";
case PROP_FACTOR:
return "NodeSocketInterfaceIntFactor";
case PROP_NONE:
default:
return "NodeSocketInterfaceInt";
}
case SOCK_BOOLEAN:
return "NodeSocketInterfaceBool";
case SOCK_VECTOR:
switch (subtype) {
case PROP_TRANSLATION:
return "NodeSocketInterfaceVectorTranslation";
case PROP_DIRECTION:
return "NodeSocketInterfaceVectorDirection";
case PROP_VELOCITY:
return "NodeSocketInterfaceVectorVelocity";
case PROP_ACCELERATION:
return "NodeSocketInterfaceVectorAcceleration";
case PROP_EULER:
return "NodeSocketInterfaceVectorEuler";
case PROP_XYZ:
return "NodeSocketInterfaceVectorXYZ";
case PROP_NONE:
default:
return "NodeSocketInterfaceVector";
}
case SOCK_RGBA:
return "NodeSocketInterfaceColor";
case SOCK_STRING:
return "NodeSocketInterfaceString";
case SOCK_SHADER:
return "NodeSocketInterfaceShader";
case SOCK_FLOAT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketInterfaceFloatUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketInterfaceFloatPercentage";
case PROP_FACTOR:
return "NodeSocketInterfaceFloatFactor";
case PROP_ANGLE:
return "NodeSocketInterfaceFloatAngle";
case PROP_TIME:
return "NodeSocketInterfaceFloatTime";
case PROP_NONE:
default:
return "NodeSocketInterfaceFloat";
}
case SOCK_INT:
switch (subtype) {
case PROP_UNSIGNED:
return "NodeSocketInterfaceIntUnsigned";
case PROP_PERCENTAGE:
return "NodeSocketInterfaceIntPercentage";
case PROP_FACTOR:
return "NodeSocketInterfaceIntFactor";
case PROP_NONE:
default:
return "NodeSocketInterfaceInt";
}
case SOCK_BOOLEAN:
return "NodeSocketInterfaceBool";
case SOCK_VECTOR:
switch (subtype) {
case PROP_TRANSLATION:
return "NodeSocketInterfaceVectorTranslation";
case PROP_DIRECTION:
return "NodeSocketInterfaceVectorDirection";
case PROP_VELOCITY:
return "NodeSocketInterfaceVectorVelocity";
case PROP_ACCELERATION:
return "NodeSocketInterfaceVectorAcceleration";
case PROP_EULER:
return "NodeSocketInterfaceVectorEuler";
case PROP_XYZ:
return "NodeSocketInterfaceVectorXYZ";
case PROP_NONE:
default:
return "NodeSocketInterfaceVector";
}
case SOCK_RGBA:
return "NodeSocketInterfaceColor";
case SOCK_STRING:
return "NodeSocketInterfaceString";
case SOCK_SHADER:
return "NodeSocketInterfaceShader";
}
return NULL;
}
+9 -7
View File
@@ -1619,13 +1619,15 @@ void BKE_object_mat3_to_rot(Object *ob, float mat[3][3], bool use_compat)
normalize_qt_qt(dquat, ob->dquat);
invert_qt(dquat);
mul_qt_qtqt(ob->quat, dquat, ob->quat);
break;
}
break;
case ROT_MODE_AXISANGLE:
{
mat3_to_axis_angle(ob->rotAxis, &ob->rotAngle, mat);
sub_v3_v3(ob->rotAxis, ob->drotAxis);
ob->rotAngle -= ob->drotAngle;
break;
}
default: /* euler */
{
float quat[4];
@@ -2390,8 +2392,8 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
minmax_v3v3_v3(min_r, max_r, bb.vec[a]);
}
change = TRUE;
break;
}
break;
case OB_LATTICE:
{
Lattice *lt = ob->data;
@@ -2407,9 +2409,10 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
}
}
change = TRUE;
break;
}
break;
case OB_ARMATURE:
{
if (ob->pose) {
bArmature *arm = ob->data;
bPoseChannel *pchan;
@@ -2428,6 +2431,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
}
}
break;
}
case OB_MESH:
{
Mesh *me = BKE_mesh_from_object(ob);
@@ -2441,8 +2445,8 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
}
change = TRUE;
}
break;
}
break;
case OB_MBALL:
{
float ob_min[3], ob_max[3];
@@ -2741,10 +2745,8 @@ void BKE_object_handle_update_ex(Scene *scene, Object *ob,
makeDerivedMesh(scene, ob, NULL, data_mask, 0);
}
#endif
break;
}
break;
case OB_ARMATURE:
if (ob->id.lib && ob->proxy_from) {
if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
+3 -1
View File
@@ -179,8 +179,10 @@ static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const int do_cache
if (seq->strip)
seq_free_strip(seq->strip);
if (seq->anim)
if (seq->anim) {
IMB_free_anim(seq->anim);
seq->anim = NULL;
}
if (seq->type & SEQ_TYPE_EFFECT) {
struct SeqEffectHandle sh = BKE_sequence_get_effect(seq);
@@ -1970,7 +1970,7 @@ static void ccgDM_drawFacesGLSL(DerivedMesh *dm, DMSetMaterial setMaterial)
/* Only used by non-editmesh types */
static void ccgDM_drawMappedFacesMat(DerivedMesh *dm,
void (*setMaterial)(void *userData, int, void *attribs),
int (*setFace)(void *userData, int index), void *userData)
bool (*setFace)(void *userData, int index), void *userData)
{
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
+17 -17
View File
@@ -1072,23 +1072,23 @@ int BKE_ffmpeg_start(struct Scene *scene, RenderData *rd, int rectx, int recty,
specs.channels = c->channels;
switch (av_get_packed_sample_fmt(c->sample_fmt)) {
case AV_SAMPLE_FMT_U8:
specs.format = AUD_FORMAT_U8;
break;
case AV_SAMPLE_FMT_S16:
specs.format = AUD_FORMAT_S16;
break;
case AV_SAMPLE_FMT_S32:
specs.format = AUD_FORMAT_S32;
break;
case AV_SAMPLE_FMT_FLT:
specs.format = AUD_FORMAT_FLOAT32;
break;
case AV_SAMPLE_FMT_DBL:
specs.format = AUD_FORMAT_FLOAT64;
break;
default:
return -31415;
case AV_SAMPLE_FMT_U8:
specs.format = AUD_FORMAT_U8;
break;
case AV_SAMPLE_FMT_S16:
specs.format = AUD_FORMAT_S16;
break;
case AV_SAMPLE_FMT_S32:
specs.format = AUD_FORMAT_S32;
break;
case AV_SAMPLE_FMT_FLT:
specs.format = AUD_FORMAT_FLOAT32;
break;
case AV_SAMPLE_FMT_DBL:
specs.format = AUD_FORMAT_FLOAT64;
break;
default:
return -31415;
}
specs.rate = rd->ffcodecdata.audio_mixrate;
+2 -1
View File
@@ -72,7 +72,7 @@ struct BVHTree {
/* optimization, ensure we stay small */
BLI_STATIC_ASSERT((sizeof(void *) == 8 && sizeof(BVHTree) <= 48) ||
(sizeof(void *) == 4 && sizeof(BVHTree) <= 32),
"over sized");
"over sized")
typedef struct BVHOverlapData {
BVHTree *tree1, *tree2;
@@ -603,6 +603,7 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data)
data->branches_on_level[0] = 1;
/* We could stop the loop first (but I am lazy to find out when) */
/* note: this often causes integer overflow, may be worth avoiding? - campbell */
for (depth = 1; depth < 32; depth++) {
data->branches_on_level[depth] = data->branches_on_level[depth - 1] * data->tree_type;
data->leafs_per_child[depth] = data->leafs_per_child[depth - 1] / data->tree_type;
+7 -4
View File
@@ -437,19 +437,22 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
void BLI_mempool_destroy(BLI_mempool *pool)
{
BLI_mempool_chunk *mpchunk = NULL;
BLI_mempool_chunk *mpchunk_next;
if (pool->flag & BLI_MEMPOOL_SYSMALLOC) {
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk_next) {
mpchunk_next = mpchunk->next;
free(mpchunk->data);
free(mpchunk);
}
BLI_freelist(&(pool->chunks));
free(pool);
}
else {
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk_next) {
mpchunk_next = mpchunk->next;
MEM_freeN(mpchunk->data);
MEM_freeN(mpchunk);
}
BLI_freelistN(&(pool->chunks));
MEM_freeN(pool);
}
}
+3 -5
View File
@@ -539,9 +539,8 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
parNode->left = node;
node->parent = parNode;
break;
}
break;
case 1: /* add new node as right child */
{
node = new_cb(data);
@@ -549,15 +548,14 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
parNode->right = node;
node->parent = parNode;
break;
}
break;
default: /* update the duplicate node as appropriate */
{
if (update_cb)
update_cb(parNode, data);
break;
}
break;
}
}
else {
+3 -2
View File
@@ -494,6 +494,7 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
float a1, a2, b1, b2, c1, c2, d;
float u, v;
const float eps = 0.000001f;
const float eps_sq = eps * eps;
a1 = v2[0] - v1[0];
b1 = v4[0] - v3[0];
@@ -510,8 +511,8 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
float a[2], b[2], c[2];
float u2;
if (len_v2v2(v1, v2) == 0.0f) {
if (len_v2v2(v3, v4) > eps) {
if (equals_v2v2(v1, v2)) {
if (len_squared_v2v2(v3, v4) > eps_sq) {
/* use non-point segment as basis */
SWAP(const float *, v1, v3);
SWAP(const float *, v2, v4);
@@ -1816,7 +1816,7 @@ static int _axis_convert_lut[23][24] = {
{0x408, 0x810, 0xA20, 0x228, 0x081, 0x891, 0x699, 0x2A9, 0x102, 0x50A,
0x71A, 0xB22, 0x4CB, 0x8D3, 0xAE3, 0x2EB, 0x144, 0x954, 0x75C, 0x36C,
0x045, 0x44D, 0x65D, 0xA65},
};
};
// _axis_convert_num = {'X': 0, 'Y': 1, 'Z': 2, '-X': 3, '-Y': 4, '-Z': 5}
+2 -3
View File
@@ -610,9 +610,8 @@ bool BLI_parent_dir(char *path)
{
static char parent_dir[] = {'.', '.', SEP, '\0'}; /* "../" or "..\\" */
char tmp[FILE_MAX + 4];
BLI_strncpy(tmp, path, sizeof(tmp) - 4);
BLI_add_slash(tmp);
strcat(tmp, parent_dir);
BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */
if (!BLI_testextensie(tmp, parent_dir)) {
+4 -4
View File
@@ -44,7 +44,7 @@
#if defined(__sun__) || defined(__sun) || defined(__NetBSD__)
# include <sys/statvfs.h> /* Other modern unix os's should probably use this also */
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
#elif !defined(__FreeBSD__) && !defined(__linux__) && (defined(__sparc) || defined(__sparc__))
# include <sys/statfs.h>
#endif
@@ -53,7 +53,7 @@
# include <sys/mount.h>
#endif
#if defined(linux) || defined(__CYGWIN32__) || defined(__hpux) || defined(__GNU__) || defined(__GLIBC__)
#if defined(__linux__) || defined(__CYGWIN32__) || defined(__hpux) || defined(__GNU__) || defined(__GLIBC__)
#include <sys/vfs.h>
#endif
@@ -194,13 +194,13 @@ double BLI_dir_free_space(const char *dir)
strcpy(name, "/");
}
#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
#if defined(__FreeBSD__) || defined(__linux__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
if (statfs(name, &disk)) return(-1);
#endif
#if defined(__sun__) || defined(__sun) || defined(__NetBSD__)
if (statvfs(name, &disk)) return(-1);
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
#elif !defined(__FreeBSD__) && !defined(__linux__) && (defined(__sparc) || defined(__sparc__))
/* WARNING - This may not be supported by geeneric unix os's - Campbell */
if (statfs(name, &disk, sizeof(struct statfs), 0)) return(-1);
#endif
+32 -25
View File
@@ -7687,31 +7687,38 @@ static const char *node_get_static_idname(int type, int treetype)
static const char *node_socket_get_static_idname(bNodeSocket *sock)
{
switch (sock->type) {
case SOCK_FLOAT: {
bNodeSocketValueFloat *dval = sock->default_value;
return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
}
case SOCK_INT: {
bNodeSocketValueInt *dval = sock->default_value;
return nodeStaticSocketType(SOCK_INT, dval->subtype);
}
case SOCK_BOOLEAN: {
return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
}
case SOCK_VECTOR: {
bNodeSocketValueVector *dval = sock->default_value;
return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
}
case SOCK_RGBA: {
return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
}
case SOCK_STRING: {
bNodeSocketValueString *dval = sock->default_value;
return nodeStaticSocketType(SOCK_STRING, dval->subtype);
}
case SOCK_SHADER: {
return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
}
case SOCK_FLOAT:
{
bNodeSocketValueFloat *dval = sock->default_value;
return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
}
case SOCK_INT:
{
bNodeSocketValueInt *dval = sock->default_value;
return nodeStaticSocketType(SOCK_INT, dval->subtype);
}
case SOCK_BOOLEAN:
{
return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
}
case SOCK_VECTOR:
{
bNodeSocketValueVector *dval = sock->default_value;
return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
}
case SOCK_RGBA:
{
return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
}
case SOCK_STRING:
{
bNodeSocketValueString *dval = sock->default_value;
return nodeStaticSocketType(SOCK_STRING, dval->subtype);
}
case SOCK_SHADER:
{
return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
}
}
return "";
}
@@ -561,8 +561,6 @@ static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
BMElemF *ele_f;
int i;
BLI_assert((unsigned int)test_for_enabled <= 1);
for (i = 0; i < 3; i++) {
if (htype & flag_types[i]) {
BM_ITER_MESH (ele_f, &iter, bm, iter_types[i]) {
@@ -937,7 +935,6 @@ static void bmo_slot_buffer_from_flag(BMesh *bm, BMOperator *op,
int totelement, i = 0;
BLI_assert(op->slots_in == slot_args || op->slots_out == slot_args);
BLI_assert((unsigned int)test_for_enabled <= 1);
if (test_for_enabled)
totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag);
+1 -1
View File
@@ -217,7 +217,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
/* Continue with ad-hoc fill methods since operators fail,
* edge, vcloud... may add more */
if (0) { /* nice feature but perhaps it should be a different tool? */
if (0) { /* nice feature but perhaps it should be a different tool? */
/* tricky feature for making a line/edge from selection history...
*
+4 -17
View File
@@ -130,9 +130,11 @@ static BMFace *copy_face(BMOperator *op,
BMOpSlot *slot_facemap_out,
BMesh *source_mesh,
BMFace *source_face, BMesh *target_mesh,
BMVert **vtar, BMEdge **edar, GHash *vhash, GHash *ehash)
GHash *vhash, GHash *ehash)
{
/* BMVert *target_vert1, *target_vert2; */ /* UNUSED */
BMVert **vtar = BLI_array_alloca(vtar, source_face->len);
BMEdge **edar = BLI_array_alloca(edar, source_face->len);
BMLoop *source_loop, *target_loop;
BMFace *target_face = NULL;
BMIter iter, iter2;
@@ -190,11 +192,6 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
BMVert *v = NULL, *v2;
BMEdge *e = NULL;
BMFace *f = NULL;
BLI_array_declare(vtar);
BLI_array_declare(edar);
BMVert **vtar = NULL;
BMEdge **edar = NULL;
BMIter viter, eiter, fiter;
GHash *vhash, *ehash;
@@ -280,14 +277,7 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
}
}
/* ensure arrays are the right size */
BLI_array_empty(vtar);
BLI_array_empty(edar);
BLI_array_grow_items(vtar, f->len);
BLI_array_grow_items(edar, f->len);
copy_face(op, slot_face_map_out, bm_src, f, bm_dst, vtar, edar, vhash, ehash);
copy_face(op, slot_face_map_out, bm_src, f, bm_dst, vhash, ehash);
BMO_elem_flag_enable(bm_src, f, DUPE_DONE);
}
}
@@ -295,9 +285,6 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
/* free pointer hashes */
BLI_ghash_free(vhash, NULL, NULL);
BLI_ghash_free(ehash, NULL, NULL);
BLI_array_free(vtar); /* free vert pointer array */
BLI_array_free(edar); /* free edge pointer array */
}
/**
+24 -67
View File
@@ -31,7 +31,6 @@
#include "DNA_meshdata_types.h"
#include "BLI_math.h"
#include "BLI_array.h"
#include "BLI_buffer.h"
#include "BKE_customdata.h"
@@ -54,84 +53,42 @@ enum {
void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
{
BMVert **verts = NULL;
BLI_array_declare(verts);
BMEdge **edges = NULL;
BLI_array_declare(edges);
BMOIter siter;
BMIter liter, liter2;
BMFace *f, *f2, *f3;
BMLoop *l, *l2, *l3, *l4, *l_tmp;
BMEdge *e, *laste;
BMVert *v, *lastv, *firstv;
int i;
BMFace *f_org;
BMO_ITER (f, &siter, op->slots_in, "faces", BM_FACE) {
BLI_array_empty(verts);
BLI_array_empty(edges);
BLI_array_grow_items(verts, f->len);
BLI_array_grow_items(edges, f->len);
BMO_ITER (f_org, &siter, op->slots_in, "faces", BM_FACE) {
BMFace *f_new;
BMLoop *l_org, *l_org_first;
BMLoop *l_new;
i = 0;
firstv = lastv = NULL;
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
v = BM_vert_create(bm, l->v->co, l->v, 0);
/* skip on the first iteration */
if (lastv) {
e = BM_edge_create(bm, lastv, v, l->e, 0);
edges[i] = e;
verts[i] = lastv;
i++;
}
BMO_elem_flag_enable(bm, f_org, EXT_DEL);
lastv = v;
laste = l->e;
if (!firstv) firstv = v;
}
f_new = BM_face_copy(bm, bm, f_org, true, true);
BMO_elem_flag_enable(bm, f_new, EXT_KEEP);
/* this fits in the array because we skip one in the loop above */
e = BM_edge_create(bm, v, firstv, laste, 0);
edges[i] = e;
verts[i] = lastv;
i++;
l_org = l_org_first = BM_FACE_FIRST_LOOP(f_org);
l_new = BM_FACE_FIRST_LOOP(f_new);
BMO_elem_flag_enable(bm, f, EXT_DEL);
do {
BMFace *f_side;
BMLoop *l_side_iter;
f2 = BM_face_create(bm, verts, edges, f->len, 0);
if (UNLIKELY(f2 == NULL)) {
BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Extrude failed: could not create face");
BLI_array_free(edges);
return;
}
BMO_elem_flag_enable(bm, f2, EXT_KEEP);
BM_elem_attrs_copy(bm, bm, f, f2);
BM_elem_attrs_copy(bm, bm, l_org, l_new);
l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2);
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
BM_elem_attrs_copy(bm, bm, l, l2);
f_side = BM_face_create_quad_tri(bm,
l_org->next->v, l_new->next->v, l_new->v, l_org->v,
f_org, false);
l3 = l->next;
l4 = l2->next;
l_side_iter = BM_FACE_FIRST_LOOP(f_side);
f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, false);
/* XXX, no error check here, why? - Campbell */
l_tmp = BM_FACE_FIRST_LOOP(f3);
BM_elem_attrs_copy(bm, bm, l->next, l_tmp); l_tmp = l_tmp->next;
BM_elem_attrs_copy(bm, bm, l->next, l_tmp); l_tmp = l_tmp->next;
BM_elem_attrs_copy(bm, bm, l, l_tmp); l_tmp = l_tmp->next;
BM_elem_attrs_copy(bm, bm, l, l_tmp);
l2 = BM_iter_step(&liter2);
}
BM_elem_attrs_copy(bm, bm, l_org->next, l_side_iter); l_side_iter = l_side_iter->next;
BM_elem_attrs_copy(bm, bm, l_org->next, l_side_iter); l_side_iter = l_side_iter->next;
BM_elem_attrs_copy(bm, bm, l_org, l_side_iter); l_side_iter = l_side_iter->next;
BM_elem_attrs_copy(bm, bm, l_org, l_side_iter);
} while (((l_new = l_new->next),
(l_org = l_org->next)) != l_org_first);
}
BLI_array_free(verts);
BLI_array_free(edges);
BMO_op_callf(bm, op->flag,
"delete geom=%ff context=%i",
EXT_DEL, DEL_ONLYFACES);
+16 -9
View File
@@ -315,7 +315,8 @@ bool MeshImporter::primitive_has_faces(COLLADAFW::MeshPrimitive *mp) {
case COLLADAFW::MeshPrimitive::TRIANGLES:
case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
case COLLADAFW::MeshPrimitive::POLYLIST:
case COLLADAFW::MeshPrimitive::POLYGONS: {
case COLLADAFW::MeshPrimitive::POLYGONS:
{
has_faces = true;
break;
}
@@ -347,8 +348,8 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
case COLLADAFW::MeshPrimitive::TRIANGLES:
case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
case COLLADAFW::MeshPrimitive::POLYLIST:
case COLLADAFW::MeshPrimitive::POLYGONS: {
case COLLADAFW::MeshPrimitive::POLYGONS:
{
COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
size_t prim_poly_count = mpvc->getFaceCount();
@@ -361,7 +362,8 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
total_loop_count += prim_loop_count;
break;
}
default: break;
default:
break;
}
}
@@ -400,16 +402,19 @@ unsigned int MeshImporter::get_vertex_count(COLLADAFW::Polygons *mp, int index)
int result;
switch (type) {
case COLLADAFW::MeshPrimitive::TRIANGLES:
case COLLADAFW::MeshPrimitive::TRIANGLE_FANS: {
case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
{
result = 3;
break;
}
case COLLADAFW::MeshPrimitive::POLYLIST:
case COLLADAFW::MeshPrimitive::POLYGONS: {
case COLLADAFW::MeshPrimitive::POLYGONS:
{
result = mp->getGroupedVerticesVertexCountArray()[index];
break;
}
default: {
default:
{
result = -1;
break;
}
@@ -427,12 +432,14 @@ unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh) {
COLLADAFW::MeshPrimitive *mp = prim_arr[i];
int type = mp->getPrimitiveType();
switch (type) {
case COLLADAFW::MeshPrimitive::LINES: {
case COLLADAFW::MeshPrimitive::LINES:
{
size_t prim_totface = mp->getFaceCount();
loose_edge_count += prim_totface;
break;
}
default: break;
default:
break;
}
}
return loose_edge_count;
+7 -4
View File
@@ -107,15 +107,18 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob, B
converter.mat4_to_dae_double(d_obmat, f_obmat);
switch (transformation_type) {
case BC_TRANSFORMATION_TYPE_MATRIX : {
case BC_TRANSFORMATION_TYPE_MATRIX:
{
node.addMatrix("transform",d_obmat);
break;
}
case BC_TRANSFORMATION_TYPE_BOTH : {
case BC_TRANSFORMATION_TYPE_BOTH:
{
node.addMatrix("transform",d_obmat);
/* intentional fall-through */
/* fall-through */
}
case BC_TRANSFORMATION_TYPE_TRANSROTLOC: {
case BC_TRANSFORMATION_TYPE_TRANSROTLOC:
{
float loc[3], rot[3], scale[3];
TransformBase::decompose(f_obmat, loc, rot, NULL, scale);
add_transform(node, loc, rot, scale);
+4 -2
View File
@@ -145,11 +145,13 @@ Mesh *bc_get_mesh_copy(Scene *scene, Object *ob, BC_export_mesh_type export_mesh
DerivedMesh *dm = NULL;
if (apply_modifiers) {
switch (export_mesh_type) {
case BC_MESH_TYPE_VIEW: {
case BC_MESH_TYPE_VIEW:
{
dm = mesh_create_derived_view(scene, ob, mask);
break;
}
case BC_MESH_TYPE_RENDER: {
case BC_MESH_TYPE_RENDER:
{
dm = mesh_create_derived_render(scene, ob, mask);
break;
}
@@ -288,8 +288,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
delete hotspots[0];
MEM_freeN(chunkOrders);
break;
}
break;
case COM_TO_RULE_OF_THIRDS:
{
ChunkOrderHotspot *hotspots[9];
@@ -336,8 +336,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
delete hotspots[7];
delete hotspots[8];
MEM_freeN(chunkOrders);
break;
}
break;
case COM_TO_TOP_DOWN:
default:
break;
@@ -183,14 +183,16 @@ void GroupNode::addDefaultOutputOperation(ExecutionSystem &system, OutputSocket
NodeOperation *operation = NULL;
switch (iosock->typeinfo->type) {
case SOCK_FLOAT: {
case SOCK_FLOAT:
{
float value = RNA_float_get(&ptr, "default_value");
SetValueOperation *value_op = new SetValueOperation();
value_op->setValue(value);
operation = value_op;
break;
}
case SOCK_VECTOR: {
case SOCK_VECTOR:
{
float vector[3];
RNA_float_get_array(&ptr, "default_value", vector);
SetVectorOperation *vector_op = new SetVectorOperation();
@@ -198,7 +200,8 @@ void GroupNode::addDefaultOutputOperation(ExecutionSystem &system, OutputSocket
operation = vector_op;
break;
}
case SOCK_RGBA: {
case SOCK_RGBA:
{
float color[4];
RNA_float_get_array(&ptr, "default_value", color);
SetColorOperation *color_op = new SetColorOperation();
@@ -2921,9 +2921,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
return ((*val) & flag) == 0;
else
return ((*val) & flag) != 0;
break;
}
break;
case sizeof(short): /* short pointer for setting */
{
short *val = (short *)ptr;
@@ -2932,9 +2931,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
return ((*val) & flag) == 0;
else
return ((*val) & flag) != 0;
break;
}
break;
case sizeof(char): /* char pointer for setting */
{
char *val = (char *)ptr;
@@ -2943,8 +2941,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
return ((*val) & flag) == 0;
else
return ((*val) & flag) != 0;
break;
}
break;
}
}
}
@@ -2994,22 +2992,20 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting,
{
int *val = (int *)ptr;
ACF_SETTING_SET(*val, flag, mode);
break;
}
break;
case sizeof(short): /* short pointer for setting */
{
short *val = (short *)ptr;
ACF_SETTING_SET(*val, flag, mode);
break;
}
break;
case sizeof(char): /* char pointer for setting */
{
char *val = (char *)ptr;
ACF_SETTING_SET(*val, flag, mode);
break;
}
break;
}
}
}
@@ -3156,14 +3152,14 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
{
SpaceAction *saction = (SpaceAction *)ac->sl;
draw_sliders = (saction->flag & SACTION_SLIDERS);
break;
}
break;
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)ac->sl;
draw_sliders = (sipo->flag & SIPO_SLIDERS);
break;
}
break;
}
}
@@ -3546,14 +3542,14 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
{
SpaceAction *saction = (SpaceAction *)ac->sl;
draw_sliders = (saction->flag & SACTION_SLIDERS);
break;
}
break;
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)ac->sl;
draw_sliders = (sipo->flag & SIPO_SLIDERS);
break;
}
break;
}
}
@@ -94,23 +94,22 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
bActionGroup *agrp = (bActionGroup *)ale->data;
ACHANNEL_SET_FLAG(agrp, ACHANNEL_SETFLAG_CLEAR, AGRP_ACTIVE);
break;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)ale->data;
ACHANNEL_SET_FLAG(fcu, ACHANNEL_SETFLAG_CLEAR, FCURVE_ACTIVE);
break;
}
break;
case ANIMTYPE_NLATRACK:
{
NlaTrack *nlt = (NlaTrack *)ale->data;
ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE);
break;
}
break;
case ANIMTYPE_FILLACTD: /* Action Expander */
case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */
case ANIMTYPE_DSLAM:
@@ -131,8 +130,8 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
if (ale->adt) {
ACHANNEL_SET_FLAG(ale->adt, ACHANNEL_SETFLAG_CLEAR, ADT_UI_ACTIVE);
}
break;
}
break;
}
}
@@ -143,21 +142,20 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
{
bActionGroup *agrp = (bActionGroup *)channel_data;
agrp->flag |= AGRP_ACTIVE;
break;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)channel_data;
fcu->flag |= FCURVE_ACTIVE;
break;
}
break;
case ANIMTYPE_NLATRACK:
{
NlaTrack *nlt = (NlaTrack *)channel_data;
nlt->flag |= NLATRACK_ACTIVE;
break;
}
break;
case ANIMTYPE_FILLACTD: /* Action Expander */
case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */
case ANIMTYPE_DSLAM:
@@ -177,8 +175,8 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
if (ale && ale->adt) {
ale->adt->flag |= ADT_UI_ACTIVE;
}
break;
}
break;
}
}
@@ -256,9 +254,8 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
{
if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED))
sel = ACHANNEL_SETFLAG_CLEAR;
break;
}
break;
case ANIMTYPE_GPLAYER:
if (ale->flag & GP_LAYER_SELECT)
sel = ACHANNEL_SETFLAG_CLEAR;
@@ -283,55 +280,54 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
if (scene->adt) {
ACHANNEL_SET_FLAG(scene, sel, ADT_UI_SELECTED);
}
break;
}
break;
case ANIMTYPE_OBJECT:
{
#if 0 /* for now, do not take object selection into account, since it gets too annoying */
{
Base *base = (Base *)ale->data;
Object *ob = base->object;
ACHANNEL_SET_FLAG(base, sel, SELECT);
ACHANNEL_SET_FLAG(ob, sel, SELECT);
if (ob->adt) {
ACHANNEL_SET_FLAG(ob, sel, ADT_UI_SELECTED);
}
Base *base = (Base *)ale->data;
Object *ob = base->object;
ACHANNEL_SET_FLAG(base, sel, SELECT);
ACHANNEL_SET_FLAG(ob, sel, SELECT);
if (ob->adt) {
ACHANNEL_SET_FLAG(ob, sel, ADT_UI_SELECTED);
}
#endif
break;
}
case ANIMTYPE_GROUP:
{
bActionGroup *agrp = (bActionGroup *)ale->data;
ACHANNEL_SET_FLAG(agrp, sel, AGRP_SELECTED);
agrp->flag &= ~AGRP_ACTIVE;
break;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)ale->data;
ACHANNEL_SET_FLAG(fcu, sel, FCURVE_SELECTED);
fcu->flag &= ~FCURVE_ACTIVE;
break;
}
break;
case ANIMTYPE_SHAPEKEY:
{
KeyBlock *kb = (KeyBlock *)ale->data;
ACHANNEL_SET_FLAG(kb, sel, KEYBLOCK_SEL);
break;
}
break;
case ANIMTYPE_NLATRACK:
{
NlaTrack *nlt = (NlaTrack *)ale->data;
ACHANNEL_SET_FLAG(nlt, sel, NLATRACK_SELECTED);
nlt->flag &= ~NLATRACK_ACTIVE;
break;
}
break;
case ANIMTYPE_FILLACTD: /* Action Expander */
case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */
case ANIMTYPE_DSLAM:
@@ -354,24 +350,22 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
ACHANNEL_SET_FLAG(ale->adt, sel, ADT_UI_SELECTED);
ale->adt->flag &= ~ADT_UI_ACTIVE;
}
break;
}
break;
case ANIMTYPE_GPLAYER:
{
bGPDlayer *gpl = (bGPDlayer *)ale->data;
ACHANNEL_SET_FLAG(gpl, sel, GP_LAYER_SELECT);
break;
}
break;
case ANIMTYPE_MASKLAYER:
{
MaskLayer *masklay = (MaskLayer *)ale->data;
ACHANNEL_SET_FLAG(masklay, sel, MASK_LAYERFLAG_SELECT);
break;
}
break;
}
}
@@ -801,23 +795,22 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands, ListBase *sr
is_sel = SEL_AGRP(agrp);
is_untouchable = (agrp->flag & AGRP_TEMP) != 0;
break;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)channel;
is_sel = SEL_FCU(fcu);
break;
}
break;
case ANIMTYPE_NLATRACK:
{
NlaTrack *nlt = (NlaTrack *)channel;
is_sel = SEL_NLT(nlt);
break;
}
break;
default:
printf("rearrange_animchannel_add_to_islands(): don't know how to handle channels of type %d\n", type);
return;
@@ -1435,9 +1428,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
/* try to free F-Curve */
ANIM_fcurve_delete_from_animdata(&ac, adt, fcu);
break;
}
break;
case ANIMTYPE_GPLAYER:
{
/* Grease Pencil layer */
@@ -1447,9 +1439,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
/* try to delete the layer's data and the layer itself */
free_gpencil_frames(gpl);
BLI_freelinkN(&gpd->layers, gpl);
break;
}
break;
case ANIMTYPE_MASKLAYER:
{
/* Mask layer */
@@ -1458,8 +1449,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
/* try to delete the layer's data and the layer itself */
BKE_mask_layer_remove(mask, masklay);
break;
}
break;
}
}
@@ -2131,8 +2122,8 @@ static void borderselect_anim_channels(bAnimContext *ac, rcti *rect, short selec
/* always clear active flag after doing this */
agrp->flag &= ~AGRP_ACTIVE;
break;
}
break;
case ANIMTYPE_NLATRACK:
{
NlaTrack *nlt = (NlaTrack *)ale->data;
@@ -2141,8 +2132,8 @@ static void borderselect_anim_channels(bAnimContext *ac, rcti *rect, short selec
* currently adds complications when doing other stuff
*/
ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED);
break;
}
break;
}
}
@@ -2367,8 +2358,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
break;
}
break;
case ANIMTYPE_OBJECT:
{
bDopeSheet *ads = (bDopeSheet *)ac->data;
@@ -2406,9 +2397,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
adt->flag |= ADT_UI_ACTIVE;
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
break;
}
break;
case ANIMTYPE_FILLACTD: /* Action Expander */
case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */
case ANIMTYPE_DSLAM:
@@ -2445,9 +2435,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
break;
}
break;
case ANIMTYPE_GROUP:
{
bActionGroup *agrp = (bActionGroup *)ale->data;
@@ -2482,8 +2471,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, NULL, ANIMTYPE_GROUP);
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
break;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)ale->data;
@@ -2504,8 +2493,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
break;
}
break;
case ANIMTYPE_SHAPEKEY:
{
KeyBlock *kb = (KeyBlock *)ale->data;
@@ -2522,8 +2511,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
break;
}
break;
case ANIMTYPE_GPDATABLOCK:
{
bGPdata *gpd = (bGPdata *)ale->data;
@@ -2534,8 +2523,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
gpd->flag ^= GP_DATA_EXPAND;
notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
break;
}
break;
case ANIMTYPE_GPLAYER:
{
bGPDlayer *gpl = (bGPDlayer *)ale->data;
@@ -2552,8 +2541,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
break;
}
break;
case ANIMTYPE_MASKDATABLOCK:
{
Mask *mask = (Mask *)ale->data;
@@ -2564,8 +2553,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
mask->flag ^= MASK_ANIMF_EXPAND;
notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
break;
}
break;
case ANIMTYPE_MASKLAYER:
{
MaskLayer *masklay = (MaskLayer *)ale->data;
@@ -2582,8 +2571,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
}
notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
break;
}
break;
default:
if (G.debug & G_DEBUG)
printf("Error: Invalid channel type in mouse_anim_channels()\n");
+5 -9
View File
@@ -126,17 +126,15 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
if (hours) sprintf(str, "%s%02d:%02d:%02d", neg, hours, minutes, seconds);
else sprintf(str, "%s%02d:%02d", neg, minutes, seconds);
}
break;
}
break;
case USER_TIMECODE_SMPTE_MSF:
{
/* reduced SMPTE format that always shows minutes, seconds, frames. Hours only shown as needed. */
if (hours) sprintf(str, "%s%02d:%02d:%02d:%02d", neg, hours, minutes, seconds, frames);
else sprintf(str, "%s%02d:%02d:%02d", neg, minutes, seconds, frames);
break;
}
break;
case USER_TIMECODE_MILLISECONDS:
{
/* reduced SMPTE. Instead of frames, milliseconds are shown */
@@ -145,25 +143,23 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
if (hours) sprintf(str, "%s%02d:%02d:%0*.*f", neg, hours, minutes, s_pad, ms_dp, cfra);
else sprintf(str, "%s%02d:%0*.*f", neg, minutes, s_pad, ms_dp, cfra);
break;
}
break;
case USER_TIMECODE_SECONDS_ONLY:
{
/* only show the original seconds display */
/* round to whole numbers if power is >= 1 (i.e. scale is coarse) */
if (power <= 0) sprintf(str, "%.*f", 1 - power, raw_seconds);
else sprintf(str, "%d", (int)floor(raw_seconds + GLA_PIXEL_OFS));
break;
}
break;
case USER_TIMECODE_SMPTE_FULL:
default:
{
/* full SMPTE format */
sprintf(str, "%s%02d:%02d:%02d:%02d", neg, hours, minutes, seconds, frames);
break;
}
break;
}
}
else {
+50 -65
View File
@@ -301,22 +301,20 @@ short ANIM_animdata_context_getdata(bAnimContext *ac)
{
SpaceAction *saction = (SpaceAction *)sl;
ok = actedit_get_context(ac, saction);
break;
}
break;
case SPACE_IPO:
{
SpaceIpo *sipo = (SpaceIpo *)sl;
ok = graphedit_get_context(ac, sipo);
break;
}
break;
case SPACE_NLA:
{
SpaceNla *snla = (SpaceNla *)sl;
ok = nlaedit_get_context(ac, snla);
break;
}
break;
}
}
@@ -543,9 +541,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
*/
ale->key_data = NULL;
ale->datatype = ALE_ALL;
break;
}
break;
case ANIMTYPE_SCENE:
{
Scene *sce = (Scene *)data;
@@ -556,8 +553,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_SCE;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_OBJECT:
{
Base *base = (Base *)data;
@@ -569,8 +566,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_OB;
ale->adt = BKE_animdata_from_id(&ob->id);
break;
}
break;
case ANIMTYPE_FILLACTD:
{
bAction *act = (bAction *)data;
@@ -579,8 +576,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->key_data = act;
ale->datatype = ALE_ACT;
break;
}
break;
case ANIMTYPE_FILLDRIVERS:
{
AnimData *adt = (AnimData *)data;
@@ -590,9 +587,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
// XXX... drivers don't show summary for now
ale->key_data = NULL;
ale->datatype = ALE_NONE;
break;
}
break;
case ANIMTYPE_DSMAT:
{
Material *ma = (Material *)data;
@@ -604,8 +600,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSLAM:
{
Lamp *la = (Lamp *)data;
@@ -617,8 +613,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSCAM:
{
Camera *ca = (Camera *)data;
@@ -630,8 +626,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSCUR:
{
Curve *cu = (Curve *)data;
@@ -643,8 +639,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSARM:
{
bArmature *arm = (bArmature *)data;
@@ -656,8 +652,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSMESH:
{
Mesh *me = (Mesh *)data;
@@ -669,8 +665,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSLAT:
{
Lattice *lt = (Lattice *)data;
@@ -682,8 +678,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSSPK:
{
Speaker *spk = (Speaker *)data;
@@ -695,8 +691,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSSKEY:
{
Key *key = (Key *)data;
@@ -708,8 +704,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSWOR:
{
World *wo = (World *)data;
@@ -721,8 +717,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSNTREE:
{
bNodeTree *ntree = (bNodeTree *)data;
@@ -734,8 +730,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSLINESTYLE:
{
FreestyleLineStyle *linestyle = (FreestyleLineStyle *)data;
@@ -747,8 +743,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSPART:
{
ParticleSettings *part = (ParticleSettings *)ale->data;
@@ -760,8 +756,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_DSTEX:
{
Tex *tex = (Tex *)data;
@@ -773,9 +769,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->datatype = ALE_ACT;
ale->adt = BKE_animdata_from_id(data);
break;
}
break;
case ANIMTYPE_GROUP:
{
bActionGroup *agrp = (bActionGroup *)data;
@@ -784,8 +779,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->key_data = NULL;
ale->datatype = ALE_GROUP;
break;
}
break;
case ANIMTYPE_FCURVE:
{
FCurve *fcu = (FCurve *)data;
@@ -794,9 +789,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->key_data = fcu;
ale->datatype = ALE_FCURVE;
break;
}
break;
case ANIMTYPE_SHAPEKEY:
{
KeyBlock *kb = (KeyBlock *)data;
@@ -824,9 +818,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
}
ale->datatype = (ale->key_data) ? ALE_FCURVE : ALE_NONE;
}
break;
}
break;
case ANIMTYPE_GPLAYER:
{
bGPDlayer *gpl = (bGPDlayer *)data;
@@ -835,9 +828,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->key_data = NULL;
ale->datatype = ALE_GPFRAME;
break;
}
break;
case ANIMTYPE_MASKLAYER:
{
MaskLayer *masklay = (MaskLayer *)data;
@@ -846,9 +838,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->key_data = NULL;
ale->datatype = ALE_MASKLAY;
break;
}
break;
case ANIMTYPE_NLATRACK:
{
NlaTrack *nlt = (NlaTrack *)data;
@@ -857,15 +848,15 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
ale->key_data = &nlt->strips;
ale->datatype = ALE_NLASTRIP;
break;
}
break;
case ANIMTYPE_NLAACTION:
{
/* nothing to include for now... nothing editable from NLA-perspective here */
ale->key_data = NULL;
ale->datatype = ALE_NONE;
break;
}
break;
}
}
@@ -1654,20 +1645,20 @@ static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data,
{
Material *ma = (Material *)owner_id;
mtex = (MTex **)(&ma->mtex);
break;
}
break;
case ID_LA:
{
Lamp *la = (Lamp *)owner_id;
mtex = (MTex **)(&la->mtex);
break;
}
break;
case ID_WO:
{
World *wo = (World *)owner_id;
mtex = (MTex **)(&wo->mtex);
break;
}
break;
default:
{
/* invalid/unsupported option */
@@ -1812,8 +1803,8 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr, Object *ob, ID **idpoin
if (!(afm->ads->filterflag & ADS_FILTER_NOTEX)) {
afm->items += animdata_filter_ds_texture(afm->ac, &afm->tmp_data, afm->ads, tex, owner_id, afm->filter_mode);
}
break;
}
break;
/* TODO: images? */
}
@@ -1920,8 +1911,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSCAM;
expanded = FILTER_CAM_OBJD(ca);
break;
}
break;
case OB_LAMP: /* ---------- Lamp ----------- */
{
Lamp *la = (Lamp *)ob->data;
@@ -1931,8 +1922,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSLAM;
expanded = FILTER_LAM_OBJD(la);
break;
}
break;
case OB_CURVE: /* ------- Curve ---------- */
case OB_SURF: /* ------- Nurbs Surface ---------- */
case OB_FONT: /* ------- Text Curve ---------- */
@@ -1944,8 +1935,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSCUR;
expanded = FILTER_CUR_OBJD(cu);
break;
}
break;
case OB_MBALL: /* ------- MetaBall ---------- */
{
MetaBall *mb = (MetaBall *)ob->data;
@@ -1955,8 +1946,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSMBALL;
expanded = FILTER_MBALL_OBJD(mb);
break;
}
break;
case OB_ARMATURE: /* ------- Armature ---------- */
{
bArmature *arm = (bArmature *)ob->data;
@@ -1966,8 +1957,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSARM;
expanded = FILTER_ARM_OBJD(arm);
break;
}
break;
case OB_MESH: /* ------- Mesh ---------- */
{
Mesh *me = (Mesh *)ob->data;
@@ -1977,8 +1968,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSMESH;
expanded = FILTER_MESH_OBJD(me);
break;
}
break;
case OB_LATTICE: /* ---- Lattice ---- */
{
Lattice *lt = (Lattice *)ob->data;
@@ -1988,16 +1979,16 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
type = ANIMTYPE_DSLAT;
expanded = FILTER_LATTICE_OBJD(lt);
break;
}
break;
case OB_SPEAKER: /* ---------- Speaker ----------- */
{
Speaker *spk = (Speaker *)ob->data;
type = ANIMTYPE_DSSPK;
expanded = FILTER_SPK_OBJD(spk);
break;
}
break;
}
/* add object data animation channels */
@@ -2020,8 +2011,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
/* textures */
if (!(ads->filterflag & ADS_FILTER_NOTEX))
tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, &la->id, filter_mode);
break;
}
break;
}
}
END_ANIMFILTER_SUBCHANNELS;
@@ -2603,58 +2594,52 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
/* the check for the DopeSheet summary is included here since the summary works here too */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact);
break;
}
break;
case ANIMCONT_SHAPEKEY: /* 'ShapeKey Editor' */
{
/* the check for the DopeSheet summary is included here since the summary works here too */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items = animdata_filter_shapekey(ac, anim_data, data, filter_mode);
break;
}
break;
case ANIMCONT_GPENCIL:
{
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items = animdata_filter_gpencil(anim_data, data, filter_mode);
break;
}
break;
case ANIMCONT_MASK:
{
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items = animdata_filter_mask(anim_data, data, filter_mode);
break;
}
break;
case ANIMCONT_DOPESHEET: /* 'DopeSheet Editor' */
{
/* the DopeSheet editor is the primary place where the DopeSheet summaries are useful */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items += animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
break;
}
break;
case ANIMCONT_FCURVES: /* Graph Editor -> F-Curves/Animation Editing */
case ANIMCONT_DRIVERS: /* Graph Editor -> Drivers Editing */
case ANIMCONT_NLA: /* NLA Editor */
{
/* all of these editors use the basic DopeSheet data for filtering options, but don't have all the same features */
items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
break;
}
break;
case ANIMCONT_CHANNEL: /* animation channel */
{
bDopeSheet *ads = ac->ads;
/* based on the channel type, filter relevant data for this */
items = animdata_filter_animchan(ac, anim_data, ads, data, filter_mode);
break;
}
break;
}
/* remove any 'weedy' entries */
items = animdata_filter_remove_invalid(anim_data);
+1 -1
View File
@@ -449,8 +449,8 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
/* free old one */
MEM_freeN(basepath);
}
break;
}
break;
}
/* fix RNA pointer, as we've now changed the ID root by changing the paths */
@@ -242,8 +242,8 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
else
uiDefBut(block, LABEL, 1, ") ", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
}
break;
}
break;
}
}
@@ -601,30 +601,27 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
{
if (sel) glColor4f(0.33f, 0.75f, 0.93f, alpha);
else glColor4f(0.70f, 0.86f, 0.91f, alpha);
break;
}
break;
case BEZT_KEYTYPE_EXTREME: /* redish frames for now */
{
if (sel) glColor4f(0.95f, 0.5f, 0.5f, alpha);
else glColor4f(0.91f, 0.70f, 0.80f, alpha);
break;
}
break;
case BEZT_KEYTYPE_JITTER: /* greenish frames for now? */
{
if (sel) glColor4f(0.38f, 0.75f, 0.26f, alpha);
else glColor4f(0.58f, 0.90f, 0.46f, alpha);
break;
}
break;
case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames for now */
default:
{
if (sel) UI_ThemeColorShadeAlpha(TH_STRIP_SELECT, 50, -255 * (1.0f - alpha));
else glColor4f(0.91f, 0.91f, 0.91f, alpha);
break;
}
break;
}
glCallList(displist2);
@@ -1973,8 +1973,8 @@ short id_frame_has_keyframe(ID *id, float frame, short filter)
/* only check keyframes in active action */
if (adt)
return action_frame_has_keyframe(adt->action, frame, filter);
break;
}
break;
}
@@ -1004,8 +1004,8 @@ int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSe
// XXX: only object transforms?
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
break;
}
break;
}
/* send notifiers for updates (this doesn't require context to work!) */
@@ -63,6 +63,8 @@ void ARMATURE_OT_parent_clear(struct wmOperatorType *ot);
void ARMATURE_OT_select_all(struct wmOperatorType *ot);
void ARMATURE_OT_select_inverse(struct wmOperatorType *ot);
void ARMATURE_OT_select_more(struct wmOperatorType *ot);
void ARMATURE_OT_select_less(struct wmOperatorType *ot);
void ARMATURE_OT_select_hierarchy(struct wmOperatorType *ot);
void ARMATURE_OT_select_linked(struct wmOperatorType *ot);
void ARMATURE_OT_select_similar(struct wmOperatorType *ot);
@@ -59,6 +59,8 @@ void ED_operatortypes_armature(void)
WM_operatortype_append(ARMATURE_OT_select_all);
WM_operatortype_append(ARMATURE_OT_select_inverse);
WM_operatortype_append(ARMATURE_OT_select_more);
WM_operatortype_append(ARMATURE_OT_select_less);
WM_operatortype_append(ARMATURE_OT_select_hierarchy);
WM_operatortype_append(ARMATURE_OT_select_linked);
WM_operatortype_append(ARMATURE_OT_select_similar);
@@ -258,6 +260,9 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
RNA_boolean_set(kmi->ptr, "extend", TRUE);
WM_keymap_add_item(keymap, "ARMATURE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "ARMATURE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "ARMATURE_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "ARMATURE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
@@ -665,6 +665,145 @@ void ARMATURE_OT_select_all(wmOperatorType *ot)
WM_operator_properties_select_all(ot);
}
/**************** Select more/less **************/
#define EBONE_PREV_FLAG_GET(ebone) ((void)0, (GET_INT_FROM_POINTER(ebone->temp)))
#define EBONE_PREV_FLAG_SET(ebone, val) (ebone->temp = SET_INT_IN_POINTER(val))
static void armature_select_more(bArmature *arm, EditBone *ebone)
{
if ((EBONE_PREV_FLAG_GET(ebone) & (BONE_ROOTSEL | BONE_TIPSEL)) != 0) {
if (EBONE_SELECTABLE(arm, ebone)) {
ED_armature_ebone_select_set(ebone, true);
}
}
if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
/* to parent */
if ((EBONE_PREV_FLAG_GET(ebone) & BONE_ROOTSEL) != 0) {
if (EBONE_SELECTABLE(arm, ebone->parent)) {
ED_armature_ebone_selectflag_enable(ebone->parent, (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL));
}
}
/* from parent (difference from select less) */
if ((EBONE_PREV_FLAG_GET(ebone->parent) & BONE_TIPSEL) != 0) {
if (EBONE_SELECTABLE(arm, ebone)) {
ED_armature_ebone_selectflag_enable(ebone, (BONE_SELECTED | BONE_ROOTSEL));
}
}
}
}
static void armature_select_less(bArmature *UNUSED(arm), EditBone *ebone)
{
if ((EBONE_PREV_FLAG_GET(ebone) & (BONE_ROOTSEL | BONE_TIPSEL)) != (BONE_ROOTSEL | BONE_TIPSEL)) {
ED_armature_ebone_select_set(ebone, false);
}
if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
/* to parent */
if ((EBONE_PREV_FLAG_GET(ebone) & BONE_SELECTED) == 0) {
ED_armature_ebone_selectflag_disable(ebone->parent, (BONE_SELECTED | BONE_TIPSEL));
}
/* from parent (difference from select more) */
if ((EBONE_PREV_FLAG_GET(ebone->parent) & BONE_SELECTED) == 0) {
ED_armature_ebone_selectflag_disable(ebone, (BONE_SELECTED | BONE_ROOTSEL));
}
}
}
static void armature_select_more_less(Object* ob, bool more)
{
bArmature* arm = (bArmature *)ob->data;
EditBone* ebone;
/* XXX, eventually we shouldn't need this - campbell */
ED_armature_sync_selection(arm->edbo);
/* count bones & store selection state */
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
EBONE_PREV_FLAG_SET(ebone, ED_armature_ebone_selectflag_get(ebone));
}
/* do selection */
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
if (EBONE_VISIBLE(arm, ebone)) {
if (more) {
armature_select_more(arm, ebone);
}
else {
armature_select_less(arm, ebone);
}
}
}
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
if (EBONE_VISIBLE(arm, ebone)) {
if (more == false) {
if (ebone->flag & BONE_SELECTED) {
ED_armature_ebone_select_set(ebone, true);
}
}
}
ebone->temp = NULL;
}
ED_armature_sync_selection(arm->edbo);
}
#undef EBONE_PREV_FLAG_GET
#undef EBONE_PREV_FLAG_SET
static int armature_de_select_more_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
armature_select_more_less(obedit, true);
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
return OPERATOR_FINISHED;
}
void ARMATURE_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select More";
ot->idname = "ARMATURE_OT_select_more";
ot->description = "Select those bones connected to the initial selection";
/* api callbacks */
ot->exec = armature_de_select_more_exec;
ot->poll = ED_operator_editarmature;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int armature_de_select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit = CTX_data_edit_object(C);
armature_select_more_less(obedit, false);
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
return OPERATOR_FINISHED;
}
void ARMATURE_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Less";
ot->idname = "ARMATURE_OT_select_less";
ot->description = "Deselect those bones at the boundary of each selection region";
/* api callbacks */
ot->exec = armature_de_select_less_exec;
ot->poll = ED_operator_editarmature;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
enum {
SIMEDBONE_LENGTH = 1,
SIMEDBONE_DIRECTION,
+6 -9
View File
@@ -238,9 +238,8 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *val)
while (iters-- > 0) {
(*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f) ) / 5.0f;
}
break;
}
break;
case POSESLIDE_RELAX: /* make the current pose more like its surrounding ones */
{
/* perform a weighted average here, favoring the middle pose
@@ -252,16 +251,15 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *val)
while (iters-- > 0) {
(*val) = ( ((sVal * w2) + (eVal * w1)) + ((*val) * 5.0f) ) / 6.0f;
}
break;
}
break;
case POSESLIDE_BREAKDOWN: /* make the current pose slide around between the endpoints */
{
/* perform simple linear interpolation - coefficient for start must come from pso->percentage... */
/* TODO: make this use some kind of spline interpolation instead? */
(*val) = ((sVal * w2) + (eVal * w1));
break;
}
break;
}
}
@@ -327,8 +325,8 @@ static void pose_slide_apply_props(tPoseSlideOp *pso, tPChanFCurveLink *pfl)
float tval = RNA_property_float_get(&ptr, prop);
pose_slide_apply_val(pso, fcu, &tval);
RNA_property_float_set(&ptr, prop, tval);
break;
}
break;
case PROP_BOOLEAN:
case PROP_ENUM:
case PROP_INT:
@@ -336,8 +334,8 @@ static void pose_slide_apply_props(tPoseSlideOp *pso, tPChanFCurveLink *pfl)
float tval = (float)RNA_property_int_get(&ptr, prop);
pose_slide_apply_val(pso, fcu, &tval);
RNA_property_int_set(&ptr, prop, (int)tval);
break;
}
break;
default:
/* cannot handle */
//printf("Cannot Pose Slide non-numerical property\n");
@@ -672,9 +670,8 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* apply... */
pose_slide_apply(C, pso);
break;
}
break;
default: /* unhandled event (maybe it was some view manip? */
/* allow to pass through */
return OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH;
+2 -2
View File
@@ -706,8 +706,8 @@ void draw_gpencil_2dimage(const bContext *C)
wmOrtho2(ar->v2d.cur.xmin, ar->v2d.cur.xmax, ar->v2d.cur.ymin, ar->v2d.cur.ymax);
dflag |= GP_DRAWDATA_ONLYV2D | GP_DRAWDATA_IEDITHACK;
break;
}
break;
case SPACE_SEQ: /* sequence */
{
/* just draw using standard scaling (settings here are currently ignored anyways) */
@@ -720,8 +720,8 @@ void draw_gpencil_2dimage(const bContext *C)
* and everything moved to standard View2d
*/
dflag |= GP_DRAWDATA_ONLYV2D;
break;
}
break;
default: /* for spacetype not yet handled */
offsx = 0;
offsy = 0;
+5 -14
View File
@@ -112,9 +112,8 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
if (ptr) RNA_id_pointer_create(&ob->id, ptr);
return &ob->gpd;
}
break;
}
break;
case SPACE_NODE: /* Nodes Editor */
{
SpaceNode *snode = (SpaceNode *)CTX_wm_space_data(C);
@@ -125,13 +124,10 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
if (ptr) RNA_id_pointer_create(&snode->nodetree->id, ptr);
return &snode->nodetree->gpd;
}
else {
/* even when there is no node-tree, don't allow this to flow to scene */
return NULL;
}
/* even when there is no node-tree, don't allow this to flow to scene */
return NULL;
}
break;
case SPACE_SEQ: /* Sequencer */
{
SpaceSeq *sseq = (SpaceSeq *)CTX_wm_space_data(C);
@@ -141,8 +137,6 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
if (ptr) RNA_pointer_create(screen_id, &RNA_SpaceSequenceEditor, sseq, ptr);
return &sseq->gpd;
}
break;
case SPACE_IMAGE: /* Image/UV Editor */
{
SpaceImage *sima = (SpaceImage *)CTX_wm_space_data(C);
@@ -152,8 +146,6 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
if (ptr) RNA_pointer_create(screen_id, &RNA_SpaceImageEditor, sima, ptr);
return &sima->gpd;
}
break;
case SPACE_CLIP: /* Nodes Editor */
{
SpaceClip *sc = (SpaceClip *)CTX_wm_space_data(C);
@@ -178,9 +170,8 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
return &clip->gpd;
}
}
break;
}
break;
default: /* unsupported space */
return NULL;
}
+12 -18
View File
@@ -1084,9 +1084,8 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable\n");
return 0;
}
break;
}
break;
case SPACE_NODE:
{
/* SpaceNode *snode = curarea->spacedata.first; */
@@ -1095,8 +1094,8 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
p->sa = curarea;
p->ar = ar;
p->v2d = &ar->v2d;
break;
}
break;
case SPACE_SEQ:
{
SpaceSeq *sseq = curarea->spacedata.first;
@@ -1113,8 +1112,8 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil\n");
return 0;
}
break;
}
break;
case SPACE_IMAGE:
{
/* SpaceImage *sima = curarea->spacedata.first; */
@@ -1123,8 +1122,8 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
p->sa = curarea;
p->ar = ar;
p->v2d = &ar->v2d;
break;
}
break;
case SPACE_CLIP:
{
SpaceClip *sc = curarea->spacedata.first;
@@ -1151,9 +1150,8 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
p->imat[3][0] -= marker->pos[0];
p->imat[3][1] -= marker->pos[1];
}
break;
}
break;
/* unsupported views */
default:
{
@@ -1162,7 +1160,6 @@ static int gp_session_initdata(bContext *C, tGPsdata *p)
printf("Error: Active view not appropriate for Grease Pencil drawing\n");
return 0;
}
break;
}
/* get gp-data */
@@ -1295,21 +1292,18 @@ static void gp_paint_initstroke(tGPsdata *p, short paintmode)
case SPACE_VIEW3D:
{
p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE;
break;
}
break;
case SPACE_NODE:
{
p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
break;
}
break;
case SPACE_SEQ:
{
p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
break;
}
break;
case SPACE_IMAGE:
{
SpaceImage *sima = (SpaceImage *)p->sa->spacedata.first;
@@ -1324,16 +1318,16 @@ static void gp_paint_initstroke(tGPsdata *p, short paintmode)
p->gpd->sbuffer_sflag &= ~GP_STROKE_2DSPACE;
p->gpd->flag &= ~GP_DATA_VIEWALIGN;
}
else
else {
p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
}
break;
}
break;
case SPACE_CLIP:
{
p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
break;
}
break;
}
}
}
@@ -96,8 +96,7 @@ typedef struct uiWidgetBase {
float inner_v[WIDGET_SIZE_MAX][2];
float inner_uv[WIDGET_SIZE_MAX][2];
short inner, outline, emboss; /* set on/off */
short shadedir;
bool inner, outline, emboss, shadedir;
uiWidgetTrias tria1;
uiWidgetTrias tria2;
@@ -209,9 +208,9 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y
/* for each AA step */
for (j = 0; j < WIDGET_AA_JITTER; j++) {
glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
glTranslatef(jit[j][0], jit[j][1], 0.0f);
glDrawArrays(GL_TRIANGLES, 0, 3);
glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
glDisableClientState(GL_VERTEX_ARRAY);
@@ -232,9 +231,9 @@ void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float m
glColor4fv(color);
for (j = 0; j < WIDGET_AA_JITTER; j++) {
glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
glTranslatef(jit[j][0], jit[j][1], 0.0f);
uiDrawBox(mode, minx, miny, maxx, maxy, rad);
glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
glDisable(GL_BLEND);
@@ -778,7 +777,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glEnableClientState(GL_VERTEX_ARRAY);
for (j = 0; j < WIDGET_AA_JITTER; j++) {
glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
glTranslatef(jit[j][0], jit[j][1], 0.0f);
/* outline */
glColor4ubv(tcol);
@@ -794,7 +793,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glDrawArrays(GL_QUAD_STRIP, 0, wtb->halfwayvert * 2);
}
glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
glDisableClientState(GL_VERTEX_ARRAY);
@@ -808,7 +807,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
(unsigned char)((float)wcol->item[3] / WIDGET_AA_JITTER)};
/* for each AA step */
for (j = 0; j < WIDGET_AA_JITTER; j++) {
glTranslatef(1.0f * jit[j][0], 1.0f * jit[j][1], 0.0f);
glTranslatef(jit[j][0], jit[j][1], 0.0f);
if (wtb->tria1.tot) {
glColor4ubv(tcol);
@@ -819,7 +818,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
widget_trias_draw(&wtb->tria2);
}
glTranslatef(-1.0f * jit[j][0], -1.0f * jit[j][1], 0.0f);
glTranslatef(-jit[j][0], -jit[j][1], 0.0f);
}
}
@@ -2365,7 +2364,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, const rcti *rect, const rcti *slid
uiWidgetBase wtb;
int horizontal;
float rad;
short outline = 0;
bool outline = false;
widget_init(&wtb);
@@ -2409,8 +2408,9 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, const rcti *rect, const rcti *slid
wtb.emboss = 0; /* only emboss once */
/* exception for progress bar */
if (state & UI_SCROLL_NO_OUTLINE)
SWAP(short, outline, wtb.outline);
if (state & UI_SCROLL_NO_OUTLINE) {
SWAP(bool, outline, wtb.outline);
}
round_box_edges(&wtb, UI_CNR_ALL, slider, rad);
@@ -2431,8 +2431,9 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, const rcti *rect, const rcti *slid
}
widgetbase_draw(&wtb, wcol);
if (state & UI_SCROLL_NO_OUTLINE)
SWAP(short, outline, wtb.outline);
if (state & UI_SCROLL_NO_OUTLINE) {
SWAP(bool, outline, wtb.outline);
}
}
}
+6 -13
View File
@@ -209,9 +209,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
}
/* scrollers - should we have these by default? */
/* XXX for now, we don't override this, or set it either! */
break;
}
break;
/* 'list/channel view' - zoom, aspect ratio, and alignment restrictions are set here */
case V2D_COMMONVIEW_LIST:
{
@@ -225,9 +224,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
tot_changed = do_init;
/* scroller settings are currently not set here... that is left for regions... */
break;
}
break;
/* 'stack view' - practically the same as list/channel view, except is located in the pos y half instead.
* zoom, aspect ratio, and alignment restrictions are set here */
case V2D_COMMONVIEW_STACK:
@@ -242,9 +240,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
tot_changed = do_init;
/* scroller settings are currently not set here... that is left for regions... */
break;
}
break;
/* 'header' regions - zoom, aspect ratio, alignment, and panning restrictions are set here */
case V2D_COMMONVIEW_HEADER:
{
@@ -272,10 +269,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* absolutely no scrollers allowed */
v2d->scroll = 0;
break;
}
break;
/* panels view, with horizontal/vertical align */
case V2D_COMMONVIEW_PANELS_UI:
{
@@ -308,9 +303,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
v2d->cur.ymax = 0.0f;
v2d->cur.ymin = (-winy) * panelzoom;
}
break;
}
break;
/* other view types are completely defined using their own settings already */
default:
/* we don't do anything here, as settings should be fine, but just make sure that rect */
@@ -1739,9 +1733,8 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
fac2 = fac2 - time;
scroll_printstr(scene, fac, h, time + (float)FPS * fac2 / 100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
break;
}
break;
case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */
/* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */
scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v');
@@ -247,8 +247,8 @@ static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
vpd->lasty = event->y;
view_pan_apply(op);
break;
}
break;
/* XXX - Mode switching isn't implemented. See comments in 36818.
* switch to zoom */
#if 0
@@ -1674,9 +1674,8 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *e
vsm->lasty = event->y;
scroller_activate_apply(C, op);
break;
}
break;
case LEFTMOUSE:
case MIDDLEMOUSE:
if (event->val == KM_RELEASE) {
+5
View File
@@ -390,6 +390,8 @@ void ED_operatortypes_mask(void)
WM_operatortype_append(MASK_OT_select_circle);
WM_operatortype_append(MASK_OT_select_linked_pick);
WM_operatortype_append(MASK_OT_select_linked);
WM_operatortype_append(MASK_OT_select_more);
WM_operatortype_append(MASK_OT_select_less);
/* hide/reveal */
WM_operatortype_append(MASK_OT_hide_view_clear);
@@ -466,6 +468,9 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "MASK_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL | KM_SHIFT | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "deselect", TRUE);
WM_keymap_add_item(keymap, "MASK_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "MASK_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
/* hide/reveal */
WM_keymap_add_item(keymap, "MASK_OT_hide_view_clear", HKEY, KM_PRESS, KM_ALT, 0);
kmi = WM_keymap_add_item(keymap, "MASK_OT_hide_view_set", HKEY, KM_PRESS, 0, 0);
@@ -88,6 +88,8 @@ void MASK_OT_select_lasso(struct wmOperatorType *ot);
void MASK_OT_select_circle(struct wmOperatorType *ot);
void MASK_OT_select_linked_pick(struct wmOperatorType *ot);
void MASK_OT_select_linked(struct wmOperatorType *ot);
void MASK_OT_select_more(struct wmOperatorType *ot);
void MASK_OT_select_less(struct wmOperatorType *ot);
int ED_mask_spline_select_check(struct MaskSpline *spline);
int ED_mask_layer_select_check(struct MaskLayer *masklay);
+117 -5
View File
@@ -470,7 +470,7 @@ void MASK_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Border Select";
ot->description = "Select markers using border selection";
ot->description = "Select curve points using border selection";
ot->idname = "MASK_OT_select_border";
/* api callbacks */
@@ -521,7 +521,7 @@ static int do_lasso_select_mask(bContext *C, const int mcords[][2], short moves,
float screen_co[2];
/* marker in screen coords */
/* point in screen coords */
ED_mask_point_pos__reverse(sa, ar,
point_deform->bezt.vec[1][0], point_deform->bezt.vec[1][1],
&screen_co[0], &screen_co[1]);
@@ -569,7 +569,7 @@ void MASK_OT_select_lasso(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Lasso Select";
ot->description = "Select markers using lasso selection";
ot->description = "Select curve points using lasso selection";
ot->idname = "MASK_OT_select_lasso";
/* api callbacks */
@@ -670,7 +670,7 @@ void MASK_OT_select_circle(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Circle Select";
ot->description = "Select markers using circle selection";
ot->description = "Select curve points using circle selection";
ot->idname = "MASK_OT_select_circle";
/* api callbacks */
@@ -784,7 +784,7 @@ void MASK_OT_select_linked(wmOperatorType *ot)
/* identifiers */
ot->name = "Select Linked All";
ot->idname = "MASK_OT_select_linked";
ot->description = "Select all vertices linked to the active mesh";
ot->description = "Select all curve points linked to already selected ones";
/* api callbacks */
ot->exec = mask_select_linked_exec;
@@ -793,3 +793,115 @@ void MASK_OT_select_linked(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/**************** Select more/less **************/
static int mask_select_more_less(bContext *C, bool more)
{
Mask *mask = CTX_data_edit_mask(C);
MaskLayer *masklay;
for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
MaskSpline *spline;
if (masklay->restrictflag & (MASK_RESTRICT_VIEW | MASK_RESTRICT_SELECT)) {
continue;
}
for (spline = masklay->splines.first; spline; spline = spline->next) {
int i;
bool start_sel, end_sel, prev_sel, cur_sel, cyclic = spline->flag & MASK_SPLINE_CYCLIC;
/* reselect point if any handle is selected to make the result more predictable */
for (i = 0; i < spline->tot_point; i++) {
BKE_mask_point_select_set(spline->points + i, MASKPOINT_ISSEL_ANY(spline->points + i));
}
/* select more/less does not affect empty/single point splines */
if (spline->tot_point < 2) {
continue;
}
if (cyclic) {
start_sel = !!MASKPOINT_ISSEL_KNOT(spline->points);
end_sel = !!MASKPOINT_ISSEL_KNOT(&spline->points[spline->tot_point - 1]);
}
for (i = 0; i < spline->tot_point; i++) {
if (i == 0 && !cyclic) {
continue;
}
prev_sel = (i > 0) ? !!MASKPOINT_ISSEL_KNOT(&spline->points[i - 1]) : end_sel;
cur_sel = !!MASKPOINT_ISSEL_KNOT(&spline->points[i]);
if (cur_sel != more) {
if (prev_sel == more) {
BKE_mask_point_select_set(&spline->points[i], more);
}
i++;
}
}
for (i = spline->tot_point - 1; i >= 0; i--) {
if (i == spline->tot_point - 1 && !cyclic) {
continue;
}
prev_sel = (i < spline->tot_point - 1) ? !!MASKPOINT_ISSEL_KNOT(&spline->points[i + 1]) : start_sel;
cur_sel = !!MASKPOINT_ISSEL_KNOT(&spline->points[i]);
if (cur_sel != more) {
if (prev_sel == more) {
BKE_mask_point_select_set(&spline->points[i], more);
}
i--;
}
}
}
}
WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
return OPERATOR_FINISHED;
}
static int mask_select_more_exec(bContext *C, wmOperator *UNUSED(op))
{
return mask_select_more_less(C, true);
}
void MASK_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select More";
ot->idname = "MASK_OT_select_more";
ot->description = "Select more spline points connected to initial selection";
/* api callbacks */
ot->exec = mask_select_more_exec;
ot->poll = ED_maskedit_mask_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int mask_select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
return mask_select_more_less(C, false);
}
void MASK_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Less";
ot->idname = "MASK_OT_select_less";
ot->description = "Deselect spline points at the boundary of each selection region";
/* api callbacks */
ot->exec = mask_select_less_exec;
ot->poll = ED_maskedit_mask_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -261,11 +261,14 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, bool select)
eed_last = eed;
}
if ((eed_last != eed_start) &&
#ifdef BMW_EDGERING_NGON
if (lasteed != startedge && BM_edge_share_face_check(lasteed, startedge)) {
BM_edge_share_face_check(eed_last, eed_start)
#else
if (eed_last != eed_start && BM_edge_share_quad_check(eed_last, eed_start)) {
BM_edge_share_quad_check(eed_last, eed_start)
#endif
)
{
v[1][0] = v[0][0];
v[1][1] = v[0][1];
@@ -460,7 +460,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const bool sel, c
0, NULL, NULL);
}
eve = BM_vert_at_index(vc->em->bm, index - 1);
eve = index ? BM_vert_at_index(vc->em->bm, index - 1) : NULL;
if (eve && distance < *r_dist) {
*r_dist = distance;
@@ -552,7 +552,7 @@ BMEdge *EDBM_edge_find_nearest(ViewContext *vc, float *r_dist)
view3d_validate_backbuf(vc);
index = view3d_sample_backbuf_rect(vc, vc->mval, 50, bm_solidoffs, bm_wireoffs, &distance, 0, NULL, NULL);
eed = BM_edge_at_index(vc->em->bm, index - 1);
eed = index ? BM_edge_at_index(vc->em->bm, index - 1) : NULL;
if (eed && distance < *r_dist) {
*r_dist = distance;
@@ -625,7 +625,7 @@ BMFace *EDBM_face_find_nearest(ViewContext *vc, float *r_dist)
view3d_validate_backbuf(vc);
index = view3d_sample_backbuf(vc, vc->mval[0], vc->mval[1]);
efa = BM_face_at_index(vc->em->bm, index - 1);
efa = index ? BM_face_at_index(vc->em->bm, index - 1) : NULL;
if (efa) {
struct { float mval_fl[2]; float dist; BMFace *toFace; } data;
@@ -927,10 +927,11 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUS
}
else if (em->selectmode & SCE_SELECT_FACE) {
#ifdef WITH_FREESTYLE
for (a = SIMFACE_MATERIAL; a <= SIMFACE_FREESTYLE; a++) {
const int a_end = SIMFACE_FREESTYLE;
#else
for (a = SIMFACE_MATERIAL; a <= SIMFACE_COPLANAR; a++) {
const int a_end = SIMFACE_COPLANAR;
#endif
for (a = SIMFACE_MATERIAL; a <= a_end; a++) {
RNA_enum_items_add_value(&item, &totitem, prop_similar_types, a);
}
}
+1 -1
View File
@@ -138,7 +138,7 @@ static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer)
BM_data_layer_free_n(me->edit_btmesh->bm, data, type, n);
}
else {
CustomData_free_layer(data, type, tot, n);
CustomData_free_layer(data, type, tot, layer_index + n);
BKE_mesh_update_customdata_pointers(me, true);
}
}
+2 -2
View File
@@ -1200,7 +1200,7 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int
*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
}
if ((*index) <= 0 || (*index) > (unsigned int)me->totpoly)
if ((*index) == 0 || (*index) > (unsigned int)me->totpoly)
return false;
(*index)--;
@@ -1321,7 +1321,7 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int
*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
}
if ((*index) <= 0 || (*index) > (unsigned int)me->totvert)
if ((*index) == 0 || (*index) > (unsigned int)me->totvert)
return false;
(*index)--;
@@ -138,7 +138,10 @@ void OBJECT_OT_hook_recenter(struct wmOperatorType *ot);
/* object_lattice.c */
void LATTICE_OT_select_all(struct wmOperatorType *ot);
void LATTICE_OT_select_more(struct wmOperatorType *ot);
void LATTICE_OT_select_less(struct wmOperatorType *ot);
void LATTICE_OT_select_ungrouped(struct wmOperatorType *ot);
void LATTICE_OT_select_random(struct wmOperatorType *ot);
void LATTICE_OT_make_regular(struct wmOperatorType *ot);
void LATTICE_OT_flip(struct wmOperatorType *ot);
+163 -4
View File
@@ -37,6 +37,8 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_rand.h"
#include "BLI_bitmap.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
@@ -54,6 +56,7 @@
#include "BKE_lattice.h"
#include "BKE_deform.h"
#include "BKE_report.h"
#include "BKE_utildefines.h"
#include "ED_lattice.h"
#include "ED_object.h"
@@ -170,6 +173,163 @@ void load_editLatt(Object *obedit)
}
}
/************************** Select Random Operator **********************/
static int lattice_select_random_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
Lattice *lt = ((Lattice*)obedit->data)->editlatt->latt;
const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f;
int tot;
BPoint *bp;
if (!RNA_boolean_get(op->ptr, "extend")) {
ED_setflagsLatt(obedit, !SELECT);
}
else {
lt->actbp = LT_ACTBP_NONE;
}
tot = lt->pntsu * lt->pntsv * lt->pntsw;
bp = lt->def;
while (tot--) {
if (!bp->hide) {
if (BLI_frand() < randfac) {
bp->f1 |= SELECT;
}
}
bp++;
}
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
void LATTICE_OT_select_random(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Random";
ot->description = "Randomly select UVW control points";
ot->idname = "LATTICE_OT_select_random";
/* api callbacks */
ot->exec = lattice_select_random_exec;
ot->poll = ED_operator_editlattice;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f,
"Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend the selection");
}
/************************** Select More/Less Operator *************************/
static bool lattice_test_bitmap_uvw(Lattice *lt, BLI_bitmap selpoints, int u, int v, int w, const bool selected)
{
if ((u < 0 || u >= lt->pntsu) ||
(v < 0 || v >= lt->pntsv) ||
(w < 0 || w >= lt->pntsw))
{
return false;
}
else {
int i = BKE_lattice_index_from_uvw(lt, u, v, w);
if (lt->def[i].hide == 0) {
return (BLI_BITMAP_GET(selpoints, i) != 0) == selected;
}
return false;
}
}
static int lattice_select_more_less(bContext *C, const bool select)
{
Object *obedit = CTX_data_edit_object(C);
Lattice *lt = ((Lattice *)obedit->data)->editlatt->latt;
BPoint *bp;
const int tot = lt->pntsu * lt->pntsv * lt->pntsw;
int i, w, u, v;
BLI_bitmap selpoints;
lt->actbp = LT_ACTBP_NONE;
bp = lt->def;
selpoints = BLI_BITMAP_NEW(tot, __func__);
for (i = 0; i < tot; i++, bp++) {
if (bp->f1 & SELECT) {
BLI_BITMAP_SET(selpoints, i);
}
}
bp = lt->def;
for (w = 0; w < lt->pntsw; w++) {
for (v = 0; v < lt->pntsv; v++) {
for (u = 0; u < lt->pntsu; u++) {
if ((bp->hide == 0) && (((bp->f1 & SELECT) == 0) == select)) {
if (lattice_test_bitmap_uvw(lt, selpoints, u + 1, v, w, select) ||
lattice_test_bitmap_uvw(lt, selpoints, u - 1, v, w, select) ||
lattice_test_bitmap_uvw(lt, selpoints, u, v + 1, w, select) ||
lattice_test_bitmap_uvw(lt, selpoints, u, v - 1, w, select) ||
lattice_test_bitmap_uvw(lt, selpoints, u, v, w + 1, select) ||
lattice_test_bitmap_uvw(lt, selpoints, u, v, w - 1, select))
{
BKE_BIT_TEST_SET(bp->f1, select, SELECT);
}
}
bp++;
}
}
}
MEM_freeN(selpoints);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
return OPERATOR_FINISHED;
}
static int lattice_select_more_exec(bContext *C, wmOperator *UNUSED(op))
{
return lattice_select_more_less(C, true);
}
static int lattice_select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
return lattice_select_more_less(C, false);
}
void LATTICE_OT_select_more(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select More";
ot->description = "Select vertex directly linked to already selected ones";
ot->idname = "LATTICE_OT_select_more";
/* api callbacks */
ot->exec = lattice_select_more_exec;
ot->poll = ED_operator_editlattice;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
void LATTICE_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Less";
ot->description = "Deselect vertices at the boundary of each selection region";
ot->idname = "LATTICE_OT_select_less";
/* api callbacks */
ot->exec = lattice_select_less_exec;
ot->poll = ED_operator_editlattice;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/************************** Select All Operator *************************/
void ED_setflagsLatt(Object *obedit, int flag)
@@ -510,8 +670,8 @@ static int lattice_flip_exec(bContext *C, wmOperator *op)
}
}
}
break;
}
break;
case LATTICE_FLIP_V:
{
int u, v, w;
@@ -531,8 +691,8 @@ static int lattice_flip_exec(bContext *C, wmOperator *op)
}
}
}
break;
}
break;
case LATTICE_FLIP_W:
{
int u, v, w;
@@ -551,9 +711,8 @@ static int lattice_flip_exec(bContext *C, wmOperator *op)
}
}
}
break;
}
break;
default: /* shouldn't happen, but just in case */
break;
}
@@ -217,7 +217,10 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_shape_key_move);
WM_operatortype_append(LATTICE_OT_select_all);
WM_operatortype_append(LATTICE_OT_select_more);
WM_operatortype_append(LATTICE_OT_select_less);
WM_operatortype_append(LATTICE_OT_select_ungrouped);
WM_operatortype_append(LATTICE_OT_select_random);
WM_operatortype_append(LATTICE_OT_make_regular);
WM_operatortype_append(LATTICE_OT_flip);
@@ -427,6 +430,8 @@ void ED_keymap_object(wmKeyConfig *keyconf)
RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
kmi = WM_keymap_add_item(keymap, "LATTICE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
WM_keymap_add_item(keymap, "LATTICE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "LATTICE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
@@ -494,23 +494,21 @@ void ED_object_parent_clear(Object *ob, int type)
/* clear parenting relationship completely */
ob->parent = NULL;
break;
}
break;
case CLEAR_PARENT_KEEP_TRANSFORM:
{
/* remove parent, and apply the parented transform result as object's local transforms */
ob->parent = NULL;
BKE_object_apply_mat4(ob, ob->obmat, TRUE, FALSE);
break;
}
break;
case CLEAR_PARENT_INVERSE:
{
/* object stays parented, but the parent inverse (i.e. offset from parent to retain binding state) is cleared */
unit_m4(ob->parentinv);
break;
}
break;
}
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+45 -45
View File
@@ -1066,21 +1066,21 @@ static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
}
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
BKE_remove_linestyle_color_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_ALPHA:
BKE_remove_linestyle_alpha_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_THICKNESS:
BKE_remove_linestyle_thickness_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
BKE_remove_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
case LS_MODIFIER_TYPE_COLOR:
BKE_remove_linestyle_color_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_ALPHA:
BKE_remove_linestyle_alpha_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_THICKNESS:
BKE_remove_linestyle_thickness_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
BKE_remove_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -1116,21 +1116,21 @@ static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
}
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
BKE_copy_linestyle_color_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_ALPHA:
BKE_copy_linestyle_alpha_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_THICKNESS:
BKE_copy_linestyle_thickness_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
BKE_copy_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
case LS_MODIFIER_TYPE_COLOR:
BKE_copy_linestyle_color_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_ALPHA:
BKE_copy_linestyle_alpha_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_THICKNESS:
BKE_copy_linestyle_thickness_modifier(lineset->linestyle, modifier);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
BKE_copy_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -1167,21 +1167,21 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
}
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
BKE_move_linestyle_color_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_ALPHA:
BKE_move_linestyle_alpha_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_THICKNESS:
BKE_move_linestyle_thickness_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
BKE_move_linestyle_geometry_modifier(lineset->linestyle, modifier, dir);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
case LS_MODIFIER_TYPE_COLOR:
BKE_move_linestyle_color_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_ALPHA:
BKE_move_linestyle_alpha_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_THICKNESS:
BKE_move_linestyle_thickness_modifier(lineset->linestyle, modifier, dir);
break;
case LS_MODIFIER_TYPE_GEOMETRY:
BKE_move_linestyle_geometry_modifier(lineset->linestyle, modifier, dir);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+1 -1
View File
@@ -2463,8 +2463,8 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event)
WM_event_add_notifier(C, NC_WINDOW, NULL);
}
}
break;
}
break;
case LEFTMOUSE:
if (event->val == KM_RELEASE) {
ED_area_tag_redraw(jd->sa1);

Some files were not shown because too many files have changed in this diff Show More