forked from bartvdbraak/blender
Re-copied trunk over tomato and merging r41929 through r41936 into tomato
This commit is contained in:
commit
41f67fa0b5
@ -139,9 +139,9 @@ IF(PYTHONLIBSUNIX_FOUND)
|
|||||||
|
|
||||||
# not used
|
# not used
|
||||||
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
PYTHON_INCLUDE_DIR
|
|
||||||
PYTHON_LIBRARY
|
|
||||||
)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
PYTHON_INCLUDE_DIR
|
||||||
|
PYTHON_LIBRARY
|
||||||
|
)
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
|
|
||||||
|
set(BLENDER_INCLUDE_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/intern/guardedalloc
|
||||||
|
${CMAKE_SOURCE_DIR}/source/blender/makesdna
|
||||||
|
${CMAKE_SOURCE_DIR}/source/blender/makesrna
|
||||||
|
${CMAKE_SOURCE_DIR}/source/blender/blenloader
|
||||||
|
${CMAKE_BINARY_DIR}/source/blender/makesrna/intern)
|
||||||
|
|
||||||
set(INC
|
set(INC
|
||||||
../render
|
../render
|
||||||
../device
|
../device
|
||||||
|
@ -459,7 +459,7 @@ class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
world = context.world
|
# world = context.world
|
||||||
return False # world and world.node_tree and CyclesButtonsPanel.poll(context)
|
return False # world and world.node_tree and CyclesButtonsPanel.poll(context)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@ -493,7 +493,7 @@ class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
mat = context.material
|
# mat = context.material
|
||||||
return False # mat and mat.node_tree and CyclesButtonsPanel.poll(context)
|
return False # mat and mat.node_tree and CyclesButtonsPanel.poll(context)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@ -562,7 +562,7 @@ class CyclesTexture_PT_context(CyclesButtonsPanel, Panel):
|
|||||||
pin_id = space.pin_id
|
pin_id = space.pin_id
|
||||||
use_pin_id = space.use_pin_id
|
use_pin_id = space.use_pin_id
|
||||||
user = context.texture_user
|
user = context.texture_user
|
||||||
node = context.texture_node
|
# node = context.texture_node
|
||||||
|
|
||||||
if not use_pin_id or not isinstance(pin_id, bpy.types.Texture):
|
if not use_pin_id or not isinstance(pin_id, bpy.types.Texture):
|
||||||
pin_id = None
|
pin_id = None
|
||||||
@ -638,7 +638,7 @@ class CyclesTexture_PT_mapping(CyclesButtonsPanel, Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
tex = context.texture
|
# tex = context.texture
|
||||||
node = context.texture_node
|
node = context.texture_node
|
||||||
|
|
||||||
mapping = node.texture_mapping
|
mapping = node.texture_mapping
|
||||||
@ -664,15 +664,15 @@ class CyclesTexture_PT_colors(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
tex = context.texture
|
# tex = context.texture
|
||||||
node = context.texture_node
|
# node = context.texture_node
|
||||||
return False
|
return False
|
||||||
#return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
|
#return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
tex = context.texture
|
# tex = context.texture
|
||||||
node = context.texture_node
|
node = context.texture_node
|
||||||
|
|
||||||
mapping = node.color_mapping
|
mapping = node.color_mapping
|
||||||
|
@ -176,7 +176,13 @@ static inline string get_enum_identifier(PointerRNA& ptr, const char *name)
|
|||||||
static inline string blender_absolute_path(BL::BlendData b_data, BL::ID b_id, const string& path)
|
static inline string blender_absolute_path(BL::BlendData b_data, BL::ID b_id, const string& path)
|
||||||
{
|
{
|
||||||
if(path.size() >= 2 && path[0] == '/' && path[1] == '/') {
|
if(path.size() >= 2 && path[0] == '/' && path[1] == '/') {
|
||||||
string dirname = (b_id.library())? b_id.library().filepath(): b_data.filepath();
|
string dirname;
|
||||||
|
|
||||||
|
if(b_id.library())
|
||||||
|
dirname = blender_absolute_path(b_data, b_id.library(), b_id.library().filepath());
|
||||||
|
else
|
||||||
|
dirname = b_data.filepath();
|
||||||
|
|
||||||
return path_join(path_dirname(dirname), path.substr(2));
|
return path_join(path_dirname(dirname), path.substr(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,25 +154,23 @@ def resolve_ncase(path):
|
|||||||
returning a string with the path if found else return the original path.
|
returning a string with the path if found else return the original path.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
def _ncase_path_found(path):
|
def _ncase_path_found(path):
|
||||||
if not path or os.path.exists(path):
|
if not path or _os.path.exists(path):
|
||||||
return path, True
|
return path, True
|
||||||
|
|
||||||
# filename may be a directory or a file
|
# filename may be a directory or a file
|
||||||
filename = os.path.basename(path)
|
filename = _os.path.basename(path)
|
||||||
dirpath = os.path.dirname(path)
|
dirpath = _os.path.dirname(path)
|
||||||
|
|
||||||
suffix = path[:0] # "" but ensure byte/str match
|
suffix = path[:0] # "" but ensure byte/str match
|
||||||
if not filename: # dir ends with a slash?
|
if not filename: # dir ends with a slash?
|
||||||
if len(dirpath) < len(path):
|
if len(dirpath) < len(path):
|
||||||
suffix = path[:len(path) - len(dirpath)]
|
suffix = path[:len(path) - len(dirpath)]
|
||||||
|
|
||||||
filename = os.path.basename(dirpath)
|
filename = _os.path.basename(dirpath)
|
||||||
dirpath = os.path.dirname(dirpath)
|
dirpath = _os.path.dirname(dirpath)
|
||||||
|
|
||||||
if not os.path.exists(dirpath):
|
if not _os.path.exists(dirpath):
|
||||||
if dirpath == path:
|
if dirpath == path:
|
||||||
return path, False
|
return path, False
|
||||||
|
|
||||||
@ -184,8 +182,8 @@ def resolve_ncase(path):
|
|||||||
# at this point, the directory exists but not the file
|
# at this point, the directory exists but not the file
|
||||||
|
|
||||||
# we are expecting 'dirpath' to be a directory, but it could be a file
|
# we are expecting 'dirpath' to be a directory, but it could be a file
|
||||||
if os.path.isdir(dirpath):
|
if _os.path.isdir(dirpath):
|
||||||
files = os.listdir(dirpath)
|
files = _os.listdir(dirpath)
|
||||||
else:
|
else:
|
||||||
return path, False
|
return path, False
|
||||||
|
|
||||||
@ -198,7 +196,7 @@ def resolve_ncase(path):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if f_iter_nocase:
|
if f_iter_nocase:
|
||||||
return os.path.join(dirpath, f_iter_nocase) + suffix, True
|
return _os.path.join(dirpath, f_iter_nocase) + suffix, True
|
||||||
else:
|
else:
|
||||||
# cant find the right one, just return the path as is.
|
# cant find the right one, just return the path as is.
|
||||||
return path, False
|
return path, False
|
||||||
@ -216,8 +214,7 @@ def ensure_ext(filepath, ext, case_sensitive=False):
|
|||||||
:arg case_sensitive: Check for matching case when comparing extensions.
|
:arg case_sensitive: Check for matching case when comparing extensions.
|
||||||
:type case_sensitive: bool
|
:type case_sensitive: bool
|
||||||
"""
|
"""
|
||||||
import os
|
fn_base, fn_ext = _os.path.splitext(filepath)
|
||||||
fn_base, fn_ext = os.path.splitext(filepath)
|
|
||||||
if fn_base and fn_ext:
|
if fn_base and fn_ext:
|
||||||
if ((case_sensitive and ext == fn_ext) or
|
if ((case_sensitive and ext == fn_ext) or
|
||||||
(ext.lower() == fn_ext.lower())):
|
(ext.lower() == fn_ext.lower())):
|
||||||
|
@ -2,4 +2,3 @@ import bpy
|
|||||||
bpy.context.object.data.sensor_width = 23.4
|
bpy.context.object.data.sensor_width = 23.4
|
||||||
bpy.context.object.data.sensor_height = 15.6
|
bpy.context.object.data.sensor_height = 15.6
|
||||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
||||||
|
|
||||||
|
@ -86,13 +86,8 @@ class CLIP_OT_tracks_to_mesh(Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
if context.space_data.type != 'CLIP_EDITOR':
|
|
||||||
return False
|
|
||||||
|
|
||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
clip = sc.clip
|
return (sc.type == 'CLIP_EDITOR') and sc.clip
|
||||||
|
|
||||||
return clip
|
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
|
@ -147,7 +147,7 @@ class ProjectEdit(Operator):
|
|||||||
|
|
||||||
# opengl buffer may fail, we can't help this, but best report it.
|
# opengl buffer may fail, we can't help this, but best report it.
|
||||||
try:
|
try:
|
||||||
ret = bpy.ops.paint.image_from_view()
|
bpy.ops.paint.image_from_view()
|
||||||
except RuntimeError as err:
|
except RuntimeError as err:
|
||||||
self.report({'ERROR'}, str(err))
|
self.report({'ERROR'}, str(err))
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
@ -106,7 +106,7 @@ def operator_path_is_undo(context, data_path):
|
|||||||
# luckily we don't do this!
|
# luckily we don't do this!
|
||||||
#
|
#
|
||||||
# When we cant find the data owner assume no undo is needed.
|
# When we cant find the data owner assume no undo is needed.
|
||||||
data_path_head, data_path_sep, data_path_tail = data_path.rpartition(".")
|
data_path_head = data_path.rpartition(".")[0]
|
||||||
|
|
||||||
if not data_path_head:
|
if not data_path_head:
|
||||||
return False
|
return False
|
||||||
|
@ -46,7 +46,6 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
md = context.dynamic_paint
|
md = context.dynamic_paint
|
||||||
ob = context.object
|
|
||||||
|
|
||||||
layout.prop(md, "ui_type", expand=True)
|
layout.prop(md, "ui_type", expand=True)
|
||||||
|
|
||||||
@ -129,7 +128,6 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel):
|
|||||||
|
|
||||||
canvas = context.dynamic_paint.canvas_settings
|
canvas = context.dynamic_paint.canvas_settings
|
||||||
surface = canvas.canvas_surfaces.active
|
surface = canvas.canvas_surfaces.active
|
||||||
ob = context.object
|
|
||||||
|
|
||||||
surface_type = surface.surface_type
|
surface_type = surface.surface_type
|
||||||
|
|
||||||
@ -370,8 +368,6 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel):
|
|||||||
md.canvas_settings.canvas_surfaces.active.is_cache_user)
|
md.canvas_settings.canvas_surfaces.active.is_cache_user)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
|
||||||
|
|
||||||
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
surface = context.dynamic_paint.canvas_settings.canvas_surfaces.active
|
||||||
cache = surface.point_cache
|
cache = surface.point_cache
|
||||||
|
|
||||||
@ -442,7 +438,6 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
brush = context.dynamic_paint.brush_settings
|
brush = context.dynamic_paint.brush_settings
|
||||||
ob = context.object
|
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
@ -478,7 +473,6 @@ class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
brush = context.dynamic_paint.brush_settings
|
brush = context.dynamic_paint.brush_settings
|
||||||
ob = context.object
|
|
||||||
|
|
||||||
layout.prop(brush, "wave_type")
|
layout.prop(brush, "wave_type")
|
||||||
if brush.wave_type != 'REFLECT':
|
if brush.wave_type != 'REFLECT':
|
||||||
|
@ -115,7 +115,6 @@ class CLIP_PT_tools_tracking(Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
clip = context.space_data.clip
|
clip = context.space_data.clip
|
||||||
settings = clip.tracking.settings
|
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
|
|
||||||
@ -641,7 +640,6 @@ class CLIP_PT_tools_clip(Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
clip = context.space_data.clip
|
|
||||||
|
|
||||||
layout.operator("clip.set_viewport_background")
|
layout.operator("clip.set_viewport_background")
|
||||||
|
|
||||||
@ -698,9 +696,6 @@ class CLIP_MT_proxy(Menu):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
sc = context.space_data
|
|
||||||
clip = sc.clip
|
|
||||||
|
|
||||||
layout.operator("clip.rebuild_proxy")
|
layout.operator("clip.rebuild_proxy")
|
||||||
layout.operator("clip.delete_proxy")
|
layout.operator("clip.delete_proxy")
|
||||||
|
|
||||||
@ -805,8 +800,6 @@ class CLIP_MT_select(Menu):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
sc = context.space_data
|
|
||||||
|
|
||||||
layout.operator("clip.select_border")
|
layout.operator("clip.select_border")
|
||||||
layout.operator("clip.select_circle")
|
layout.operator("clip.select_circle")
|
||||||
|
|
||||||
|
@ -2276,12 +2276,6 @@ class VIEW3D_PT_background_image(Panel):
|
|||||||
bl_label = "Background Images"
|
bl_label = "Background Images"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def poll(cls, context):
|
|
||||||
view = context.space_data
|
|
||||||
#~ bg = context.space_data.background_image
|
|
||||||
return (view)
|
|
||||||
|
|
||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
view = context.space_data
|
view = context.space_data
|
||||||
@ -2315,16 +2309,15 @@ class VIEW3D_PT_background_image(Panel):
|
|||||||
row = box.row()
|
row = box.row()
|
||||||
row.prop(bg, "source", expand=True)
|
row.prop(bg, "source", expand=True)
|
||||||
|
|
||||||
hasbg = False
|
has_bg = False
|
||||||
if bg.source == 'IMAGE':
|
if bg.source == 'IMAGE':
|
||||||
row = box.row()
|
row = box.row()
|
||||||
row.template_ID(bg, "image", open="image.open")
|
row.template_ID(bg, "image", open="image.open")
|
||||||
if (bg.image):
|
if (bg.image):
|
||||||
box.template_image(bg, "image", bg.image_user, compact=True)
|
box.template_image(bg, "image", bg.image_user, compact=True)
|
||||||
hasbg = True
|
has_bg = True
|
||||||
|
|
||||||
elif bg.source == 'MOVIE':
|
elif bg.source == 'MOVIE':
|
||||||
has_clip = False
|
|
||||||
box.prop(bg, 'use_camera_clip')
|
box.prop(bg, 'use_camera_clip')
|
||||||
|
|
||||||
column = box.column()
|
column = box.column()
|
||||||
@ -2335,14 +2328,14 @@ class VIEW3D_PT_background_image(Panel):
|
|||||||
column.template_movieclip(bg, "clip", compact=True)
|
column.template_movieclip(bg, "clip", compact=True)
|
||||||
|
|
||||||
if bg.use_camera_clip or bg.clip:
|
if bg.use_camera_clip or bg.clip:
|
||||||
hasbg = True
|
has_bg = True
|
||||||
|
|
||||||
column = box.column()
|
column = box.column()
|
||||||
column.active = hasbg
|
column.active = has_bg
|
||||||
column.prop(bg.clip_user, "proxy_render_size", text="")
|
column.prop(bg.clip_user, "proxy_render_size", text="")
|
||||||
column.prop(bg.clip_user, "use_render_undistorted")
|
column.prop(bg.clip_user, "use_render_undistorted")
|
||||||
|
|
||||||
if hasbg:
|
if has_bg:
|
||||||
box.prop(bg, "opacity", slider=True)
|
box.prop(bg, "opacity", slider=True)
|
||||||
if bg.view_axis != 'CAMERA':
|
if bg.view_axis != 'CAMERA':
|
||||||
box.prop(bg, "size")
|
box.prop(bg, "size")
|
||||||
|
@ -46,6 +46,7 @@ typedef struct PaintWavePoint {
|
|||||||
|
|
||||||
float height;
|
float height;
|
||||||
float velocity;
|
float velocity;
|
||||||
|
float brush_isect;
|
||||||
short state;
|
short state;
|
||||||
} PaintWavePoint;
|
} PaintWavePoint;
|
||||||
|
|
||||||
@ -82,6 +83,7 @@ void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char*
|
|||||||
#define DPAINT_PAINT_NEW 2
|
#define DPAINT_PAINT_NEW 2
|
||||||
|
|
||||||
/* PaintWavePoint state */
|
/* PaintWavePoint state */
|
||||||
|
#define DPAINT_WAVE_ISECT_CHANGED -1
|
||||||
#define DPAINT_WAVE_NONE 0
|
#define DPAINT_WAVE_NONE 0
|
||||||
#define DPAINT_WAVE_OBSTACLE 1
|
#define DPAINT_WAVE_OBSTACLE 1
|
||||||
#define DPAINT_WAVE_REFLECT_ONLY 2
|
#define DPAINT_WAVE_REFLECT_ONLY 2
|
||||||
|
@ -86,7 +86,7 @@ void BME_CD_Create(BME_CustomData *data, BME_CustomDataInit *init, int initalloc
|
|||||||
if(data->totlayer){
|
if(data->totlayer){
|
||||||
/*alloc memory*/
|
/*alloc memory*/
|
||||||
data->layers = MEM_callocN(sizeof(BME_CustomDataLayer)*data->totlayer, "BMesh Custom Data Layers");
|
data->layers = MEM_callocN(sizeof(BME_CustomDataLayer)*data->totlayer, "BMesh Custom Data Layers");
|
||||||
data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc, 0);
|
data->pool = BLI_mempool_create(data->totsize, initalloc, initalloc, FALSE, FALSE);
|
||||||
/*initialize layer data*/
|
/*initialize layer data*/
|
||||||
for(i=0; i < BME_CD_NUMTYPES; i++){
|
for(i=0; i < BME_CD_NUMTYPES; i++){
|
||||||
if(init->layout[i]){
|
if(init->layout[i]){
|
||||||
|
@ -55,10 +55,10 @@ BME_Mesh *BME_make_mesh(int allocsize[4])
|
|||||||
/*allocate the structure*/
|
/*allocate the structure*/
|
||||||
BME_Mesh *bm = MEM_callocN(sizeof(BME_Mesh),"BMesh");
|
BME_Mesh *bm = MEM_callocN(sizeof(BME_Mesh),"BMesh");
|
||||||
/*allocate the memory pools for the mesh elements*/
|
/*allocate the memory pools for the mesh elements*/
|
||||||
bm->vpool = BLI_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0], 0);
|
bm->vpool = BLI_mempool_create(sizeof(BME_Vert), allocsize[0], allocsize[0], FALSE, FALSE);
|
||||||
bm->epool = BLI_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1], 0);
|
bm->epool = BLI_mempool_create(sizeof(BME_Edge), allocsize[1], allocsize[1], FALSE, FALSE);
|
||||||
bm->lpool = BLI_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2], 0);
|
bm->lpool = BLI_mempool_create(sizeof(BME_Loop), allocsize[2], allocsize[2], FALSE, FALSE);
|
||||||
bm->ppool = BLI_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3], 0);
|
bm->ppool = BLI_mempool_create(sizeof(BME_Poly), allocsize[3], allocsize[3], FALSE, FALSE);
|
||||||
return bm;
|
return bm;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -2009,7 +2009,7 @@ void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData
|
|||||||
|
|
||||||
|
|
||||||
void CustomData_bmesh_init_pool(CustomData *data, int allocsize){
|
void CustomData_bmesh_init_pool(CustomData *data, int allocsize){
|
||||||
if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize, 0);
|
if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, allocsize, allocsize, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomData_bmesh_free_block(CustomData *data, void **block)
|
void CustomData_bmesh_free_block(CustomData *data, void **block)
|
||||||
|
@ -98,7 +98,8 @@ static int neighY[8] = {0,1,1, 1, 0,-1,-1,-1};
|
|||||||
/* paint effect default movement per frame in global units */
|
/* paint effect default movement per frame in global units */
|
||||||
#define EFF_MOVEMENT_PER_FRAME 0.05f
|
#define EFF_MOVEMENT_PER_FRAME 0.05f
|
||||||
/* initial wave time factor */
|
/* initial wave time factor */
|
||||||
#define WAVE_TIME_FAC 0.1
|
#define WAVE_TIME_FAC (1.0f/24.f)
|
||||||
|
#define WAVE_INIT_SIZE 5.0f
|
||||||
/* drying limits */
|
/* drying limits */
|
||||||
#define MIN_WETNESS 0.001f
|
#define MIN_WETNESS 0.001f
|
||||||
/* dissolve macro */
|
/* dissolve macro */
|
||||||
@ -149,6 +150,7 @@ typedef struct PaintBakeData {
|
|||||||
int *s_num; /* num of realCoord samples */
|
int *s_num; /* num of realCoord samples */
|
||||||
Vec3f *realCoord; /* current pixel center world-space coordinates for each sample
|
Vec3f *realCoord; /* current pixel center world-space coordinates for each sample
|
||||||
* ordered as (s_pos+s_num)*/
|
* ordered as (s_pos+s_num)*/
|
||||||
|
Bounds3D mesh_bounds;
|
||||||
|
|
||||||
/* adjacency info */
|
/* adjacency info */
|
||||||
BakeNeighPoint *bNeighs; /* current global neighbour distances and directions, if required */
|
BakeNeighPoint *bNeighs; /* current global neighbour distances and directions, if required */
|
||||||
@ -969,7 +971,7 @@ struct DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSett
|
|||||||
surface->color_spread_speed = 1.0f;
|
surface->color_spread_speed = 1.0f;
|
||||||
surface->shrink_speed = 1.0f;
|
surface->shrink_speed = 1.0f;
|
||||||
|
|
||||||
surface->wave_damping = 0.05f;
|
surface->wave_damping = 0.04f;
|
||||||
surface->wave_speed = 1.0f;
|
surface->wave_speed = 1.0f;
|
||||||
surface->wave_timescale = 1.0f;
|
surface->wave_timescale = 1.0f;
|
||||||
surface->wave_spring = 0.20f;
|
surface->wave_spring = 0.20f;
|
||||||
@ -1037,6 +1039,7 @@ int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, stru
|
|||||||
brush->particle_radius = 0.2f;
|
brush->particle_radius = 0.2f;
|
||||||
brush->particle_smooth = 0.05f;
|
brush->particle_smooth = 0.05f;
|
||||||
|
|
||||||
|
brush->wave_type = MOD_DPAINT_WAVEB_CHANGE;
|
||||||
brush->wave_factor = 1.0f;
|
brush->wave_factor = 1.0f;
|
||||||
brush->wave_clamp = 0.0f;
|
brush->wave_clamp = 0.0f;
|
||||||
brush->smudge_strength = 0.3f;
|
brush->smudge_strength = 0.3f;
|
||||||
@ -2070,7 +2073,6 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
|
|||||||
|
|
||||||
PaintUVPoint *tempPoints = NULL;
|
PaintUVPoint *tempPoints = NULL;
|
||||||
Vec3f *tempWeights = NULL;
|
Vec3f *tempWeights = NULL;
|
||||||
/* MVert *mvert = NULL; */ /* UNUSED */
|
|
||||||
MFace *mface = NULL;
|
MFace *mface = NULL;
|
||||||
MTFace *tface = NULL;
|
MTFace *tface = NULL;
|
||||||
Bounds2D *faceBB = NULL;
|
Bounds2D *faceBB = NULL;
|
||||||
@ -2081,7 +2083,6 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
|
|||||||
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) return setError(canvas, "Can't bake non-\"image sequence\" formats.");
|
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) return setError(canvas, "Can't bake non-\"image sequence\" formats.");
|
||||||
|
|
||||||
numOfFaces = dm->getNumFaces(dm);
|
numOfFaces = dm->getNumFaces(dm);
|
||||||
/* mvert = dm->getVertArray(dm); */ /* UNUSED */
|
|
||||||
mface = dm->getFaceArray(dm);
|
mface = dm->getFaceArray(dm);
|
||||||
|
|
||||||
/* get uv layer */
|
/* get uv layer */
|
||||||
@ -2859,7 +2860,12 @@ static void dynamicPaint_mixPaintColors(DynamicPaintSurface *surface, int index,
|
|||||||
/* applies given brush intersection value for wave surface */
|
/* applies given brush intersection value for wave surface */
|
||||||
static void dynamicPaint_mixWaveHeight(PaintWavePoint *wPoint, DynamicPaintBrushSettings *brush, float isect_height)
|
static void dynamicPaint_mixWaveHeight(PaintWavePoint *wPoint, DynamicPaintBrushSettings *brush, float isect_height)
|
||||||
{
|
{
|
||||||
|
float isect_change = isect_height - wPoint->brush_isect;
|
||||||
int hit = 0;
|
int hit = 0;
|
||||||
|
/* intersection marked regardless of brush type or hit */
|
||||||
|
wPoint->brush_isect = isect_height;
|
||||||
|
wPoint->state = DPAINT_WAVE_ISECT_CHANGED;
|
||||||
|
|
||||||
isect_height *= brush->wave_factor;
|
isect_height *= brush->wave_factor;
|
||||||
|
|
||||||
/* determine hit depending on wave_factor */
|
/* determine hit depending on wave_factor */
|
||||||
@ -2878,6 +2884,10 @@ static void dynamicPaint_mixWaveHeight(PaintWavePoint *wPoint, DynamicPaintBrush
|
|||||||
wPoint->velocity = isect_height;
|
wPoint->velocity = isect_height;
|
||||||
else if (brush->wave_type == MOD_DPAINT_WAVEB_REFLECT)
|
else if (brush->wave_type == MOD_DPAINT_WAVEB_REFLECT)
|
||||||
wPoint->state = DPAINT_WAVE_REFLECT_ONLY;
|
wPoint->state = DPAINT_WAVE_REFLECT_ONLY;
|
||||||
|
else if (brush->wave_type == MOD_DPAINT_WAVEB_CHANGE) {
|
||||||
|
if (isect_change < 0.0f)
|
||||||
|
wPoint->height += isect_change*brush->wave_factor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3235,7 +3245,7 @@ static int dynamicPaint_paintMesh(DynamicPaintSurface *surface,
|
|||||||
|
|
||||||
/* Also cast a ray in opposite direction to make sure
|
/* Also cast a ray in opposite direction to make sure
|
||||||
* point is at least surrounded by two brush faces */
|
* point is at least surrounded by two brush faces */
|
||||||
mul_v3_fl(ray_dir, -1.0f);
|
negate_v3(ray_dir);
|
||||||
hit.index = -1;
|
hit.index = -1;
|
||||||
hit.dist = 9999;
|
hit.dist = 9999;
|
||||||
|
|
||||||
@ -4292,6 +4302,9 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
|
|||||||
float dt, min_dist, damp_factor;
|
float dt, min_dist, damp_factor;
|
||||||
float wave_speed = surface->wave_speed;
|
float wave_speed = surface->wave_speed;
|
||||||
double average_dist = 0.0f;
|
double average_dist = 0.0f;
|
||||||
|
Bounds3D *mb = &sData->bData->mesh_bounds;
|
||||||
|
float canvas_size = MAX3((mb->max[0]-mb->min[0]), (mb->max[1]-mb->min[1]), (mb->max[2]-mb->min[2]));
|
||||||
|
float wave_scale = WAVE_INIT_SIZE/canvas_size;
|
||||||
|
|
||||||
/* allocate memory */
|
/* allocate memory */
|
||||||
PaintWavePoint *prevPoint = MEM_mallocN(sData->total_points*sizeof(PaintWavePoint), "Temp previous points for wave simulation");
|
PaintWavePoint *prevPoint = MEM_mallocN(sData->total_points*sizeof(PaintWavePoint), "Temp previous points for wave simulation");
|
||||||
@ -4307,11 +4320,11 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
|
|||||||
average_dist += bNeighs[sData->adj_data->n_index[index]+i].dist;
|
average_dist += bNeighs[sData->adj_data->n_index[index]+i].dist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
average_dist /= sData->adj_data->total_targets;
|
average_dist *= wave_scale/sData->adj_data->total_targets;
|
||||||
|
|
||||||
/* determine number of required steps */
|
/* determine number of required steps */
|
||||||
steps = (int)ceil((WAVE_TIME_FAC*timescale*surface->wave_timescale) / (average_dist/wave_speed/3));
|
steps = (int)ceil((WAVE_TIME_FAC*timescale*surface->wave_timescale) / (average_dist/wave_speed/3));
|
||||||
CLAMP(steps, 1, 15);
|
CLAMP(steps, 1, 20);
|
||||||
timescale /= steps;
|
timescale /= steps;
|
||||||
|
|
||||||
/* apply simulation values for final timescale */
|
/* apply simulation values for final timescale */
|
||||||
@ -4332,12 +4345,12 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
|
|||||||
int numOfN = 0, numOfRN = 0;
|
int numOfN = 0, numOfRN = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (wPoint->state) continue;
|
if (wPoint->state > 0) continue;
|
||||||
|
|
||||||
/* calculate force from surrounding points */
|
/* calculate force from surrounding points */
|
||||||
for (i=0; i<numOfNeighs; i++) {
|
for (i=0; i<numOfNeighs; i++) {
|
||||||
int n_index = sData->adj_data->n_index[index]+i;
|
int n_index = sData->adj_data->n_index[index]+i;
|
||||||
float dist = bNeighs[n_index].dist;
|
float dist = bNeighs[n_index].dist*wave_scale;
|
||||||
PaintWavePoint *tPoint = &prevPoint[sData->adj_data->n_target[n_index]];
|
PaintWavePoint *tPoint = &prevPoint[sData->adj_data->n_target[n_index]];
|
||||||
|
|
||||||
if (!dist || tPoint->state>0) continue;
|
if (!dist || tPoint->state>0) continue;
|
||||||
@ -4381,6 +4394,10 @@ void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
|
|||||||
#pragma omp parallel for schedule(static)
|
#pragma omp parallel for schedule(static)
|
||||||
for (index = 0; index < sData->total_points; index++) {
|
for (index = 0; index < sData->total_points; index++) {
|
||||||
PaintWavePoint *wPoint = &((PaintWavePoint*)sData->type_data)[index];
|
PaintWavePoint *wPoint = &((PaintWavePoint*)sData->type_data)[index];
|
||||||
|
/* if there wasnt any brush intersection, clear isect height */
|
||||||
|
if (wPoint->state == DPAINT_WAVE_NONE) {
|
||||||
|
wPoint->brush_isect = 0.0f;
|
||||||
|
}
|
||||||
wPoint->state = DPAINT_WAVE_NONE;
|
wPoint->state = DPAINT_WAVE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4594,10 +4611,11 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
|
|||||||
/*
|
/*
|
||||||
* Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
|
* Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
|
||||||
*/
|
*/
|
||||||
#pragma omp parallel for schedule(static)
|
bData->mesh_bounds.valid = 0;
|
||||||
for (index=0; index<canvasNumOfVerts; index++) {
|
for (index=0; index<canvasNumOfVerts; index++) {
|
||||||
copy_v3_v3(canvas_verts[index].v, mvert[index].co);
|
copy_v3_v3(canvas_verts[index].v, mvert[index].co);
|
||||||
mul_m4_v3(ob->obmat, canvas_verts[index].v);
|
mul_m4_v3(ob->obmat, canvas_verts[index].v);
|
||||||
|
boundInsert(&bData->mesh_bounds, canvas_verts[index].v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1911,7 +1911,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
|
|||||||
switch(type) {
|
switch(type) {
|
||||||
case PART_KINK_CURL:
|
case PART_KINK_CURL:
|
||||||
{
|
{
|
||||||
mul_v3_fl(par_vec, -1.f);
|
negate_v3(par_vec);
|
||||||
|
|
||||||
if(flat > 0.f) {
|
if(flat > 0.f) {
|
||||||
float proj[3];
|
float proj[3];
|
||||||
@ -1977,7 +1977,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
|
|||||||
mul_qt_v3(par_rot, z_vec);
|
mul_qt_v3(par_rot, z_vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
mul_v3_fl(par_vec, -1.f);
|
negate_v3(par_vec);
|
||||||
normalize_v3_v3(vec_one, par_vec);
|
normalize_v3_v3(vec_one, par_vec);
|
||||||
|
|
||||||
inp_y=dot_v3v3(y_vec, vec_one);
|
inp_y=dot_v3v3(y_vec, vec_one);
|
||||||
|
@ -2679,7 +2679,7 @@ static float nr_signed_distance_to_plane(float *p, float radius, ParticleCollisi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(pce->inv_nor == 1) {
|
if(pce->inv_nor == 1) {
|
||||||
mul_v3_fl(nor, -1.f);
|
negate_v3(nor);
|
||||||
d = -d;
|
d = -d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2799,7 +2799,7 @@ static void collision_point_on_surface(float p[3], ParticleCollisionElement *pce
|
|||||||
normalize_v3(nor);
|
normalize_v3(nor);
|
||||||
|
|
||||||
if(pce->inv_nor == 1)
|
if(pce->inv_nor == 1)
|
||||||
mul_v3_fl(nor, -1.f);
|
negate_v3(nor);
|
||||||
|
|
||||||
madd_v3_v3v3fl(co, pce->x0, nor, col->radius);
|
madd_v3_v3v3fl(co, pce->x0, nor, col->radius);
|
||||||
madd_v3_v3fl(co, e1, pce->uv[0]);
|
madd_v3_v3fl(co, e1, pce->uv[0]);
|
||||||
|
@ -594,6 +594,9 @@ void calc_sequence(Scene *scene, Sequence *seq)
|
|||||||
// seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
|
// seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
|
||||||
|
|
||||||
if (seq->seq1) {
|
if (seq->seq1) {
|
||||||
|
/* XXX These resets should not be necessary, but users used to be able to
|
||||||
|
* edit effect's length, leading to strange results. See #29190. */
|
||||||
|
seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
|
||||||
seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
|
seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
|
||||||
seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
|
seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
|
||||||
/* we cant help if strips don't overlap, it wont give useful results.
|
/* we cant help if strips don't overlap, it wont give useful results.
|
||||||
|
@ -34,12 +34,45 @@
|
|||||||
* \brief Simple fast memory allocator.
|
* \brief Simple fast memory allocator.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct BLI_mempool;
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
struct BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, int use_sysmalloc);
|
struct BLI_mempool;
|
||||||
void *BLI_mempool_alloc(struct BLI_mempool *pool);
|
struct BLI_mempool_chunk;
|
||||||
void *BLI_mempool_calloc(struct BLI_mempool *pool);
|
|
||||||
void BLI_mempool_free(struct BLI_mempool *pool, void *addr);
|
typedef struct BLI_mempool BLI_mempool;
|
||||||
void BLI_mempool_destroy(struct BLI_mempool *pool);
|
|
||||||
|
/*allow_iter allows iteration on this mempool. note: this requires that the
|
||||||
|
first four bytes of the elements never contain the character string
|
||||||
|
'free'. use with care.*/
|
||||||
|
|
||||||
|
BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk,
|
||||||
|
short use_sysmalloc, short allow_iter);
|
||||||
|
void *BLI_mempool_alloc(BLI_mempool *pool);
|
||||||
|
void *BLI_mempool_calloc(BLI_mempool *pool);
|
||||||
|
void BLI_mempool_free(BLI_mempool *pool, void *addr);
|
||||||
|
void BLI_mempool_destroy(BLI_mempool *pool);
|
||||||
|
int BLI_mempool_count(BLI_mempool *pool);
|
||||||
|
|
||||||
|
/** iteration stuff. note: this may easy to produce bugs with **/
|
||||||
|
/*private structure*/
|
||||||
|
typedef struct BLI_mempool_iter {
|
||||||
|
BLI_mempool *pool;
|
||||||
|
struct BLI_mempool_chunk *curchunk;
|
||||||
|
int curindex;
|
||||||
|
} BLI_mempool_iter;
|
||||||
|
|
||||||
|
/*allow iteration on this mempool. note: this requires that the
|
||||||
|
first four bytes of the elements never contain the character string
|
||||||
|
'free'. use with care.*/
|
||||||
|
void BLI_mempool_allow_iter(BLI_mempool *pool);
|
||||||
|
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter);
|
||||||
|
void *BLI_mempool_iterstep(BLI_mempool_iter *iter);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +60,7 @@ GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) {
|
|||||||
GHash *gh= MEM_mallocN(sizeof(*gh), info);
|
GHash *gh= MEM_mallocN(sizeof(*gh), info);
|
||||||
gh->hashfp= hashfp;
|
gh->hashfp= hashfp;
|
||||||
gh->cmpfp= cmpfp;
|
gh->cmpfp= cmpfp;
|
||||||
gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 0);
|
gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, FALSE, FALSE);
|
||||||
|
|
||||||
gh->cursize= 0;
|
gh->cursize= 0;
|
||||||
gh->nentries= 0;
|
gh->nentries= 0;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
* The Original Code is: all of this file.
|
* The Original Code is: all of this file.
|
||||||
*
|
*
|
||||||
* Contributor(s): none yet.
|
* Contributor(s): Geoffery Bantle
|
||||||
*
|
*
|
||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
@ -29,69 +29,112 @@
|
|||||||
* \ingroup bli
|
* \ingroup bli
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Simple, fast memory allocator for allocating many elements of the same size.
|
* Simple, fast memory allocator for allocating many elements of the same size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "BLI_utildefines.h"
|
||||||
|
#include "BLI_listbase.h"
|
||||||
|
|
||||||
|
#include "BLI_mempool.h" /* own include */
|
||||||
|
|
||||||
|
#include "DNA_listBase.h"
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
#include "BLI_blenlib.h"
|
|
||||||
#include "BLI_mempool.h"
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
typedef struct BLI_freenode{
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/* note: copied from BKE_utildefines.h, dont use here because we're in BLI */
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
/* Big Endian */
|
||||||
|
# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||||
|
#else
|
||||||
|
/* Little Endian */
|
||||||
|
# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define FREEWORD MAKE_ID('f', 'r', 'e', 'e')
|
||||||
|
|
||||||
|
typedef struct BLI_freenode {
|
||||||
struct BLI_freenode *next;
|
struct BLI_freenode *next;
|
||||||
}BLI_freenode;
|
int freeword; /* used to identify this as a freed node */
|
||||||
|
} BLI_freenode;
|
||||||
|
|
||||||
typedef struct BLI_mempool_chunk{
|
typedef struct BLI_mempool_chunk {
|
||||||
struct BLI_mempool_chunk *next, *prev;
|
struct BLI_mempool_chunk *next, *prev;
|
||||||
void *data;
|
void *data;
|
||||||
}BLI_mempool_chunk;
|
} BLI_mempool_chunk;
|
||||||
|
|
||||||
typedef struct BLI_mempool{
|
typedef struct BLI_mempool {
|
||||||
struct ListBase chunks;
|
struct ListBase chunks;
|
||||||
int esize, csize, pchunk; /*size of elements and chunks in bytes and number of elements per chunk*/
|
int esize, csize, pchunk; /* size of elements and chunks in bytes
|
||||||
struct BLI_freenode *free; /*free element list. Interleaved into chunk datas.*/
|
* and number of elements per chunk*/
|
||||||
int totalloc, totused; /*total number of elements allocated in total, and currently in use*/
|
short use_sysmalloc, allow_iter;
|
||||||
int use_sysmalloc;
|
/* keeps aligned to 16 bits */
|
||||||
}BLI_mempool;
|
|
||||||
|
|
||||||
BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, int use_sysmalloc)
|
BLI_freenode *free; /* free element list. Interleaved into chunk datas.*/
|
||||||
{ BLI_mempool *pool = NULL;
|
int totalloc, totused; /* total number of elements allocated in total,
|
||||||
|
* and currently in use*/
|
||||||
|
} BLI_mempool;
|
||||||
|
|
||||||
|
#define MEMPOOL_ELEM_SIZE_MIN (sizeof(void *) * 2)
|
||||||
|
|
||||||
|
BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk,
|
||||||
|
short use_sysmalloc, short allow_iter)
|
||||||
|
{
|
||||||
|
BLI_mempool *pool = NULL;
|
||||||
BLI_freenode *lasttail = NULL, *curnode = NULL;
|
BLI_freenode *lasttail = NULL, *curnode = NULL;
|
||||||
int i,j, maxchunks;
|
int i,j, maxchunks;
|
||||||
char *addr;
|
char *addr;
|
||||||
|
|
||||||
if (esize < sizeof(void*))
|
if (esize < MEMPOOL_ELEM_SIZE_MIN)
|
||||||
esize = sizeof(void*);
|
esize = MEMPOOL_ELEM_SIZE_MIN;
|
||||||
|
|
||||||
/*allocate the pool structure*/
|
/*allocate the pool structure*/
|
||||||
pool = use_sysmalloc ? malloc(sizeof(BLI_mempool)) : MEM_mallocN(sizeof(BLI_mempool), "memory pool");
|
pool = use_sysmalloc ? malloc(sizeof(BLI_mempool)) : MEM_mallocN(sizeof(BLI_mempool), "memory pool");
|
||||||
pool->esize = esize;
|
pool->esize = allow_iter ? MAX2(esize, sizeof(BLI_freenode)) : esize;
|
||||||
pool->use_sysmalloc = use_sysmalloc;
|
pool->use_sysmalloc = use_sysmalloc;
|
||||||
pool->pchunk = pchunk;
|
pool->pchunk = pchunk;
|
||||||
pool->csize = esize * pchunk;
|
pool->csize = esize * pchunk;
|
||||||
pool->chunks.first = pool->chunks.last = NULL;
|
pool->chunks.first = pool->chunks.last = NULL;
|
||||||
pool->totused= 0;
|
pool->totused= 0;
|
||||||
|
pool->allow_iter= allow_iter;
|
||||||
|
|
||||||
maxchunks = tote / pchunk + 1;
|
maxchunks = tote / pchunk + 1;
|
||||||
|
if (maxchunks==0) maxchunks = 1;
|
||||||
|
|
||||||
/*allocate the actual chunks*/
|
/*allocate the actual chunks*/
|
||||||
for(i=0; i < maxchunks; i++){
|
for (i=0; i < maxchunks; i++) {
|
||||||
BLI_mempool_chunk *mpchunk = use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
|
BLI_mempool_chunk *mpchunk = use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
|
||||||
mpchunk->next = mpchunk->prev = NULL;
|
mpchunk->next = mpchunk->prev = NULL;
|
||||||
mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
|
mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data");
|
||||||
BLI_addtail(&(pool->chunks), mpchunk);
|
BLI_addtail(&(pool->chunks), mpchunk);
|
||||||
|
|
||||||
if(i==0) pool->free = mpchunk->data; /*start of the list*/
|
if (i==0) {
|
||||||
|
pool->free = mpchunk->data; /*start of the list*/
|
||||||
|
if (pool->allow_iter)
|
||||||
|
pool->free->freeword = FREEWORD;
|
||||||
|
}
|
||||||
|
|
||||||
/*loop through the allocated data, building the pointer structures*/
|
/*loop through the allocated data, building the pointer structures*/
|
||||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
for (addr = mpchunk->data, j=0; j < pool->pchunk; j++) {
|
||||||
curnode = ((BLI_freenode*)addr);
|
curnode = ((BLI_freenode*)addr);
|
||||||
addr += pool->esize;
|
addr += pool->esize;
|
||||||
curnode->next = (BLI_freenode*)addr;
|
curnode->next = (BLI_freenode*)addr;
|
||||||
|
if (pool->allow_iter) {
|
||||||
|
if (j != pool->pchunk-1)
|
||||||
|
curnode->next->freeword = FREEWORD;
|
||||||
|
curnode->freeword = FREEWORD;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*final pointer in the previously allocated chunk is wrong.*/
|
/*final pointer in the previously allocated chunk is wrong.*/
|
||||||
if(lasttail) lasttail->next = mpchunk->data;
|
if (lasttail) {
|
||||||
|
lasttail->next = mpchunk->data;
|
||||||
|
if (pool->allow_iter)
|
||||||
|
lasttail->freeword = FREEWORD;
|
||||||
|
}
|
||||||
|
|
||||||
/*set the end of this chunks memoryy to the new tail for next iteration*/
|
/*set the end of this chunks memoryy to the new tail for next iteration*/
|
||||||
lasttail = curnode;
|
lasttail = curnode;
|
||||||
|
|
||||||
@ -101,15 +144,18 @@ BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, int use_sysmall
|
|||||||
curnode->next = NULL;
|
curnode->next = NULL;
|
||||||
return pool;
|
return pool;
|
||||||
}
|
}
|
||||||
void *BLI_mempool_alloc(BLI_mempool *pool){
|
|
||||||
|
void *BLI_mempool_alloc(BLI_mempool *pool)
|
||||||
|
{
|
||||||
void *retval=NULL;
|
void *retval=NULL;
|
||||||
BLI_freenode *curnode=NULL;
|
|
||||||
char *addr=NULL;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
pool->totused++;
|
pool->totused++;
|
||||||
|
|
||||||
if(!(pool->free)){
|
if (!(pool->free)) {
|
||||||
|
BLI_freenode *curnode=NULL;
|
||||||
|
char *addr;
|
||||||
|
int j;
|
||||||
|
|
||||||
/*need to allocate a new chunk*/
|
/*need to allocate a new chunk*/
|
||||||
BLI_mempool_chunk *mpchunk = pool->use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
|
BLI_mempool_chunk *mpchunk = pool->use_sysmalloc ? malloc(sizeof(BLI_mempool_chunk)) : MEM_mallocN(sizeof(BLI_mempool_chunk), "BLI_Mempool Chunk");
|
||||||
mpchunk->next = mpchunk->prev = NULL;
|
mpchunk->next = mpchunk->prev = NULL;
|
||||||
@ -117,10 +163,18 @@ void *BLI_mempool_alloc(BLI_mempool *pool){
|
|||||||
BLI_addtail(&(pool->chunks), mpchunk);
|
BLI_addtail(&(pool->chunks), mpchunk);
|
||||||
|
|
||||||
pool->free = mpchunk->data; /*start of the list*/
|
pool->free = mpchunk->data; /*start of the list*/
|
||||||
|
if (pool->allow_iter)
|
||||||
|
pool->free->freeword = FREEWORD;
|
||||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
||||||
curnode = ((BLI_freenode*)addr);
|
curnode = ((BLI_freenode*)addr);
|
||||||
addr += pool->esize;
|
addr += pool->esize;
|
||||||
curnode->next = (BLI_freenode*)addr;
|
curnode->next = (BLI_freenode*)addr;
|
||||||
|
|
||||||
|
if (pool->allow_iter) {
|
||||||
|
curnode->freeword = FREEWORD;
|
||||||
|
if (j != pool->pchunk-1)
|
||||||
|
curnode->next->freeword = FREEWORD;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
curnode->next = NULL; /*terminate the list*/
|
curnode->next = NULL; /*terminate the list*/
|
||||||
|
|
||||||
@ -128,25 +182,28 @@ void *BLI_mempool_alloc(BLI_mempool *pool){
|
|||||||
}
|
}
|
||||||
|
|
||||||
retval = pool->free;
|
retval = pool->free;
|
||||||
|
if (pool->allow_iter)
|
||||||
|
pool->free->freeword = 0x7FFFFFFF;
|
||||||
|
|
||||||
pool->free = pool->free->next;
|
pool->free = pool->free->next;
|
||||||
//memset(retval, 0, pool->esize);
|
//memset(retval, 0, pool->esize);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *BLI_mempool_calloc(BLI_mempool *pool){
|
void *BLI_mempool_calloc(BLI_mempool *pool)
|
||||||
void *retval=NULL;
|
{
|
||||||
retval = BLI_mempool_alloc(pool);
|
void *retval= BLI_mempool_alloc(pool);
|
||||||
memset(retval, 0, pool->esize);
|
memset(retval, 0, pool->esize);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* doesnt protect against double frees, dont be stupid! */
|
||||||
void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against double frees, dont be stupid!
|
void BLI_mempool_free(BLI_mempool *pool, void *addr)
|
||||||
|
{
|
||||||
BLI_freenode *newhead = addr;
|
BLI_freenode *newhead = addr;
|
||||||
BLI_freenode *curnode=NULL;
|
|
||||||
char *tmpaddr=NULL;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
|
if (pool->allow_iter)
|
||||||
|
newhead->freeword = FREEWORD;
|
||||||
newhead->next = pool->free;
|
newhead->next = pool->free;
|
||||||
pool->free = newhead;
|
pool->free = newhead;
|
||||||
|
|
||||||
@ -154,14 +211,18 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
|
|||||||
|
|
||||||
/*nothing is in use; free all the chunks except the first*/
|
/*nothing is in use; free all the chunks except the first*/
|
||||||
if (pool->totused == 0) {
|
if (pool->totused == 0) {
|
||||||
BLI_mempool_chunk *mpchunk=NULL, *first;
|
BLI_freenode *curnode=NULL;
|
||||||
|
char *tmpaddr=NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
BLI_mempool_chunk *mpchunk=NULL;
|
||||||
|
BLI_mempool_chunk *first= pool->chunks.first;
|
||||||
|
|
||||||
first = pool->chunks.first;
|
|
||||||
BLI_remlink(&pool->chunks, first);
|
BLI_remlink(&pool->chunks, first);
|
||||||
|
|
||||||
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
|
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
|
||||||
if(pool->use_sysmalloc) free(mpchunk->data);
|
if (pool->use_sysmalloc) free(mpchunk->data);
|
||||||
else MEM_freeN(mpchunk->data);
|
else MEM_freeN(mpchunk->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks));
|
pool->use_sysmalloc ? BLI_freelist(&(pool->chunks)) : BLI_freelistN(&(pool->chunks));
|
||||||
@ -170,7 +231,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
|
|||||||
pool->totalloc = pool->pchunk;
|
pool->totalloc = pool->pchunk;
|
||||||
|
|
||||||
pool->free = first->data; /*start of the list*/
|
pool->free = first->data; /*start of the list*/
|
||||||
for(tmpaddr = first->data, i=0; i < pool->pchunk; i++){
|
for (tmpaddr = first->data, i=0; i < pool->pchunk; i++) {
|
||||||
curnode = ((BLI_freenode*)tmpaddr);
|
curnode = ((BLI_freenode*)tmpaddr);
|
||||||
tmpaddr += pool->esize;
|
tmpaddr += pool->esize;
|
||||||
curnode->next = (BLI_freenode*)tmpaddr;
|
curnode->next = (BLI_freenode*)tmpaddr;
|
||||||
@ -179,18 +240,63 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr){ //doesnt protect against d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter)
|
||||||
|
{
|
||||||
|
if (!pool->allow_iter) {
|
||||||
|
fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__);
|
||||||
|
iter->curchunk = NULL;
|
||||||
|
iter->curindex = 0;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
iter->pool = pool;
|
||||||
|
iter->curchunk = pool->chunks.first;
|
||||||
|
iter->curindex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *bli_mempool_iternext(BLI_mempool_iter *iter)
|
||||||
|
{
|
||||||
|
void *ret = NULL;
|
||||||
|
|
||||||
|
if (!iter->curchunk || !iter->pool->totused) return NULL;
|
||||||
|
|
||||||
|
ret = ((char*)iter->curchunk->data) + iter->pool->esize*iter->curindex;
|
||||||
|
|
||||||
|
iter->curindex++;
|
||||||
|
|
||||||
|
if (iter->curindex >= iter->pool->pchunk) {
|
||||||
|
iter->curchunk = iter->curchunk->next;
|
||||||
|
iter->curindex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
|
||||||
|
{
|
||||||
|
BLI_freenode *ret;
|
||||||
|
|
||||||
|
do {
|
||||||
|
ret = bli_mempool_iternext(iter);
|
||||||
|
} while (ret && ret->freeword == FREEWORD);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void BLI_mempool_destroy(BLI_mempool *pool)
|
void BLI_mempool_destroy(BLI_mempool *pool)
|
||||||
{
|
{
|
||||||
BLI_mempool_chunk *mpchunk=NULL;
|
BLI_mempool_chunk *mpchunk=NULL;
|
||||||
if(pool->use_sysmalloc) {
|
|
||||||
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
|
if (pool->use_sysmalloc) {
|
||||||
|
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
|
||||||
free(mpchunk->data);
|
free(mpchunk->data);
|
||||||
}
|
}
|
||||||
BLI_freelist(&(pool->chunks));
|
BLI_freelist(&(pool->chunks));
|
||||||
free(pool);
|
free(pool);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
|
for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
|
||||||
MEM_freeN(mpchunk->data);
|
MEM_freeN(mpchunk->data);
|
||||||
}
|
}
|
||||||
BLI_freelistN(&(pool->chunks));
|
BLI_freelistN(&(pool->chunks));
|
||||||
|
@ -1979,7 +1979,7 @@ static void direct_link_nladata_strips(FileData *fd, ListBase *list)
|
|||||||
|
|
||||||
/* strip's F-Modifiers */
|
/* strip's F-Modifiers */
|
||||||
link_list(fd, &strip->modifiers);
|
link_list(fd, &strip->modifiers);
|
||||||
direct_link_modifiers(fd, &strip->modifiers);
|
direct_link_fmodifiers(fd, &strip->modifiers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1917,7 +1917,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
rcti rect;
|
rcti rect;
|
||||||
short selectmode=0;
|
short selectmode=0;
|
||||||
int gesture_mode;
|
int gesture_mode, extend;
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
@ -1928,8 +1928,13 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
||||||
rect.xmax= RNA_int_get(op->ptr, "xmax");
|
rect.xmax= RNA_int_get(op->ptr, "xmax");
|
||||||
rect.ymax= RNA_int_get(op->ptr, "ymax");
|
rect.ymax= RNA_int_get(op->ptr, "ymax");
|
||||||
|
|
||||||
gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
|
gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
|
||||||
|
extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
|
||||||
|
if(!extend)
|
||||||
|
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_CLEAR);
|
||||||
|
|
||||||
if (gesture_mode == GESTURE_MODAL_SELECT)
|
if (gesture_mode == GESTURE_MODAL_SELECT)
|
||||||
selectmode = ACHANNEL_SETFLAG_ADD;
|
selectmode = ACHANNEL_SETFLAG_ADD;
|
||||||
else
|
else
|
||||||
@ -1963,7 +1968,7 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************* Rename Operator ***************************** */
|
/* ******************* Rename Operator ***************************** */
|
||||||
|
@ -1147,6 +1147,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
|
|||||||
int xmax= RNA_int_get(op->ptr, "xmax");
|
int xmax= RNA_int_get(op->ptr, "xmax");
|
||||||
int ymin= RNA_int_get(op->ptr, "ymin");
|
int ymin= RNA_int_get(op->ptr, "ymin");
|
||||||
int ymax= RNA_int_get(op->ptr, "ymax");
|
int ymax= RNA_int_get(op->ptr, "ymax");
|
||||||
|
int extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
|
||||||
UI_view2d_region_to_view(v2d, xmin, ymin, &xminf, &yminf);
|
UI_view2d_region_to_view(v2d, xmin, ymin, &xminf, &yminf);
|
||||||
UI_view2d_region_to_view(v2d, xmax, ymax, &xmaxf, &ymaxf);
|
UI_view2d_region_to_view(v2d, xmax, ymax, &xmaxf, &ymaxf);
|
||||||
@ -1166,6 +1167,9 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!extend) {
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
|
WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
|
||||||
@ -1198,7 +1202,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *********************** (de)select all ***************** */
|
/* *********************** (de)select all ***************** */
|
||||||
|
@ -169,8 +169,13 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar)
|
|||||||
|
|
||||||
static void area_draw_azone(short x1, short y1, short x2, short y2)
|
static void area_draw_azone(short x1, short y1, short x2, short y2)
|
||||||
{
|
{
|
||||||
int dx= floor(0.3f*(x2-x1));
|
int dx = x2 - x1;
|
||||||
int dy= floor(0.3f*(y2-y1));
|
int dy = y2 - y1;
|
||||||
|
|
||||||
|
dx= copysign(ceil(0.3f*fabs(dx)), dx);
|
||||||
|
dy= copysign(ceil(0.3f*fabs(dy)), dy);
|
||||||
|
|
||||||
|
glEnable(GL_LINE_SMOOTH);
|
||||||
|
|
||||||
glColor4ub(255, 255, 255, 180);
|
glColor4ub(255, 255, 255, 180);
|
||||||
fdrawline(x1, y2, x2, y1);
|
fdrawline(x1, y2, x2, y1);
|
||||||
@ -185,8 +190,9 @@ static void area_draw_azone(short x1, short y1, short x2, short y2)
|
|||||||
fdrawline(x1, y2-dy+1, x2-dx+1, y1);
|
fdrawline(x1, y2-dy+1, x2-dx+1, y1);
|
||||||
glColor4ub(0, 0, 0, 150);
|
glColor4ub(0, 0, 0, 150);
|
||||||
fdrawline(x1, y2-2*dy+1, x2-2*dx+1, y1);
|
fdrawline(x1, y2-2*dy+1, x2-2*dx+1, y1);
|
||||||
}
|
|
||||||
|
|
||||||
|
glDisable(GL_LINE_SMOOTH);
|
||||||
|
}
|
||||||
|
|
||||||
static void region_draw_azone_icon(AZone *az)
|
static void region_draw_azone_icon(AZone *az)
|
||||||
{
|
{
|
||||||
@ -550,19 +556,19 @@ static void area_azone_initialize(ScrArea *sa)
|
|||||||
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
||||||
BLI_addtail(&(sa->actionzones), az);
|
BLI_addtail(&(sa->actionzones), az);
|
||||||
az->type= AZONE_AREA;
|
az->type= AZONE_AREA;
|
||||||
az->x1= sa->totrct.xmin;
|
az->x1= sa->totrct.xmin - 1;
|
||||||
az->y1= sa->totrct.ymin;
|
az->y1= sa->totrct.ymin - 1;
|
||||||
az->x2= sa->totrct.xmin + AZONESPOT;
|
az->x2= sa->totrct.xmin + (AZONESPOT-1);
|
||||||
az->y2= sa->totrct.ymin + AZONESPOT;
|
az->y2= sa->totrct.ymin + (AZONESPOT-1);
|
||||||
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
||||||
|
|
||||||
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
|
||||||
BLI_addtail(&(sa->actionzones), az);
|
BLI_addtail(&(sa->actionzones), az);
|
||||||
az->type= AZONE_AREA;
|
az->type= AZONE_AREA;
|
||||||
az->x1= sa->totrct.xmax+1;
|
az->x1= sa->totrct.xmax + 1;
|
||||||
az->y1= sa->totrct.ymax+1;
|
az->y1= sa->totrct.ymax + 1;
|
||||||
az->x2= sa->totrct.xmax-AZONESPOT;
|
az->x2= sa->totrct.xmax - (AZONESPOT-1);
|
||||||
az->y2= sa->totrct.ymax-AZONESPOT;
|
az->y2= sa->totrct.ymax - (AZONESPOT-1);
|
||||||
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,11 +269,16 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
rcti rect;
|
rcti rect;
|
||||||
short mode=0, selectmode=0;
|
short mode=0, selectmode=0;
|
||||||
int gesture_mode;
|
int gesture_mode, extend;
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
|
/* clear all selection if not extending selection */
|
||||||
|
extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
if (!extend)
|
||||||
|
deselect_action_keys(&ac, 1, SELECT_SUBTRACT);
|
||||||
|
|
||||||
/* get settings from operator */
|
/* get settings from operator */
|
||||||
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
||||||
@ -330,7 +335,7 @@ void ACTION_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
|
|
||||||
ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
|
ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
|
||||||
}
|
}
|
||||||
|
@ -869,7 +869,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
|||||||
MovieTrackingTrack *track;
|
MovieTrackingTrack *track;
|
||||||
rcti rect;
|
rcti rect;
|
||||||
rctf rectf;
|
rctf rectf;
|
||||||
int change= 0, mode;
|
int change= 0, mode, extend;
|
||||||
|
|
||||||
/* get rectangle from operator */
|
/* get rectangle from operator */
|
||||||
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
||||||
@ -881,6 +881,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
|||||||
ED_clip_point_stable_pos(C, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
ED_clip_point_stable_pos(C, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
mode= RNA_int_get(op->ptr, "gesture_mode");
|
mode= RNA_int_get(op->ptr, "gesture_mode");
|
||||||
|
extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
|
||||||
/* do actual selection */
|
/* do actual selection */
|
||||||
track= clip->tracking.tracks.first;
|
track= clip->tracking.tracks.first;
|
||||||
@ -888,8 +889,13 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
|||||||
if((track->flag&TRACK_HIDDEN)==0) {
|
if((track->flag&TRACK_HIDDEN)==0) {
|
||||||
MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
|
MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
|
||||||
|
|
||||||
if(MARKER_VISIBLE(sc, marker) && BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) {
|
if(MARKER_VISIBLE(sc, marker)) {
|
||||||
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
|
if(BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) {
|
||||||
|
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
|
||||||
|
}
|
||||||
|
else if(!extend) {
|
||||||
|
BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, 1);
|
||||||
|
}
|
||||||
|
|
||||||
change= 1;
|
change= 1;
|
||||||
}
|
}
|
||||||
@ -921,10 +927,10 @@ void CLIP_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->poll= ED_space_clip_poll;
|
ot->poll= ED_space_clip_poll;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_UNDO;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************** circle select operator *********************/
|
/********************** circle select operator *********************/
|
||||||
|
@ -273,13 +273,20 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
|
|||||||
ARegion *ar= CTX_wm_region(C);
|
ARegion *ar= CTX_wm_region(C);
|
||||||
rcti rect;
|
rcti rect;
|
||||||
FileSelect ret;
|
FileSelect ret;
|
||||||
|
int extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
short select= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
|
short select= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
|
||||||
|
|
||||||
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
||||||
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
||||||
rect.xmax= RNA_int_get(op->ptr, "xmax");
|
rect.xmax= RNA_int_get(op->ptr, "xmax");
|
||||||
rect.ymax= RNA_int_get(op->ptr, "ymax");
|
rect.ymax= RNA_int_get(op->ptr, "ymax");
|
||||||
|
|
||||||
|
if(!extend) {
|
||||||
|
SpaceFile *sfile= CTX_wm_space_file(C);
|
||||||
|
|
||||||
|
file_deselect_all(sfile, SELECTED_FILE);
|
||||||
|
}
|
||||||
|
|
||||||
BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect);
|
BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect);
|
||||||
|
|
||||||
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, 0);
|
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, 0);
|
||||||
@ -306,7 +313,7 @@ void FILE_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->cancel= WM_border_select_cancel;
|
ot->cancel= WM_border_select_cancel;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, 0);
|
WM_operator_properties_gesture_border(ot, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||||
|
@ -289,11 +289,17 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
rcti rect;
|
rcti rect;
|
||||||
short mode=0, selectmode=0;
|
short mode=0, selectmode=0;
|
||||||
short incl_handles;
|
short incl_handles;
|
||||||
|
int extend;
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
|
/* clear all selection if not extending selection */
|
||||||
|
extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
if (!extend)
|
||||||
|
deselect_graph_keys(&ac, 1, SELECT_SUBTRACT, TRUE);
|
||||||
|
|
||||||
/* get select mode
|
/* get select mode
|
||||||
* - 'gesture_mode' from the operator specifies how to select
|
* - 'gesture_mode' from the operator specifies how to select
|
||||||
* - 'include_handles' from the operator specifies whether to include handles in the selection
|
* - 'include_handles' from the operator specifies whether to include handles in the selection
|
||||||
@ -354,7 +360,7 @@ void GRAPH_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
|
ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
|
|
||||||
ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
|
ot->prop= RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
|
||||||
RNA_def_boolean(ot->srna, "include_handles", 0, "Include Handles", "Are handles tested individually against the selection criteria");
|
RNA_def_boolean(ot->srna, "include_handles", 0, "Include Handles", "Are handles tested individually against the selection criteria");
|
||||||
|
@ -220,6 +220,7 @@ static int borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
ARegion *ar= CTX_wm_region(C);
|
ARegion *ar= CTX_wm_region(C);
|
||||||
ReportList *reports= CTX_wm_reports(C);
|
ReportList *reports= CTX_wm_reports(C);
|
||||||
int report_mask= info_report_mask(sinfo);
|
int report_mask= info_report_mask(sinfo);
|
||||||
|
int extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
Report *report_min, *report_max, *report;
|
Report *report_min, *report_max, *report;
|
||||||
|
|
||||||
//View2D *v2d= UI_view2d_fromcontext(C);
|
//View2D *v2d= UI_view2d_fromcontext(C);
|
||||||
@ -244,6 +245,16 @@ static int borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);
|
UI_view2d_region_to_view(v2d, mval[0], mval[1], &rectf.xmax, &rectf.ymax);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if(!extend) {
|
||||||
|
for(report= reports->list.first; report; report= report->next) {
|
||||||
|
|
||||||
|
if((report->type & report_mask)==0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
report->flag &= ~SELECT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
report_min= info_text_pick(sinfo, ar, reports, rect.ymax);
|
report_min= info_text_pick(sinfo, ar, reports, rect.ymax);
|
||||||
report_max= info_text_pick(sinfo, ar, reports, rect.ymin);
|
report_max= info_text_pick(sinfo, ar, reports, rect.ymin);
|
||||||
|
|
||||||
@ -308,7 +319,7 @@ void INFO_OT_select_border(wmOperatorType *ot)
|
|||||||
/* ot->flag= OPTYPE_REGISTER; */
|
/* ot->flag= OPTYPE_REGISTER; */
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -282,11 +282,17 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
bAnimContext ac;
|
bAnimContext ac;
|
||||||
rcti rect;
|
rcti rect;
|
||||||
short mode=0, selectmode=0;
|
short mode=0, selectmode=0;
|
||||||
|
int extend;
|
||||||
|
|
||||||
/* get editor data */
|
/* get editor data */
|
||||||
if (ANIM_animdata_get_context(C, &ac) == 0)
|
if (ANIM_animdata_get_context(C, &ac) == 0)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
|
|
||||||
|
/* clear all selection if not extending selection */
|
||||||
|
extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
if (!extend)
|
||||||
|
deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_SUBTRACT);
|
||||||
|
|
||||||
/* get settings from operator */
|
/* get settings from operator */
|
||||||
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
||||||
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
||||||
@ -341,7 +347,7 @@ void NLA_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, 0);
|
WM_operator_properties_gesture_border(ot, 1);
|
||||||
|
|
||||||
RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
|
RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
|
||||||
}
|
}
|
||||||
|
@ -164,6 +164,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
rcti rect;
|
rcti rect;
|
||||||
rctf rectf;
|
rctf rectf;
|
||||||
int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
|
int gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
|
||||||
|
int extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
|
||||||
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
||||||
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
rect.ymin= RNA_int_get(op->ptr, "ymin");
|
||||||
@ -180,6 +181,9 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
else
|
else
|
||||||
node->flag &= ~SELECT;
|
node->flag &= ~SELECT;
|
||||||
}
|
}
|
||||||
|
else if(!extend) {
|
||||||
|
node->flag &= ~SELECT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node_sort(snode->edittree);
|
node_sort(snode->edittree);
|
||||||
@ -228,7 +232,7 @@ void NODE_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
RNA_def_boolean(ot->srna, "tweak", 0, "Tweak", "Only activate when mouse is not over a node - useful for tweak gesture");
|
RNA_def_boolean(ot->srna, "tweak", 0, "Tweak", "Only activate when mouse is not over a node - useful for tweak gesture");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,6 +827,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
rcti rect;
|
rcti rect;
|
||||||
rctf rectf, rq;
|
rctf rectf, rq;
|
||||||
short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
|
short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
|
||||||
|
int extend = RNA_boolean_get(op->ptr, "extend");
|
||||||
int mval[2];
|
int mval[2];
|
||||||
|
|
||||||
if(ed==NULL)
|
if(ed==NULL)
|
||||||
@ -852,6 +853,10 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
|
|||||||
else seq->flag &= ~SEQ_ALLSEL;
|
else seq->flag &= ~SEQ_ALLSEL;
|
||||||
recurs_sel_seq(seq);
|
recurs_sel_seq(seq);
|
||||||
}
|
}
|
||||||
|
else if(!extend) {
|
||||||
|
seq->flag &= ~SEQ_ALLSEL;
|
||||||
|
recurs_sel_seq(seq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
|
||||||
@ -880,7 +885,7 @@ void SEQUENCER_OT_select_border(wmOperatorType *ot)
|
|||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****** Selected Grouped ****** */
|
/* ****** Selected Grouped ****** */
|
||||||
|
@ -1490,7 +1490,7 @@ static void UV_OT_stitch(wmOperatorType *ot)
|
|||||||
|
|
||||||
/* ******************** (de)select all operator **************** */
|
/* ******************** (de)select all operator **************** */
|
||||||
|
|
||||||
static int select_all_exec(bContext *C, wmOperator *op)
|
static void select_all_perform(bContext *C, int action)
|
||||||
{
|
{
|
||||||
Scene *scene;
|
Scene *scene;
|
||||||
ToolSettings *ts;
|
ToolSettings *ts;
|
||||||
@ -1499,7 +1499,6 @@ static int select_all_exec(bContext *C, wmOperator *op)
|
|||||||
EditFace *efa;
|
EditFace *efa;
|
||||||
Image *ima;
|
Image *ima;
|
||||||
MTFace *tf;
|
MTFace *tf;
|
||||||
int action = RNA_enum_get(op->ptr, "action");
|
|
||||||
|
|
||||||
scene= CTX_data_scene(C);
|
scene= CTX_data_scene(C);
|
||||||
ts= CTX_data_tool_settings(C);
|
ts= CTX_data_tool_settings(C);
|
||||||
@ -1560,6 +1559,15 @@ static int select_all_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int select_all_exec(bContext *C, wmOperator *op)
|
||||||
|
{
|
||||||
|
Object *obedit= CTX_data_edit_object(C);
|
||||||
|
EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
|
||||||
|
int action= RNA_enum_get(op->ptr, "action");
|
||||||
|
|
||||||
|
select_all_perform(C, action);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
|
||||||
|
|
||||||
@ -2275,7 +2283,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
|||||||
MTFace *tface;
|
MTFace *tface;
|
||||||
rcti rect;
|
rcti rect;
|
||||||
rctf rectf;
|
rctf rectf;
|
||||||
int change, pinned, select, faces;
|
int change, pinned, select, faces, extend;
|
||||||
|
|
||||||
/* get rectangle from operator */
|
/* get rectangle from operator */
|
||||||
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
rect.xmin= RNA_int_get(op->ptr, "xmin");
|
||||||
@ -2289,6 +2297,10 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
|||||||
/* figure out what to select/deselect */
|
/* figure out what to select/deselect */
|
||||||
select= (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
|
select= (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
|
||||||
pinned= RNA_boolean_get(op->ptr, "pinned");
|
pinned= RNA_boolean_get(op->ptr, "pinned");
|
||||||
|
extend= RNA_boolean_get(op->ptr, "extend");
|
||||||
|
|
||||||
|
if(!extend)
|
||||||
|
select_all_perform(C, SEL_DESELECT);
|
||||||
|
|
||||||
if(ts->uv_flag & UV_SYNC_SELECTION)
|
if(ts->uv_flag & UV_SYNC_SELECTION)
|
||||||
faces= (ts->selectmode == SCE_SELECT_FACE);
|
faces= (ts->selectmode == SCE_SELECT_FACE);
|
||||||
@ -2411,7 +2423,7 @@ static void UV_OT_select_border(wmOperatorType *ot)
|
|||||||
/* properties */
|
/* properties */
|
||||||
RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only");
|
RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only");
|
||||||
|
|
||||||
WM_operator_properties_gesture_border(ot, FALSE);
|
WM_operator_properties_gesture_border(ot, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** circle select operator **************** */
|
/* ******************** circle select operator **************** */
|
||||||
|
@ -204,9 +204,9 @@ struct MovieCache *IMB_moviecache_create(int keysize, GHashHashFP hashfp, GHashC
|
|||||||
MovieCache *cache;
|
MovieCache *cache;
|
||||||
|
|
||||||
cache= MEM_callocN(sizeof(MovieCache), "MovieCache");
|
cache= MEM_callocN(sizeof(MovieCache), "MovieCache");
|
||||||
cache->keys_pool= BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, 0);
|
cache->keys_pool= BLI_mempool_create(sizeof(MovieCacheKey), 64, 64, FALSE, FALSE);
|
||||||
cache->items_pool= BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, 0);
|
cache->items_pool= BLI_mempool_create(sizeof(MovieCacheItem), 64, 64, FALSE, FALSE);
|
||||||
cache->userkeys_pool= BLI_mempool_create(keysize, 64, 64, 0);
|
cache->userkeys_pool= BLI_mempool_create(keysize, 64, 64, FALSE, FALSE);
|
||||||
cache->hash= BLI_ghash_new(moviecache_hashhash, moviecache_hashcmp, "MovieClip ImBuf cache hash");
|
cache->hash= BLI_ghash_new(moviecache_hashhash, moviecache_hashcmp, "MovieClip ImBuf cache hash");
|
||||||
|
|
||||||
cache->keysize= keysize;
|
cache->keysize= keysize;
|
||||||
|
@ -169,6 +169,7 @@ typedef struct DynamicPaintCanvasSettings {
|
|||||||
#define MOD_DPAINT_WAVEB_DEPTH 0 /* use intersection depth */
|
#define MOD_DPAINT_WAVEB_DEPTH 0 /* use intersection depth */
|
||||||
#define MOD_DPAINT_WAVEB_FORCE 1 /* act as a force on intersection area */
|
#define MOD_DPAINT_WAVEB_FORCE 1 /* act as a force on intersection area */
|
||||||
#define MOD_DPAINT_WAVEB_REFLECT 2 /* obstacle that reflects waves */
|
#define MOD_DPAINT_WAVEB_REFLECT 2 /* obstacle that reflects waves */
|
||||||
|
#define MOD_DPAINT_WAVEB_CHANGE 3 /* use change of intersection depth from previous frame */
|
||||||
|
|
||||||
/* brush ray_dir */
|
/* brush ray_dir */
|
||||||
#define MOD_DPAINT_RAY_CANVAS 0
|
#define MOD_DPAINT_RAY_CANVAS 0
|
||||||
|
@ -623,8 +623,8 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
|
|||||||
RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
|
RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
|
prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_range(prop, 0.01, 3.0);
|
RNA_def_property_range(prop, 0.01, 5.0);
|
||||||
RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
|
RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
|
||||||
RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed");
|
RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
|
prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
|
||||||
@ -696,6 +696,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
{0, NULL, 0, NULL, NULL}};
|
{0, NULL, 0, NULL, NULL}};
|
||||||
|
|
||||||
static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
|
static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
|
||||||
|
{MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
|
||||||
{MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
|
{MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
|
||||||
{MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
|
{MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
|
||||||
{MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
|
{MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
|
||||||
@ -758,7 +759,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
|
|||||||
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
|
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
|
||||||
RNA_def_property_ui_text(prop, "Brush Effect", "");
|
RNA_def_property_ui_text(prop, "Wave Type", "");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
|
prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
|
||||||
RNA_def_property_range(prop, -2.0, 2.0);
|
RNA_def_property_range(prop, -2.0, 2.0);
|
||||||
|
@ -191,6 +191,13 @@ static int rna_Sequence_frame_length_get(PointerRNA *ptr)
|
|||||||
return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
|
return seq_tx_get_final_right(seq, 0)-seq_tx_get_final_left(seq, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rna_Sequence_frame_editable(PointerRNA *ptr)
|
||||||
|
{
|
||||||
|
Sequence *seq = (Sequence*)ptr->data;
|
||||||
|
/* Effect sequences' start frame and length must be readonly! */
|
||||||
|
return (get_sequence_effect_num_inputs(seq->type))? 0: PROP_EDITABLE;
|
||||||
|
}
|
||||||
|
|
||||||
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
|
static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
|
||||||
{
|
{
|
||||||
Sequence *seq= (Sequence*)ptr->data;
|
Sequence *seq= (Sequence*)ptr->data;
|
||||||
@ -1025,8 +1032,9 @@ static void rna_def_sequence(BlenderRNA *brna)
|
|||||||
prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
|
prop= RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_range(prop, 1, MAXFRAME);
|
RNA_def_property_range(prop, 1, MAXFRAME);
|
||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied");
|
RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip after the handles are applied");
|
||||||
RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL);
|
RNA_def_property_int_funcs(prop, "rna_Sequence_frame_length_get", "rna_Sequence_frame_length_set",NULL);
|
||||||
|
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
|
prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_TIME);
|
||||||
@ -1040,6 +1048,7 @@ static void rna_def_sequence(BlenderRNA *brna)
|
|||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_ui_text(prop, "Start Frame", "");
|
RNA_def_property_ui_text(prop, "Start Frame", "");
|
||||||
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
|
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set",NULL); // overlap tests and calc_seq_disp
|
||||||
|
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
|
prop= RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME);
|
||||||
@ -1047,6 +1056,7 @@ static void rna_def_sequence(BlenderRNA *brna)
|
|||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame");
|
RNA_def_property_ui_text(prop, "Start Frame", "Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame");
|
||||||
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
|
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_final_set", NULL); // overlap tests and calc_seq_disp
|
||||||
|
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
|
prop= RNA_def_property(srna, "frame_final_end", PROP_INT, PROP_TIME);
|
||||||
@ -1054,6 +1064,7 @@ static void rna_def_sequence(BlenderRNA *brna)
|
|||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied");
|
RNA_def_property_ui_text(prop, "End Frame", "End frame displayed in the sequence editor after offsets are applied");
|
||||||
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
|
RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_end_frame_final_set", NULL); // overlap tests and calc_seq_disp
|
||||||
|
RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable");
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
|
prop= RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
|
||||||
|
Loading…
Reference in New Issue
Block a user