Merged changes in the trunk up to revision 28772.
This commit is contained in:
+8
-4
@@ -62,7 +62,6 @@ OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
|
||||
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
|
||||
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
||||
OPTION(WITH_DDS "Enable DDS Support" ON)
|
||||
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
|
||||
@@ -79,17 +78,22 @@ OPTION(WITH_LZMA "Enable best LZMA compression, used for pointcache" ON
|
||||
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
|
||||
OPTION(WITH_BUILDINFO "Include extra build details" ON)
|
||||
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
||||
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" ON)
|
||||
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
|
||||
|
||||
IF(APPLE OR WIN32)
|
||||
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
|
||||
ENDIF(APPLE OR WIN32)
|
||||
|
||||
# Unix defaults to OpenMP On
|
||||
# Disable opencollada on non-apple unix because opencollada has no package for debian
|
||||
IF(UNIX AND NOT APPLE)
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
|
||||
ELSE()
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" ON)
|
||||
ENDIF()
|
||||
|
||||
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
|
||||
|
||||
IF (APPLE)
|
||||
OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
|
||||
OPTION(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
|
||||
|
||||
@@ -27,7 +27,7 @@ import bpy as _bpy
|
||||
import os as _os
|
||||
import sys as _sys
|
||||
|
||||
from _bpy import home_paths
|
||||
from _bpy import home_paths, blend_paths
|
||||
|
||||
|
||||
def _test_import(module_name, loaded_modules):
|
||||
@@ -332,3 +332,52 @@ def preset_paths(subdir):
|
||||
'''
|
||||
|
||||
return (_os.path.join(_presets, subdir), )
|
||||
|
||||
|
||||
def smpte_from_seconds(time, fps=None):
|
||||
'''
|
||||
Returns an SMPTE formatted string from the time in seconds: "HH:MM:SS:FF".
|
||||
|
||||
If the fps is not given the current scene is used.
|
||||
'''
|
||||
import math
|
||||
|
||||
if fps is None:
|
||||
fps = _bpy.context.scene.render.fps
|
||||
|
||||
hours = minutes = seconds = frames = 0
|
||||
|
||||
if time < 0:
|
||||
time = -time
|
||||
neg = "-"
|
||||
else:
|
||||
neg = ""
|
||||
|
||||
if time >= 3600.0: # hours
|
||||
hours = int(time / 3600.0)
|
||||
time = time % 3600.0
|
||||
if time >= 60.0: # mins
|
||||
minutes = int(time / 60.0)
|
||||
time = time % 60.0
|
||||
|
||||
seconds = int(time)
|
||||
frames= int(round(math.floor( ((time - seconds) * fps))))
|
||||
|
||||
return "%s%02d:%02d:%02d:%02d" % (neg, hours, minutes, seconds, frames)
|
||||
|
||||
|
||||
def smpte_from_frame(frame, fps=None, fps_base=None):
|
||||
'''
|
||||
Returns an SMPTE formatted string from the frame: "HH:MM:SS:FF".
|
||||
|
||||
If the fps and fps_base are not given the current scene is used.
|
||||
'''
|
||||
|
||||
if fps is None:
|
||||
fps = _bpy.context.scene.render.fps
|
||||
|
||||
if fps_base is None:
|
||||
fps_base = _bpy.context.scene.render.fps_base
|
||||
|
||||
return smpte_from_seconds((frame * fps_base) / fps, fps)
|
||||
|
||||
@@ -253,7 +253,7 @@ class WM_OT_properties_add(bpy.types.Operator):
|
||||
class WM_OT_properties_remove(bpy.types.Operator):
|
||||
'''Internal use (edit a property path)'''
|
||||
bl_idname = "wm.properties_remove"
|
||||
bl_label = "Add Property"
|
||||
bl_label = "Remove Property"
|
||||
|
||||
path = rna_path
|
||||
property = rna_property
|
||||
|
||||
@@ -130,7 +130,7 @@ from bpy.props import *
|
||||
|
||||
|
||||
class BakeAction(bpy.types.Operator):
|
||||
'''Add a torus mesh'''
|
||||
'''Bake animation to an Action'''
|
||||
bl_idname = "nla.bake"
|
||||
bl_label = "Bake Action"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@@ -27,8 +27,8 @@ class AddPresetBase(bpy.types.Operator):
|
||||
subclasses must define
|
||||
- preset_values
|
||||
- preset_subdir '''
|
||||
bl_idname = "render.preset_add"
|
||||
bl_label = "Add Render Preset"
|
||||
bl_idname = "script.add_preset_base"
|
||||
bl_label = "Add a Python Preset"
|
||||
|
||||
name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen=64, default="")
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ from bpy.props import *
|
||||
|
||||
|
||||
class MESH_OT_delete_edgeloop(bpy.types.Operator):
|
||||
'''Export a single object as a stanford PLY with normals,
|
||||
colours and texture coordinates.'''
|
||||
'''Delete an edge loop by merging the faces on each side to a single face loop'''
|
||||
bl_idname = "mesh.delete_edgeloop"
|
||||
bl_label = "Delete Edge Loop"
|
||||
|
||||
|
||||
@@ -269,10 +269,9 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
|
||||
return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
psys = context.particle_system
|
||||
|
||||
point_cache_ui(self, context, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
|
||||
point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS')
|
||||
|
||||
|
||||
class PARTICLE_PT_velocity(ParticleButtonsPanel):
|
||||
|
||||
@@ -142,7 +142,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
|
||||
|
||||
def draw(self, context):
|
||||
md = context.cloth
|
||||
point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0)
|
||||
point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
|
||||
|
||||
|
||||
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
|
||||
|
||||
@@ -22,7 +22,8 @@ narrowui = 180
|
||||
|
||||
import bpy
|
||||
|
||||
def point_cache_ui(self, context, cache, enabled, particles, smoke):
|
||||
#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
|
||||
def point_cache_ui(self, context, cache, enabled, cachetype):
|
||||
layout = self.layout
|
||||
|
||||
wide_ui = context.region.width > narrowui
|
||||
@@ -35,7 +36,7 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
|
||||
col.operator("ptcache.remove", icon='ZOOMOUT', text="")
|
||||
|
||||
row = layout.row()
|
||||
if particles:
|
||||
if cachetype in {'PSYS', 'HAIR'}:
|
||||
row.prop(cache, "external")
|
||||
|
||||
if cache.external:
|
||||
@@ -53,17 +54,17 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
|
||||
split = layout.split()
|
||||
col = split.column(align=True)
|
||||
|
||||
if not particles:
|
||||
if cachetype != 'PSYS':
|
||||
col.enabled = enabled
|
||||
col.prop(cache, "frame_start")
|
||||
col.prop(cache, "frame_end")
|
||||
if not smoke:
|
||||
if cachetype != 'SMOKE':
|
||||
col.prop(cache, "step")
|
||||
|
||||
if wide_ui:
|
||||
col = split.column()
|
||||
|
||||
if not smoke:
|
||||
if cachetype != 'SMOKE':
|
||||
sub = col.column()
|
||||
sub.enabled = enabled
|
||||
sub.prop(cache, "quick_cache")
|
||||
@@ -102,7 +103,6 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
|
||||
col.operator("ptcache.free_bake_all", text="Free All Bakes")
|
||||
col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
|
||||
|
||||
|
||||
def effector_weights_ui(self, context, weights):
|
||||
layout = self.layout
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_low
|
||||
|
||||
point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
|
||||
point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
|
||||
|
||||
|
||||
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
|
||||
@@ -222,7 +222,7 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_high
|
||||
|
||||
point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
|
||||
point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
|
||||
|
||||
|
||||
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
|
||||
|
||||
@@ -97,7 +97,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
|
||||
|
||||
def draw(self, context):
|
||||
md = context.soft_body
|
||||
point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 0, 0)
|
||||
point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
|
||||
|
||||
|
||||
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
|
||||
|
||||
@@ -108,6 +108,9 @@ class NODE_MT_select(bpy.types.Menu):
|
||||
layout.operator("node.select_all")
|
||||
layout.operator("node.select_linked_from")
|
||||
layout.operator("node.select_linked_to")
|
||||
layout.operator("node.select_same_type")
|
||||
layout.operator("node.select_same_type_next")
|
||||
layout.operator("node.select_same_type_prev")
|
||||
|
||||
|
||||
class NODE_MT_node(bpy.types.Menu):
|
||||
|
||||
@@ -274,6 +274,22 @@ class TEXT_MT_edit(bpy.types.Menu):
|
||||
layout.menu("TEXT_MT_edit_to3d")
|
||||
|
||||
|
||||
class TEXT_MT_toolbox(bpy.types.Menu):
|
||||
bl_label = ""
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
|
||||
layout.operator("text.cut")
|
||||
layout.operator("text.copy")
|
||||
layout.operator("text.paste")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("text.run_script")
|
||||
|
||||
|
||||
classes = [
|
||||
TEXT_HT_header,
|
||||
TEXT_PT_properties,
|
||||
@@ -285,7 +301,8 @@ classes = [
|
||||
TEXT_MT_edit_view,
|
||||
TEXT_MT_edit_select,
|
||||
TEXT_MT_edit_markers,
|
||||
TEXT_MT_edit_to3d]
|
||||
TEXT_MT_edit_to3d,
|
||||
TEXT_MT_toolbox]
|
||||
|
||||
|
||||
def register():
|
||||
|
||||
@@ -629,9 +629,10 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
col.prop(v3d, "bone_solid")
|
||||
col.prop(v3d, "bone_pose")
|
||||
col.prop(v3d, "edge_seam")
|
||||
col.prop(v3d, "edge_select")
|
||||
col.prop(v3d, "edge_facesel")
|
||||
col.prop(v3d, "edge_sharp")
|
||||
col.prop(v3d, "edge_crease")
|
||||
#col.prop(v3d, "edge") Doesn't seem to work
|
||||
|
||||
elif theme.theme_area == 'GRAPH_EDITOR':
|
||||
graph = theme.graph_editor
|
||||
@@ -932,18 +933,18 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
col.prop(prefs, "header_text")
|
||||
|
||||
elif theme.theme_area == 'CONSOLE':
|
||||
prefs = theme.console
|
||||
console = theme.console
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "back")
|
||||
col.prop(prefs, "header")
|
||||
col.prop(console, "back")
|
||||
col.prop(console, "header")
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "line_output")
|
||||
col.prop(prefs, "line_input")
|
||||
col.prop(prefs, "line_info")
|
||||
col.prop(prefs, "line_error")
|
||||
col.prop(prefs, "cursor")
|
||||
col.prop(console, "line_output")
|
||||
col.prop(console, "line_input")
|
||||
col.prop(console, "line_info")
|
||||
col.prop(console, "line_error")
|
||||
col.prop(console, "cursor")
|
||||
|
||||
|
||||
class USERPREF_PT_file(bpy.types.Panel):
|
||||
|
||||
@@ -523,7 +523,7 @@ class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
|
||||
layout.operator("curve.select_all", text="Select/Deselect All")
|
||||
layout.operator("curve.select_inverse")
|
||||
layout.operator("curve.select_random")
|
||||
layout.operator("curve.select_every_nth")
|
||||
layout.operator("curve.select_nth", text="Every Nth Number of Points")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -552,7 +552,7 @@ class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
|
||||
layout.operator("curve.select_all", text="Select/Deselect All")
|
||||
layout.operator("curve.select_inverse")
|
||||
layout.operator("curve.select_random")
|
||||
layout.operator("curve.select_every_nth")
|
||||
layout.operator("curve.select_nth", text="Every Nth Number of Points")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ void colorcorrection_do_ibuf(struct ImBuf *ibuf, const char *profile);
|
||||
|
||||
void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
|
||||
void scopes_free(struct Scopes *scopes);
|
||||
void scopes_new(struct Scopes *scopes);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ void smokeModifier_free (struct SmokeModifierData *smd);
|
||||
void smokeModifier_reset(struct SmokeModifierData *smd);
|
||||
void smokeModifier_reset_turbulence(struct SmokeModifierData *smd);
|
||||
void smokeModifier_createType(struct SmokeModifierData *smd);
|
||||
void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData *tsmd);
|
||||
|
||||
long long smoke_get_mem_req(int xres, int yres, int zres, int amplify);
|
||||
|
||||
|
||||
@@ -1805,9 +1805,10 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
|
||||
*/
|
||||
#define EVAL_ANIM_IDS(first, aflag) \
|
||||
for (id= first; id; id= id->next) { \
|
||||
AnimData *adt= BKE_animdata_from_id(id); \
|
||||
if ( (id->us > 1) || (id->us && !(id->flag & LIB_FAKEUSER)) ) \
|
||||
if (ID_REAL_USERS(id) > 0) { \
|
||||
AnimData *adt= BKE_animdata_from_id(id); \
|
||||
BKE_animsys_evaluate_animdata(id, adt, ctime, aflag); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* optimisation:
|
||||
|
||||
@@ -130,6 +130,8 @@ void initglobals(void)
|
||||
G.charstart = 0x0000;
|
||||
G.charmin = 0x0000;
|
||||
G.charmax = 0xffff;
|
||||
|
||||
G.f |= G_SCRIPT_AUTOEXEC;
|
||||
}
|
||||
|
||||
/***/
|
||||
|
||||
@@ -918,7 +918,7 @@ DO_INLINE void save_sample_line(Scopes *scopes, const int idx, const float fx, f
|
||||
scopes->waveform_3[idx + 0] = fx;
|
||||
scopes->waveform_3[idx + 1] = rgb[2];
|
||||
break;
|
||||
case SCOPES_WAVEFRM_LUM:
|
||||
case SCOPES_WAVEFRM_LUMA:
|
||||
scopes->waveform_1[idx + 0] = fx;
|
||||
scopes->waveform_1[idx + 1] = ycc[0];
|
||||
break;
|
||||
@@ -943,7 +943,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
|
||||
unsigned char *rc=NULL;
|
||||
unsigned int *bin_r, *bin_g, *bin_b, *bin_lum;
|
||||
int savedlines, saveline;
|
||||
float rgb[3], ycc[3];
|
||||
float rgb[3], ycc[3], luma;
|
||||
int ycc_mode=-1;
|
||||
|
||||
if (scopes->ok == 1 ) return;
|
||||
@@ -959,7 +959,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
|
||||
case SCOPES_WAVEFRM_RGB:
|
||||
ycc_mode = -1;
|
||||
break;
|
||||
case SCOPES_WAVEFRM_LUM:
|
||||
case SCOPES_WAVEFRM_LUMA:
|
||||
case SCOPES_WAVEFRM_YCC_JPEG:
|
||||
ycc_mode = BLI_YCC_JFIF_0_255;
|
||||
break;
|
||||
@@ -1027,6 +1027,10 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
|
||||
for (c=0; c<3; c++)
|
||||
rgb[c] = rc[c] * INV_255;
|
||||
}
|
||||
|
||||
/* we still need luma for histogram */
|
||||
luma = 0.299*rgb[0] + 0.587*rgb[1] + 0.114 * rgb[2];
|
||||
|
||||
/* check for min max */
|
||||
if(ycc_mode == -1 ) {
|
||||
for (c=0; c<3; c++) {
|
||||
@@ -1046,7 +1050,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management)
|
||||
bin_r[ get_bin_float(rgb[0]) ] += 1;
|
||||
bin_g[ get_bin_float(rgb[1]) ] += 1;
|
||||
bin_b[ get_bin_float(rgb[2]) ] += 1;
|
||||
bin_lum[ get_bin_float(ycc[0]) ] += 1;
|
||||
bin_lum[ get_bin_float(luma) ] += 1;
|
||||
|
||||
/* save sample if needed */
|
||||
if(saveline) {
|
||||
@@ -1110,3 +1114,19 @@ void scopes_free(Scopes *scopes)
|
||||
scopes->vecscope = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void scopes_new(Scopes *scopes)
|
||||
{
|
||||
scopes->accuracy=30.0;
|
||||
scopes->hist.mode=HISTO_MODE_RGB;
|
||||
scopes->wavefrm_alpha=0.3;
|
||||
scopes->vecscope_alpha=0.3;
|
||||
scopes->wavefrm_height= 100;
|
||||
scopes->vecscope_height= 100;
|
||||
scopes->hist.height= 100;
|
||||
scopes->ok= 0;
|
||||
scopes->waveform_1 = NULL;
|
||||
scopes->waveform_2 = NULL;
|
||||
scopes->waveform_3 = NULL;
|
||||
scopes->vecscope = NULL;
|
||||
}
|
||||
|
||||
@@ -1274,6 +1274,40 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
|
||||
*numVerts_r = numVerts;
|
||||
}
|
||||
|
||||
static float (*displist_get_allverts (ListBase *dispbase, int *totvert))[3]
|
||||
{
|
||||
DispList *dl;
|
||||
float (*allverts)[3], *fp;
|
||||
|
||||
*totvert= 0;
|
||||
|
||||
for (dl=dispbase->first; dl; dl=dl->next)
|
||||
*totvert+= (dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr;
|
||||
|
||||
allverts= MEM_mallocN((*totvert)*sizeof(float)*3, "displist_get_allverts allverts");
|
||||
fp= (float*)allverts;
|
||||
for (dl=dispbase->first; dl; dl=dl->next) {
|
||||
int offs= 3 * ((dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr);
|
||||
memcpy(fp, dl->verts, sizeof(float) * offs);
|
||||
fp+= offs;
|
||||
}
|
||||
|
||||
return allverts;
|
||||
}
|
||||
|
||||
static void displist_apply_allverts(ListBase *dispbase, float (*allverts)[3])
|
||||
{
|
||||
DispList *dl;
|
||||
float *fp;
|
||||
|
||||
fp= (float*)allverts;
|
||||
for (dl=dispbase->first; dl; dl=dl->next) {
|
||||
int offs= 3 * ((dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr);
|
||||
memcpy(dl->verts, fp, sizeof(float) * offs);
|
||||
fp+= offs;
|
||||
}
|
||||
}
|
||||
|
||||
static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispbase,
|
||||
DerivedMesh **derivedFinal, int forRender, float (*originalVerts)[3], float (*deformedVerts)[3])
|
||||
{
|
||||
@@ -1281,12 +1315,10 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
|
||||
ModifierData *preTesselatePoint;
|
||||
Curve *cu= ob->data;
|
||||
ListBase *nurb= cu->editnurb?cu->editnurb:&cu->nurb;
|
||||
DispList *dl;
|
||||
int required_mode;
|
||||
int required_mode, totvert;
|
||||
int editmode = (!forRender && cu->editnurb);
|
||||
DerivedMesh *dm= NULL, *ndm;
|
||||
float (*dmDeformedVerts)[3] = NULL;
|
||||
int numVerts;
|
||||
float (*vertCos)[3] = NULL;
|
||||
|
||||
if(forRender) required_mode = eModifierMode_Render;
|
||||
else required_mode = eModifierMode_Realtime;
|
||||
@@ -1311,47 +1343,22 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
|
||||
if ((md->mode & required_mode) != required_mode) continue;
|
||||
if (mti->isDisabled && mti->isDisabled(md, forRender)) continue;
|
||||
|
||||
if(md->type==eModifierType_Curve && !dm) {
|
||||
/* need to put all verts in 1 block for curve deform */
|
||||
float *allverts = NULL, *fp;
|
||||
int totvert= 0;
|
||||
|
||||
for (dl=dispbase->first; dl; dl=dl->next)
|
||||
totvert+= (dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr;
|
||||
|
||||
fp= allverts= MEM_mallocN(totvert*sizeof(float)*3, "temp vert");
|
||||
for (dl=dispbase->first; dl; dl=dl->next) {
|
||||
int offs= 3 * ((dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr);
|
||||
memcpy(fp, dl->verts, sizeof(float) * offs);
|
||||
fp+= offs;
|
||||
}
|
||||
|
||||
mti->deformVerts(md, ob, NULL, (float(*)[3]) allverts, totvert, forRender, editmode);
|
||||
|
||||
if (allverts) {
|
||||
fp= allverts;
|
||||
for (dl=dispbase->first; dl; dl=dl->next) {
|
||||
int offs= 3 * ((dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr);
|
||||
memcpy(dl->verts, fp, sizeof(float) * offs);
|
||||
fp+= offs;
|
||||
}
|
||||
MEM_freeN(allverts);
|
||||
}
|
||||
} else if (mti->type == eModifierTypeType_OnlyDeform ||
|
||||
if (mti->type == eModifierTypeType_OnlyDeform ||
|
||||
(mti->type == eModifierTypeType_DeformOrConstruct && !dm)) {
|
||||
if (dm) {
|
||||
if (!dmDeformedVerts) {
|
||||
numVerts = dm->getNumVerts(dm);
|
||||
dmDeformedVerts =
|
||||
MEM_mallocN(sizeof(*dmDeformedVerts) * numVerts, "dfmv");
|
||||
dm->getVertCos(dm, dmDeformedVerts);
|
||||
if (!vertCos) {
|
||||
totvert = dm->getNumVerts(dm);
|
||||
vertCos = MEM_mallocN(sizeof(*vertCos) * totvert, "dfmv");
|
||||
dm->getVertCos(dm, vertCos);
|
||||
}
|
||||
|
||||
mti->deformVerts(md, ob, dm, dmDeformedVerts, numVerts, forRender, editmode);
|
||||
mti->deformVerts(md, ob, dm, vertCos, totvert, forRender, editmode);
|
||||
} else {
|
||||
for (dl=dispbase->first; dl; dl=dl->next) {
|
||||
mti->deformVerts(md, ob, dm, (float(*)[3]) dl->verts, (dl->type==DL_INDEX3)?dl->nr:dl->parts*dl->nr, forRender, editmode);
|
||||
if (!vertCos) {
|
||||
vertCos= displist_get_allverts(dispbase, &totvert);
|
||||
}
|
||||
|
||||
mti->deformVerts(md, ob, NULL, vertCos, totvert, forRender, editmode);
|
||||
}
|
||||
} else {
|
||||
if (!derivedFinal) {
|
||||
@@ -1362,29 +1369,34 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
|
||||
}
|
||||
|
||||
if (dm) {
|
||||
if (dmDeformedVerts) {
|
||||
if (vertCos) {
|
||||
DerivedMesh *tdm = CDDM_copy(dm);
|
||||
dm->release(dm);
|
||||
dm = tdm;
|
||||
|
||||
CDDM_apply_vert_coords(dm, dmDeformedVerts);
|
||||
CDDM_apply_vert_coords(dm, vertCos);
|
||||
CDDM_calc_normals(dm);
|
||||
}
|
||||
} else {
|
||||
if (vertCos) {
|
||||
displist_apply_allverts(dispbase, vertCos);
|
||||
}
|
||||
|
||||
if (ELEM(ob->type, OB_CURVE, OB_FONT) && (cu->flag & CU_DEFORM_FILL)) {
|
||||
curve_to_filledpoly(cu, nurb, dispbase);
|
||||
}
|
||||
|
||||
dm= CDDM_from_curve_customDB(ob, dispbase);
|
||||
|
||||
if(dmDeformedVerts) {
|
||||
CDDM_apply_vert_coords(dm, dmDeformedVerts);
|
||||
CDDM_calc_normals(dm);
|
||||
}
|
||||
|
||||
CDDM_calc_normals(dm);
|
||||
}
|
||||
|
||||
if (vertCos) {
|
||||
/* Vertex coordinates were applied to necessary data, could free it */
|
||||
MEM_freeN(vertCos);
|
||||
vertCos= NULL;
|
||||
}
|
||||
|
||||
ndm = mti->applyModifier(md, ob, dm, forRender, editmode);
|
||||
|
||||
if (ndm) {
|
||||
@@ -1393,23 +1405,24 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba
|
||||
if (dm && dm != ndm) /* Modifier */
|
||||
dm->release (dm);
|
||||
dm = ndm;
|
||||
|
||||
if (dmDeformedVerts) {
|
||||
MEM_freeN(dmDeformedVerts);
|
||||
dmDeformedVerts= NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dm && dmDeformedVerts) {
|
||||
DerivedMesh *tdm = CDDM_copy(dm);
|
||||
dm->release(dm);
|
||||
dm = tdm;
|
||||
if (vertCos) {
|
||||
if (dm) {
|
||||
DerivedMesh *tdm = CDDM_copy(dm);
|
||||
dm->release(dm);
|
||||
dm = tdm;
|
||||
|
||||
CDDM_apply_vert_coords(dm, dmDeformedVerts);
|
||||
CDDM_calc_normals(dm);
|
||||
MEM_freeN(dmDeformedVerts);
|
||||
CDDM_apply_vert_coords(dm, vertCos);
|
||||
CDDM_calc_normals(dm);
|
||||
MEM_freeN(vertCos);
|
||||
} else {
|
||||
displist_apply_allverts(dispbase, vertCos);
|
||||
MEM_freeN(vertCos);
|
||||
vertCos= NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (derivedFinal) {
|
||||
|
||||
@@ -264,6 +264,38 @@ int multiresModifier_reshapeFromDeformMod(MultiresModifierData *mmd, Object *ob,
|
||||
return result;
|
||||
}
|
||||
|
||||
static void multires_set_tot_mdisps(Mesh *me, int lvl)
|
||||
{
|
||||
MDisps *mdisps= CustomData_get_layer(&me->fdata, CD_MDISPS);
|
||||
int i;
|
||||
|
||||
if(mdisps) {
|
||||
for(i = 0; i < me->totface; i++) {
|
||||
if(mdisps[i].totdisp == 0) {
|
||||
int nvert = (me->mface[i].v4)? 4: 3;
|
||||
mdisps[i].totdisp = multires_grid_tot[lvl]*nvert;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void multires_reallocate_mdisps(Mesh *me, MDisps *mdisps, int lvl)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* reallocate displacements to be filled in */
|
||||
for(i = 0; i < me->totface; ++i) {
|
||||
int nvert = (me->mface[i].v4)? 4: 3;
|
||||
int totdisp = multires_grid_tot[lvl]*nvert;
|
||||
float (*disps)[3] = MEM_callocN(sizeof(float) * 3 * totdisp, "multires disps");
|
||||
|
||||
if(mdisps[i].disps)
|
||||
MEM_freeN(mdisps[i].disps);
|
||||
|
||||
mdisps[i].disps = disps;
|
||||
mdisps[i].totdisp = totdisp;
|
||||
}
|
||||
}
|
||||
|
||||
static void column_vectors_to_mat3(float mat[][3], float v1[3], float v2[3], float v3[3])
|
||||
{
|
||||
@@ -320,6 +352,7 @@ void multiresModifier_del_levels(MultiresModifierData *mmd, Object *ob, int dire
|
||||
int levels = mmd->totlvl - lvl;
|
||||
MDisps *mdisps;
|
||||
|
||||
multires_set_tot_mdisps(me, mmd->totlvl);
|
||||
CustomData_external_read(&me->fdata, &me->id, CD_MASK_MDISPS, me->totface);
|
||||
mdisps= CustomData_get_layer(&me->fdata, CD_MDISPS);
|
||||
|
||||
@@ -393,24 +426,6 @@ static DerivedMesh *subsurf_dm_create_local(Object *ob, DerivedMesh *dm, int lvl
|
||||
return subsurf_make_derived_from_derived(dm, &smd, 0, NULL, 0, 0);
|
||||
}
|
||||
|
||||
static void multires_reallocate_mdisps(Mesh *me, MDisps *mdisps, int lvl)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* reallocate displacements to be filled in */
|
||||
for(i = 0; i < me->totface; ++i) {
|
||||
int nvert = (me->mface[i].v4)? 4: 3;
|
||||
int totdisp = multires_grid_tot[lvl]*nvert;
|
||||
float (*disps)[3] = MEM_callocN(sizeof(float) * 3 * totdisp, "multires disps");
|
||||
|
||||
if(mdisps[i].disps)
|
||||
MEM_freeN(mdisps[i].disps);
|
||||
|
||||
mdisps[i].disps = disps;
|
||||
mdisps[i].totdisp = totdisp;
|
||||
}
|
||||
}
|
||||
|
||||
void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int updateblock, int simple)
|
||||
{
|
||||
Mesh *me = ob->data;
|
||||
@@ -615,6 +630,7 @@ static void multiresModifier_update(DerivedMesh *dm)
|
||||
ob = ccgdm->multires.ob;
|
||||
me = ccgdm->multires.ob->data;
|
||||
mmd = ccgdm->multires.mmd;
|
||||
multires_set_tot_mdisps(me, mmd->totlvl);
|
||||
CustomData_external_read(&me->fdata, &me->id, CD_MASK_MDISPS, me->totface);
|
||||
mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS);
|
||||
|
||||
@@ -750,6 +766,7 @@ DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int loca
|
||||
memcpy(subGridData[i], gridData[i], sizeof(DMGridData)*gridSize*gridSize);
|
||||
}
|
||||
|
||||
multires_set_tot_mdisps(me, mmd->totlvl);
|
||||
CustomData_external_read(&me->fdata, &me->id, CD_MASK_MDISPS, me->totface);
|
||||
multiresModifier_disp_run(result, ob->data, 0, 0, subGridData, mmd->totlvl);
|
||||
|
||||
|
||||
@@ -617,6 +617,10 @@ static int binary_search_distribution(float *sum, int n, float value)
|
||||
return low;
|
||||
}
|
||||
|
||||
/* the max number if calls to rng_* funcs within psys_thread_distribute_particle
|
||||
* be sure to keep up to date if this changes */
|
||||
#define PSYS_RND_DIST_SKIP 2
|
||||
|
||||
/* note: this function must be thread safe, for from == PART_FROM_CHILD */
|
||||
#define ONLY_WORKING_WITH_PA_VERTS 0
|
||||
static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData *pa, ChildParticle *cpa, int p)
|
||||
@@ -632,6 +636,7 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
|
||||
int cfrom= ctx->cfrom;
|
||||
int distr= ctx->distr;
|
||||
int i, intersect, tot;
|
||||
int rng_skip_tot= PSYS_RND_DIST_SKIP; /* count how many rng_* calls wont need skipping */
|
||||
|
||||
if(from == PART_FROM_VERT) {
|
||||
/* TODO_PARTICLE - use original index */
|
||||
@@ -669,6 +674,8 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
|
||||
case PART_DISTR_RAND:
|
||||
randu= rng_getFloat(thread->rng);
|
||||
randv= rng_getFloat(thread->rng);
|
||||
rng_skip_tot -= 2;
|
||||
|
||||
psys_uv_to_w(randu, randv, mface->v4, pa->fuv);
|
||||
break;
|
||||
}
|
||||
@@ -751,6 +758,8 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
|
||||
|
||||
randu= rng_getFloat(thread->rng);
|
||||
randv= rng_getFloat(thread->rng);
|
||||
rng_skip_tot -= 2;
|
||||
|
||||
psys_uv_to_w(randu, randv, mf->v4, cpa->fuv);
|
||||
|
||||
cpa->num = ctx->index[p];
|
||||
@@ -859,6 +868,9 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
|
||||
cpa->parent=cpa->pa[0];
|
||||
}
|
||||
}
|
||||
|
||||
if(rng_skip_tot > 0) /* should never be below zero */
|
||||
rng_skip(thread->rng, rng_skip_tot);
|
||||
}
|
||||
|
||||
static void *exec_distribution(void *data)
|
||||
@@ -875,12 +887,12 @@ static void *exec_distribution(void *data)
|
||||
|
||||
for(p=0; p<totpart; p++, cpa++) {
|
||||
if(thread->ctx->skip) /* simplification skip */
|
||||
rng_skip(thread->rng, 5*thread->ctx->skip[p]);
|
||||
rng_skip(thread->rng, PSYS_RND_DIST_SKIP * thread->ctx->skip[p]);
|
||||
|
||||
if((p+thread->num) % thread->tot == 0)
|
||||
psys_thread_distribute_particle(thread, NULL, cpa, p);
|
||||
else /* thread skip */
|
||||
rng_skip(thread->rng, 5);
|
||||
rng_skip(thread->rng, PSYS_RND_DIST_SKIP);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -812,23 +812,27 @@ static int ptcache_compress_read(PTCacheFile *pf, unsigned char *result, unsigne
|
||||
ptcache_file_read(pf, &compressed, 1, sizeof(unsigned char));
|
||||
if(compressed) {
|
||||
ptcache_file_read(pf, &in_len, 1, sizeof(unsigned int));
|
||||
in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer");
|
||||
ptcache_file_read(pf, in, in_len, sizeof(unsigned char));
|
||||
|
||||
if(in_len==0) {
|
||||
/* do nothing */
|
||||
}
|
||||
else {
|
||||
in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer");
|
||||
ptcache_file_read(pf, in, in_len, sizeof(unsigned char));
|
||||
#ifdef WITH_LZO
|
||||
if(compressed == 1)
|
||||
r = lzo1x_decompress(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL);
|
||||
if(compressed == 1)
|
||||
r = lzo1x_decompress_safe(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL);
|
||||
#endif
|
||||
#ifdef WITH_LZMA
|
||||
if(compressed == 2)
|
||||
{
|
||||
size_t leni = in_len, leno = out_len;
|
||||
ptcache_file_read(pf, &sizeOfIt, 1, sizeof(unsigned int));
|
||||
ptcache_file_read(pf, props, sizeOfIt, sizeof(unsigned char));
|
||||
r = LzmaUncompress(result, &leno, in, &leni, props, sizeOfIt);
|
||||
}
|
||||
if(compressed == 2)
|
||||
{
|
||||
size_t leni = in_len, leno = out_len;
|
||||
ptcache_file_read(pf, &sizeOfIt, 1, sizeof(unsigned int));
|
||||
ptcache_file_read(pf, props, sizeOfIt, sizeof(unsigned char));
|
||||
r = LzmaUncompress(result, &leno, in, &leni, props, sizeOfIt);
|
||||
}
|
||||
#endif
|
||||
MEM_freeN(in);
|
||||
MEM_freeN(in);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ptcache_file_read(pf, result, len, sizeof(unsigned char));
|
||||
@@ -1708,14 +1712,13 @@ int BKE_ptcache_write_cache(PTCacheID *pid, int cfra)
|
||||
int totpoint = pid->totpoint(pid->calldata, cfra);
|
||||
int add = 0, overwrite = 0;
|
||||
|
||||
if(totpoint == 0 || cfra < 0
|
||||
|| (cfra ? pid->data_types == 0 : pid->info_types == 0))
|
||||
if(totpoint == 0 || (cfra ? pid->data_types == 0 : pid->info_types == 0))
|
||||
return 0;
|
||||
|
||||
if(cache->flag & PTCACHE_DISK_CACHE) {
|
||||
int ofra=0, efra = cache->endframe;
|
||||
|
||||
if(cfra==0)
|
||||
if(cfra==0 && cache->startframe > 0)
|
||||
add = 1;
|
||||
/* allways start from scratch on the first frame */
|
||||
else if(cfra == cache->startframe) {
|
||||
@@ -1927,7 +1930,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
|
||||
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
|
||||
if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */
|
||||
if (mode == PTCACHE_CLEAR_ALL) {
|
||||
pid->cache->last_exact = 0;
|
||||
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
|
||||
BLI_join_dirfile(path_full, path, de->d_name);
|
||||
BLI_delete(path_full, 0, 0);
|
||||
} else {
|
||||
@@ -1959,7 +1962,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra)
|
||||
pm= pid->cache->mem_cache.first;
|
||||
|
||||
if(mode == PTCACHE_CLEAR_ALL) {
|
||||
pid->cache->last_exact = 0;
|
||||
/*we want startframe if the cache starts before zero*/
|
||||
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
|
||||
for(; pm; pm=pm->next)
|
||||
ptcache_free_data(pm);
|
||||
BLI_freelistN(&pid->cache->mem_cache);
|
||||
@@ -2876,6 +2880,6 @@ void BKE_ptcache_invalidate(PointCache *cache)
|
||||
{
|
||||
cache->flag &= ~PTCACHE_SIMULATION_VALID;
|
||||
cache->simframe = 0;
|
||||
cache->last_exact = 0;
|
||||
cache->last_exact = MIN2(cache->startframe, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -753,6 +753,41 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
|
||||
}
|
||||
}
|
||||
|
||||
void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData *tsmd)
|
||||
{
|
||||
tsmd->type = smd->type;
|
||||
tsmd->time = smd->time;
|
||||
|
||||
smokeModifier_createType(tsmd);
|
||||
|
||||
if (tsmd->domain) {
|
||||
tsmd->domain->maxres = smd->domain->maxres;
|
||||
tsmd->domain->amplify = smd->domain->amplify;
|
||||
tsmd->domain->omega = smd->domain->omega;
|
||||
tsmd->domain->alpha = smd->domain->alpha;
|
||||
tsmd->domain->beta = smd->domain->beta;
|
||||
tsmd->domain->flags = smd->domain->flags;
|
||||
tsmd->domain->strength = smd->domain->strength;
|
||||
tsmd->domain->noise = smd->domain->noise;
|
||||
tsmd->domain->diss_speed = smd->domain->diss_speed;
|
||||
tsmd->domain->viewsettings = smd->domain->viewsettings;
|
||||
tsmd->domain->fluid_group = smd->domain->fluid_group;
|
||||
tsmd->domain->coll_group = smd->domain->coll_group;
|
||||
|
||||
MEM_freeN(tsmd->domain->effector_weights);
|
||||
tsmd->domain->effector_weights = MEM_dupallocN(smd->domain->effector_weights);
|
||||
} else if (tsmd->flow) {
|
||||
tsmd->flow->density = smd->flow->density;
|
||||
tsmd->flow->temp = smd->flow->temp;
|
||||
tsmd->flow->psys = smd->flow->psys;
|
||||
tsmd->flow->type = smd->flow->type;
|
||||
} else if (tsmd->coll) {
|
||||
;
|
||||
/* leave it as initialised, collision settings is mostly caches */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// forward decleration
|
||||
static void smoke_calc_transparency(float *result, float *input, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb, float correct);
|
||||
static float calc_voxel_transp(float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
/* Based on ghash, difference is ghash is not a fixed size,
|
||||
* so for BPath we dont need to malloc */
|
||||
|
||||
#ifndef BLI_BPATH_H
|
||||
#define BLI_BPATH_H
|
||||
|
||||
struct BPathIteratorSeqData {
|
||||
int totseq;
|
||||
int seq;
|
||||
@@ -72,3 +75,5 @@ void checkMissingFiles(char *basepath, ReportList *reports);
|
||||
void makeFilesRelative(char *basepath, ReportList *reports);
|
||||
void makeFilesAbsolute(char *basepath, ReportList *reports);
|
||||
void findMissingFiles(char *basepath, char *str);
|
||||
|
||||
#endif // BLI_BPATH_H
|
||||
|
||||
@@ -132,6 +132,7 @@ void BLI_bpathIterator_getPathExpanded( struct BPathIterator *bpi, char *path_ex
|
||||
} else { /* local data, use the blend files path */
|
||||
BLI_path_abs(path_expanded, bpi->base_path);
|
||||
}
|
||||
BLI_cleanup_file(NULL, path_expanded);
|
||||
}
|
||||
char* BLI_bpathIterator_getLib( struct BPathIterator *bpi) {
|
||||
return bpi->lib;
|
||||
|
||||
@@ -10846,13 +10846,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
for (sl= sa->spacedata.first; sl; sl= sl->next) {
|
||||
if(sl->spacetype==SPACE_IMAGE) {
|
||||
SpaceImage *sima = (SpaceImage *)sl;
|
||||
sima->scopes.accuracy = 30.0;
|
||||
sima->scopes.hist.mode=HISTO_MODE_RGB;
|
||||
sima->scopes.wavefrm_alpha=0.3;
|
||||
sima->scopes.vecscope_alpha=0.3;
|
||||
sima->scopes.wavefrm_height= 100;
|
||||
sima->scopes.vecscope_height= 100;
|
||||
sima->scopes.hist.height= 100;
|
||||
scopes_new(&sima->scopes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10861,6 +10855,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
|
||||
/* put 2.50 compatibility code here until next subversion bump */
|
||||
{
|
||||
bScreen *sc;
|
||||
|
||||
for (sc= main->screen.first; sc; sc= sc->id.next) {
|
||||
ScrArea *sa;
|
||||
for (sa= sc->areabase.first; sa; sa= sa->next) {
|
||||
SpaceLink *sl;
|
||||
for (sl= sa->spacedata.first; sl; sl= sl->next) {
|
||||
if (sl->spacetype == SPACE_NODE) {
|
||||
SpaceNode *snode;
|
||||
|
||||
snode= (SpaceNode *)sl;
|
||||
if (snode->v2d.minzoom > 0.09f)
|
||||
snode->v2d.minzoom= 0.09f;
|
||||
if (snode->v2d.maxzoom < 2.31f)
|
||||
snode->v2d.maxzoom= 2.31f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
do_version_mdef_250(fd, lib, main);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,6 @@ CPPFLAGS += -I../makesdna -I../blenlib -I../blenkernel -I../editors/include
|
||||
CPPFLAGS += -I../windowmanager -I../makesrna
|
||||
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
|
||||
CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADABaseUtils
|
||||
CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADAFrameWork
|
||||
CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADAFramework
|
||||
CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADAStreamWriter
|
||||
CPPFLAGS += -I$(BF_OPENCOLLADA)/include/COLLADASaxFrameworkLoader
|
||||
|
||||
@@ -2004,6 +2004,7 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf)
|
||||
/* delete */
|
||||
WM_keymap_add_item(keymap, "ANIM_OT_channels_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ANIM_OT_channels_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ANIM_OT_channels_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
/* settings */
|
||||
WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
@@ -1707,7 +1707,7 @@ static int animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data,
|
||||
|
||||
/* add NLA tracks - only if expanded or so */
|
||||
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY))
|
||||
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
|
||||
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)key);
|
||||
},
|
||||
{ /* drivers */
|
||||
/* include shapekey-expand widget? */
|
||||
|
||||
@@ -1201,6 +1201,7 @@ void ED_marker_keymap(wmKeyConfig *keyconf)
|
||||
WM_keymap_verify_item(keymap, "MARKER_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_verify_item(keymap, "MARKER_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_verify_item(keymap, "MARKER_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_verify_item(keymap, "MARKER_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "MARKER_OT_move", GKEY, KM_PRESS, 0, 0);
|
||||
#ifdef DURIAN_CAMERA_SWITCH
|
||||
|
||||
@@ -164,6 +164,10 @@ static int remove_active_keyingset_exec (bContext *C, wmOperator *op)
|
||||
BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else if (scene->active_keyingset < 0) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot remove built in Keying Set");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else
|
||||
ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
|
||||
|
||||
@@ -315,6 +319,10 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op)
|
||||
|
||||
scene->active_keyingset= BLI_countlist(&scene->keyingsets);
|
||||
}
|
||||
else if (scene->active_keyingset < 0) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot add property to built in Keying Set");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else
|
||||
ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
|
||||
|
||||
@@ -396,6 +404,10 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op)
|
||||
BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove property from");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else if (scene->active_keyingset < 0) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot remove property from built in Keying Set");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else
|
||||
ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1);
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
|
||||
/* Armature -> Etch-A-Ton ------------------------ */
|
||||
WM_keymap_add_item(keymap, "SKETCH_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SKETCH_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SKETCH_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SKETCH_OT_finish_stroke", SELECTMOUSE, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SKETCH_OT_cancel_stroke", ESCKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SKETCH_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
|
||||
@@ -233,6 +234,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "ARMATURE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ARMATURE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ARMATURE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ARMATURE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_forked", EKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
@@ -96,7 +96,7 @@ void CURVE_OT_select_previous(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_more(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_less(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_random(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_every_nth(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_nth(struct wmOperatorType *ot);
|
||||
|
||||
void CURVE_OT_switch_direction(struct wmOperatorType *ot);
|
||||
void CURVE_OT_subdivide(struct wmOperatorType *ot);
|
||||
|
||||
@@ -111,7 +111,7 @@ void ED_operatortypes_curve(void)
|
||||
WM_operatortype_append(CURVE_OT_select_more);
|
||||
WM_operatortype_append(CURVE_OT_select_less);
|
||||
WM_operatortype_append(CURVE_OT_select_random);
|
||||
WM_operatortype_append(CURVE_OT_select_every_nth);
|
||||
WM_operatortype_append(CURVE_OT_select_nth);
|
||||
|
||||
WM_operatortype_append(CURVE_OT_switch_direction);
|
||||
WM_operatortype_append(CURVE_OT_subdivide);
|
||||
@@ -197,6 +197,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_cyclic_toggle", CKEY, KM_PRESS, KM_ALT, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_tilt_clear", TKEY, KM_PRESS, KM_ALT, 0);
|
||||
WM_keymap_add_item(keymap, "TRANSFORM_OT_tilt", TKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
@@ -4272,37 +4272,128 @@ void CURVE_OT_select_random(wmOperatorType *ot)
|
||||
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first.");
|
||||
}
|
||||
|
||||
/********************** select every nth *********************/
|
||||
/********************* every nth number of point *******************/
|
||||
|
||||
static int select_every_nth_exec(bContext *C, wmOperator *op)
|
||||
static int point_on_nurb(Nurb *nu, void *point)
|
||||
{
|
||||
if (nu->bezt) {
|
||||
BezTriple *bezt= (BezTriple*)point;
|
||||
return bezt >= nu->bezt && bezt < nu->bezt + nu->pntsu;
|
||||
} else {
|
||||
BPoint *bp= (BPoint*)point;
|
||||
return bp >= nu->bp && bp < nu->bp + nu->pntsu * nu->pntsv;
|
||||
}
|
||||
}
|
||||
|
||||
static void select_nth_bezt(Nurb *nu, BezTriple *bezt, int nth)
|
||||
{
|
||||
int a, start;
|
||||
|
||||
start= bezt - nu->bezt;
|
||||
a= nu->pntsu;
|
||||
bezt= nu->bezt + a - 1;
|
||||
|
||||
while (a--) {
|
||||
if (abs(start - a) % nth) {
|
||||
select_beztriple(bezt, DESELECT, 1, HIDDEN);
|
||||
}
|
||||
|
||||
bezt--;
|
||||
}
|
||||
}
|
||||
|
||||
static void select_nth_bp(Nurb *nu, BPoint *bp, int nth)
|
||||
{
|
||||
int a, startrow, startpnt;
|
||||
int dist, row, pnt;
|
||||
|
||||
startrow= (bp - nu->bp) / nu->pntsu;
|
||||
startpnt= (bp - nu->bp) % nu->pntsu;
|
||||
|
||||
a= nu->pntsu * nu->pntsv;
|
||||
bp= nu->bp + a - 1;
|
||||
row = nu->pntsv - 1;
|
||||
pnt = nu->pntsu - 1;
|
||||
|
||||
while (a--) {
|
||||
dist= abs(pnt - startpnt) + abs(row - startrow);
|
||||
if (dist % nth) {
|
||||
select_bpoint(bp, DESELECT, 1, HIDDEN);
|
||||
}
|
||||
|
||||
pnt--;
|
||||
if (pnt < 0) {
|
||||
pnt= nu->pntsu - 1;
|
||||
row--;
|
||||
}
|
||||
|
||||
bp--;
|
||||
}
|
||||
}
|
||||
|
||||
int CU_select_nth(Object *obedit, int nth)
|
||||
{
|
||||
Curve *cu= (Curve*)obedit->data;
|
||||
ListBase *nubase= cu->editnurb;
|
||||
Nurb *nu;
|
||||
int ok=0;
|
||||
|
||||
/* Search nurb to which selected point belongs to */
|
||||
nu= nubase->first;
|
||||
while (nu) {
|
||||
if (point_on_nurb(nu, cu->lastsel)) {
|
||||
ok= 1;
|
||||
break;
|
||||
}
|
||||
nu= nu->next;
|
||||
}
|
||||
|
||||
if (!ok) return 0;
|
||||
|
||||
if (nu->bezt) {
|
||||
select_nth_bezt(nu, cu->lastsel, nth);
|
||||
} else {
|
||||
select_nth_bp(nu, cu->lastsel, nth);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int select_nth_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
ListBase *editnurb= curve_get_editcurve(obedit);
|
||||
int n= RNA_int_get(op->ptr, "n");
|
||||
|
||||
select_adjacent_cp(editnurb, n, 1, SELECT);
|
||||
select_adjacent_cp(editnurb, -n, 1, SELECT);
|
||||
|
||||
int nth= RNA_int_get(op->ptr, "nth");
|
||||
|
||||
if (!CU_select_nth(obedit, nth)) {
|
||||
if (obedit->type == OB_SURF) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Surface hasn't got active point");
|
||||
} else {
|
||||
BKE_report(op->reports, RPT_ERROR, "Curve hasn't got active point");
|
||||
}
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void CURVE_OT_select_every_nth(wmOperatorType *ot)
|
||||
void CURVE_OT_select_nth(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Select Every Nth";
|
||||
ot->idname= "CURVE_OT_select_every_nth";
|
||||
|
||||
ot->name= "Select Nth";
|
||||
ot->description= "";
|
||||
ot->idname= "CURVE_OT_select_nth";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= select_every_nth_exec;
|
||||
ot->exec= select_nth_exec;
|
||||
ot->poll= ED_operator_editsurfcurve;
|
||||
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
RNA_def_int(ot->srna, "n", 2, 2, INT_MAX, "N", "Select every Nth element", 2, 25);
|
||||
RNA_def_int(ot->srna, "nth", 2, 2, 100, "Nth Selection", "", 1, INT_MAX);
|
||||
}
|
||||
|
||||
/********************** add duplicate operator *********************/
|
||||
|
||||
+12071
-10784
File diff suppressed because it is too large
Load Diff
@@ -71,5 +71,7 @@ void free_editText (struct Object *obedit);
|
||||
|
||||
void ED_text_to_object(struct bContext *C, struct Text *text, int split_lines);
|
||||
|
||||
int CU_select_nth(struct Object *obedit, int nth);
|
||||
|
||||
#endif /* ED_CURVE_H */
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ void UI_view2d_view_restore(const struct bContext *C);
|
||||
View2DGrid *UI_view2d_grid_calc(const struct bContext *C, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy);
|
||||
void UI_view2d_grid_draw(const struct bContext *C, struct View2D *v2d, View2DGrid *grid, int flag);
|
||||
void UI_view2d_constant_grid_draw(const struct bContext *C, struct View2D *v2d);
|
||||
void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy);
|
||||
void UI_view2d_grid_free(View2DGrid *grid);
|
||||
|
||||
/* scrollbar drawing */
|
||||
|
||||
@@ -861,7 +861,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *r
|
||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
/* 3 vertical separation */
|
||||
if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUM) {
|
||||
if (scopes->wavefrm_mode!= SCOPES_WAVEFRM_LUMA) {
|
||||
for (i=1; i<3; i++) {
|
||||
fdrawline(rect.xmin+i*w3, rect.ymin, rect.xmin+i*w3, rect.ymax);
|
||||
}
|
||||
@@ -878,78 +878,82 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *r
|
||||
fdrawline(rect.xmin+w3, yofs+h*240.0f/255.0f, rect.xmax+1, yofs+h*240.0f/255.0f);
|
||||
}
|
||||
/* 7.5 IRE black point level for NTSC */
|
||||
if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUM)
|
||||
if (scopes->wavefrm_mode== SCOPES_WAVEFRM_LUMA)
|
||||
fdrawline(rect.xmin, yofs+h*0.075f, rect.xmax+1, yofs+h*0.075f);
|
||||
|
||||
/* LUMA (1 channel) */
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
glColor3f(alpha, alpha, alpha);
|
||||
if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUM){
|
||||
|
||||
if (scopes->ok && scopes->waveform_1 != NULL) {
|
||||
|
||||
/* LUMA (1 channel) */
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
|
||||
glPushMatrix();
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
glTranslatef(rect.xmin, yofs, 0.f);
|
||||
glScalef(w, h, 0.f);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glPopMatrix();
|
||||
glColor3f(alpha, alpha, alpha);
|
||||
if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA){
|
||||
|
||||
/* min max */
|
||||
glColor3f(.5f, .5f, .5f);
|
||||
min= yofs+scopes->minmax[0][0]*h;
|
||||
max= yofs+scopes->minmax[0][1]*h;
|
||||
CLAMP(min, rect.ymin, rect.ymax);
|
||||
CLAMP(max, rect.ymin, rect.ymax);
|
||||
fdrawline(rect.xmax-3,min,rect.xmax-3,max);
|
||||
}
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
|
||||
glPushMatrix();
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
glTranslatef(rect.xmin, yofs, 0.f);
|
||||
glScalef(w, h, 0.f);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glPopMatrix();
|
||||
|
||||
/* RGB / YCC (3 channels) */
|
||||
else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
|
||||
int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
|
||||
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
|
||||
glPushMatrix();
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
glTranslatef(rect.xmin, yofs, 0.f);
|
||||
glScalef(w3, h, 0.f);
|
||||
|
||||
glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glTranslatef(1.f, 0.f, 0.f);
|
||||
glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glTranslatef(1.f, 0.f, 0.f);
|
||||
glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glPopMatrix();
|
||||
|
||||
|
||||
/* min max */
|
||||
for (c=0; c<3; c++) {
|
||||
if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
|
||||
glColor3f(colors[c][0]*0.75, colors[c][1]*0.75, colors[c][2]*0.75);
|
||||
else
|
||||
glColor3f(colorsycc[c][0]*0.75, colorsycc[c][1]*0.75, colorsycc[c][2]*0.75);
|
||||
min= yofs+scopes->minmax[c][0]*h;
|
||||
max= yofs+scopes->minmax[c][1]*h;
|
||||
/* min max */
|
||||
glColor3f(.5f, .5f, .5f);
|
||||
min= yofs+scopes->minmax[0][0]*h;
|
||||
max= yofs+scopes->minmax[0][1]*h;
|
||||
CLAMP(min, rect.ymin, rect.ymax);
|
||||
CLAMP(max, rect.ymin, rect.ymax);
|
||||
fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
|
||||
fdrawline(rect.xmax-3,min,rect.xmax-3,max);
|
||||
}
|
||||
|
||||
/* RGB / YCC (3 channels) */
|
||||
else if (ELEM4(scopes->wavefrm_mode, SCOPES_WAVEFRM_RGB, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, SCOPES_WAVEFRM_YCC_JPEG)) {
|
||||
int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
|
||||
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
|
||||
glPushMatrix();
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
glTranslatef(rect.xmin, yofs, 0.f);
|
||||
glScalef(w3, h, 0.f);
|
||||
|
||||
glColor3fv((rgb)?colors_alpha[0]:colorsycc_alpha[0]);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glTranslatef(1.f, 0.f, 0.f);
|
||||
glColor3fv((rgb)?colors_alpha[1]:colorsycc_alpha[1]);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glTranslatef(1.f, 0.f, 0.f);
|
||||
glColor3fv((rgb)?colors_alpha[2]:colorsycc_alpha[2]);
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glPopMatrix();
|
||||
|
||||
|
||||
/* min max */
|
||||
for (c=0; c<3; c++) {
|
||||
if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB)
|
||||
glColor3f(colors[c][0]*0.75, colors[c][1]*0.75, colors[c][2]*0.75);
|
||||
else
|
||||
glColor3f(colorsycc[c][0]*0.75, colorsycc[c][1]*0.75, colorsycc[c][2]*0.75);
|
||||
min= yofs+scopes->minmax[c][0]*h;
|
||||
max= yofs+scopes->minmax[c][1]*h;
|
||||
CLAMP(min, rect.ymin, rect.ymax);
|
||||
CLAMP(max, rect.ymin, rect.ymax);
|
||||
fdrawline(rect.xmin+w+2+c*2,min,rect.xmin+w+2+c*2,max);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* outline, scale gripper */
|
||||
@@ -1030,8 +1034,6 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti
|
||||
float colors[6][3]={{.75,0,0},{.75,.75,0},{0,.75,0},{0,.75,.75},{0,0,.75},{.75,0,.75}};
|
||||
GLint scissor[4];
|
||||
|
||||
if (scopes==NULL) return;
|
||||
|
||||
rect.xmin = (float)recti->xmin+1;
|
||||
rect.xmax = (float)recti->xmax-1;
|
||||
rect.ymin = (float)recti->ymin+SCOPE_RESIZE_PAD+2;
|
||||
@@ -1079,25 +1081,24 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti
|
||||
for(i=0; i<6; i++)
|
||||
vectorscope_draw_target(centerx, centery, diam, colors[i][0], colors[i][1], colors[i][2]);
|
||||
|
||||
/* pixel point cloud */
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
glColor4f(alpha, alpha, alpha, alpha);
|
||||
if (scopes->ok && scopes->vecscope != NULL) {
|
||||
/* pixel point cloud */
|
||||
glBlendFunc(GL_ONE,GL_ONE);
|
||||
glColor3f(alpha, alpha, alpha);
|
||||
|
||||
glPushMatrix();
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glPushMatrix();
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
glTranslatef(centerx, centery, 0.f);
|
||||
glScalef(diam, diam, 0.f);
|
||||
glTranslatef(centerx, centery, 0.f);
|
||||
glScalef(diam, diam, 0.f);
|
||||
|
||||
/*apparently this can sometimes be NULL? - joeedh*/
|
||||
if (scopes) {
|
||||
glVertexPointer(2, GL_FLOAT, 0, scopes->vecscope);
|
||||
glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glPopMatrix();
|
||||
|
||||
/* outline, scale gripper */
|
||||
draw_scope_end(&rect, scissor);
|
||||
|
||||
|
||||
@@ -1314,6 +1314,13 @@ void UI_view2d_constant_grid_draw(const bContext *C, View2D *v2d)
|
||||
glEnd();
|
||||
}
|
||||
|
||||
/* the price we pay for not exposting structs :( */
|
||||
void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy)
|
||||
{
|
||||
*r_dx= grid->dx;
|
||||
*r_dy= grid->dy;
|
||||
}
|
||||
|
||||
/* free temporary memory used for drawing grid */
|
||||
void UI_view2d_grid_free(View2DGrid *grid)
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_displist.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_image.h"
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_mesh.h"
|
||||
@@ -312,17 +313,33 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Base *base= ED_view3d_give_base_under_cursor(C, event->mval);
|
||||
Image *ima;
|
||||
Image *ima= NULL;
|
||||
Mesh *me;
|
||||
Object *obedit;
|
||||
int exitmode= 0;
|
||||
char name[32];
|
||||
|
||||
/* Check context */
|
||||
if(base==NULL || base->object->type!=OB_MESH) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Not an Object or Mesh");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* check input variables */
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
ima= (Image *)find_id("IM", name);
|
||||
if(base==NULL || base->object->type!=OB_MESH || ima==NULL) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Not a Mesh or no Image.");
|
||||
if(RNA_property_is_set(op->ptr, "path")) {
|
||||
char path[FILE_MAX];
|
||||
|
||||
RNA_string_get(op->ptr, "path", path);
|
||||
ima= BKE_add_image_file(path,
|
||||
scene ? scene->r.cfra : 1);
|
||||
}
|
||||
else {
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
ima= (Image *)find_id("IM", name);
|
||||
}
|
||||
|
||||
if(!ima) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Not an Image.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -368,6 +385,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
|
||||
|
||||
/* properties */
|
||||
RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign.");
|
||||
RNA_def_string(ot->srna, "path", "Path", FILE_MAX, "Filepath", "Path to image file");
|
||||
}
|
||||
|
||||
static int uv_texture_remove_exec(bContext *C, wmOperator *op)
|
||||
|
||||
@@ -297,6 +297,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MESH_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, 0, KKEY);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_SHIFT, KKEY)->ptr, "type", 2/*KNIFE_MIDPOINT*/);
|
||||
|
||||
@@ -64,6 +64,7 @@ void ED_keymap_metaball(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_duplicate_metaelems", DKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
|
||||
@@ -232,19 +232,20 @@ void OBJECT_OT_restrictview_set(wmOperatorType *ot)
|
||||
/* 99% same as above except no need for scene refreshing (TODO, update render preview) */
|
||||
static int object_restrictrender_clear_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *sa= CTX_wm_area(C);
|
||||
View3D *v3d= sa->spacedata.first;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Base *base;
|
||||
|
||||
short changed= 0;
|
||||
|
||||
/* XXX need a context loop to handle such cases */
|
||||
for(base = FIRSTBASE; base; base=base->next){
|
||||
if((base->lay & v3d->lay) && base->object->restrictflag & OB_RESTRICT_RENDER) {
|
||||
base->object->restrictflag &= ~OB_RESTRICT_RENDER;
|
||||
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
|
||||
if(ob->restrictflag & OB_RESTRICT_RENDER) {
|
||||
ob->restrictflag &= ~OB_RESTRICT_RENDER;
|
||||
changed= 1;
|
||||
}
|
||||
}
|
||||
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_OUTLINER, NULL);
|
||||
CTX_DATA_END;
|
||||
|
||||
if(changed)
|
||||
WM_event_add_notifier(C, NC_SPACE|ND_SPACE_OUTLINER, NULL);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -252,7 +253,7 @@ void OBJECT_OT_restrictrender_clear(wmOperatorType *ot)
|
||||
{
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Clear Restrict View";
|
||||
ot->name= "Clear Restrict Render";
|
||||
ot->description = "Reveal the render object by setting the restrictrender flag";
|
||||
ot->idname= "OBJECT_OT_restrictrender_clear";
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ void OBJECT_OT_select_linked(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_grouped(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_mirror(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_name(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_same_group(struct wmOperatorType *ot);
|
||||
|
||||
/* object_add.c */
|
||||
void OBJECT_OT_add(struct wmOperatorType *ot);
|
||||
|
||||
@@ -98,6 +98,7 @@ void ED_operatortypes_object(void)
|
||||
WM_operatortype_append(OBJECT_OT_select_inverse);
|
||||
WM_operatortype_append(OBJECT_OT_select_random);
|
||||
WM_operatortype_append(OBJECT_OT_select_all);
|
||||
WM_operatortype_append(OBJECT_OT_select_same_group);
|
||||
WM_operatortype_append(OBJECT_OT_select_by_type);
|
||||
WM_operatortype_append(OBJECT_OT_select_by_layer);
|
||||
WM_operatortype_append(OBJECT_OT_select_linked);
|
||||
@@ -328,6 +329,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_duplicates_make_real", AKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_group.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_material.h"
|
||||
@@ -60,6 +59,8 @@
|
||||
|
||||
#include "ED_screen.h"
|
||||
|
||||
#include "UI_interface.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
#include "RNA_enum_types.h"
|
||||
@@ -403,14 +404,11 @@ static short select_grouped_group(bContext *C, Object *ob) /* Select objects in
|
||||
{
|
||||
short changed = 0;
|
||||
Group *group, *ob_groups[GROUP_MENU_MAX];
|
||||
//char str[10 + (24*GROUP_MENU_MAX)];
|
||||
//char *p = str;
|
||||
int group_count=0; //, menu, i;
|
||||
int group_count=0, i;
|
||||
uiPopupMenu *pup;
|
||||
uiLayout *layout;
|
||||
|
||||
for ( group=G.main->group.first;
|
||||
group && group_count < GROUP_MENU_MAX;
|
||||
group=group->id.next
|
||||
) {
|
||||
for (group=CTX_data_main(C)->group.first; group && group_count < GROUP_MENU_MAX; group=group->id.next) {
|
||||
if (object_in_group (ob, group)) {
|
||||
ob_groups[group_count] = group;
|
||||
group_count++;
|
||||
@@ -419,7 +417,6 @@ static short select_grouped_group(bContext *C, Object *ob) /* Select objects in
|
||||
|
||||
if (!group_count)
|
||||
return 0;
|
||||
|
||||
else if (group_count == 1) {
|
||||
group = ob_groups[0];
|
||||
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
|
||||
@@ -431,27 +428,18 @@ static short select_grouped_group(bContext *C, Object *ob) /* Select objects in
|
||||
CTX_DATA_END;
|
||||
return changed;
|
||||
}
|
||||
#if 0 // XXX hows this work in 2.5?
|
||||
|
||||
/* build the menu. */
|
||||
p += sprintf(str, "Groups%%t");
|
||||
pup= uiPupMenuBegin(C, "Select Group", 0);
|
||||
layout= uiPupMenuLayout(pup);
|
||||
|
||||
for (i=0; i<group_count; i++) {
|
||||
group = ob_groups[i];
|
||||
p += sprintf (p, "|%s%%x%i", group->id.name+2, i);
|
||||
uiItemStringO(layout, group->id.name+2, 0, "OBJECT_OT_select_same_group", "group", group->id.name);
|
||||
}
|
||||
|
||||
menu = pupmenu (str);
|
||||
if (menu == -1)
|
||||
return 0;
|
||||
|
||||
group = ob_groups[menu];
|
||||
for (base= FIRSTBASE; base; base= base->next) {
|
||||
if (!(base->flag & SELECT) && object_in_group(base->object, group)) {
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return changed;
|
||||
uiPupMenuEnd(C, pup);
|
||||
return changed; // The operator already handle this!
|
||||
}
|
||||
|
||||
static short select_grouped_object_hooks(bContext *C, Object *ob)
|
||||
@@ -786,6 +774,55 @@ void OBJECT_OT_select_all(wmOperatorType *ot)
|
||||
WM_operator_properties_select_all(ot);
|
||||
}
|
||||
|
||||
/**************************** Select In The Same Group ****************************/
|
||||
|
||||
static int object_select_same_group_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Group *group;
|
||||
char group_name[32];
|
||||
|
||||
/* passthrough if no objects are visible */
|
||||
if (CTX_DATA_COUNT(C, visible_bases) == 0) return OPERATOR_PASS_THROUGH;
|
||||
|
||||
RNA_string_get(op->ptr, "group", group_name);
|
||||
|
||||
for (group=CTX_data_main(C)->group.first; group; group=group->id.next) {
|
||||
if (!strcmp(group->id.name, group_name))
|
||||
break;
|
||||
}
|
||||
|
||||
if (!group)
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
|
||||
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
|
||||
if (!(base->flag & SELECT) && object_in_group(base->object, group))
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void OBJECT_OT_select_same_group(wmOperatorType *ot)
|
||||
{
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "select same group";
|
||||
ot->description = "Select object in the same group";
|
||||
ot->idname= "OBJECT_OT_select_same_group";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= object_select_same_group_exec;
|
||||
ot->poll= ED_operator_scene_editable;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select.");
|
||||
}
|
||||
|
||||
/**************************** Select Mirror ****************************/
|
||||
|
||||
/* finds the best possible flipped name. For renaming; check for unique names afterwards */
|
||||
|
||||
@@ -100,6 +100,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, 0, 0);
|
||||
|
||||
@@ -1159,7 +1159,7 @@ void MATERIAL_OT_paste(wmOperatorType *ot)
|
||||
/* identifiers */
|
||||
ot->name= "Paste Material";
|
||||
ot->idname= "MATERIAL_OT_paste";
|
||||
ot->description="Copy the material settings and nodes";
|
||||
ot->description="Paste the material settings and nodes";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= paste_material_exec;
|
||||
|
||||
@@ -145,6 +145,7 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
||||
|
||||
WM_keymap_add_item(keymap, "ACTION_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ACTION_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ACTION_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "ACTION_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "ACTION_OT_keyframe_insert", IKEY, KM_PRESS, 0, 0);
|
||||
|
||||
@@ -749,8 +749,9 @@ int file_next_exec(bContext *C, wmOperator *unused)
|
||||
/* only meant for timer usage */
|
||||
static int file_smoothscroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
ScrArea *sa = CTX_wm_area(C);
|
||||
SpaceFile *sfile= CTX_wm_space_file(C);
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
ARegion *ar, *oldar= CTX_wm_region(C);
|
||||
int numfiles, offset;
|
||||
int edit_idx = 0;
|
||||
int numfiles_layout;
|
||||
@@ -780,6 +781,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
}
|
||||
|
||||
/* we need the correct area for scrolling */
|
||||
ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
|
||||
if (!ar || ar->regiontype != RGN_TYPE_WINDOW) {
|
||||
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), sfile->smoothscroll_timer);
|
||||
sfile->smoothscroll_timer=NULL;
|
||||
@@ -809,6 +811,10 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
/* temporarily set context to the main window region,
|
||||
* so the scroll operators work */
|
||||
CTX_wm_region_set(C, ar);
|
||||
|
||||
/* scroll one step in the desired direction */
|
||||
if (sfile->scroll_offset < offset) {
|
||||
if (sfile->layout->flag & FILE_LAYOUT_HOR) {
|
||||
@@ -827,6 +833,9 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
|
||||
/* and restore context */
|
||||
CTX_wm_region_set(C, oldar);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
||||
@@ -1280,7 +1280,7 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update)
|
||||
while ( (*stop==0) && (limg) ) {
|
||||
if ( limg->flags & IMAGEFILE ) {
|
||||
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
|
||||
} else if ( limg->flags & MOVIEFILE ) {
|
||||
} else if ( limg->flags & MOVIEFILE ) {
|
||||
limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_MOVIE);
|
||||
if (!limg->img) {
|
||||
/* remember that file can't be loaded via IMB_open_anim */
|
||||
@@ -1360,3 +1360,8 @@ void thumbnails_stop(struct FileList* filelist, const struct bContext* C)
|
||||
{
|
||||
WM_jobs_kill(CTX_wm_manager(C), filelist);
|
||||
}
|
||||
|
||||
int thumbnails_running(struct FileList* filelist, const struct bContext* C)
|
||||
{
|
||||
return WM_jobs_test(CTX_wm_manager(C), filelist);
|
||||
}
|
||||
@@ -86,6 +86,7 @@ int folderlist_clear_next(struct SpaceFile* sfile);
|
||||
|
||||
void thumbnails_stop(struct FileList* filelist, const struct bContext* C);
|
||||
void thumbnails_start(struct FileList* filelist, const struct bContext* C);
|
||||
int thumbnails_running(struct FileList* filelist, const struct bContext* C);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -201,17 +201,28 @@ static void file_refresh(const bContext *C, ScrArea *sa)
|
||||
filelist_sort(sfile->files, params->sort);
|
||||
}
|
||||
BLI_strncpy(params->dir, filelist_dir(sfile->files), FILE_MAX);
|
||||
thumbnails_start(sfile->files, C);
|
||||
if(params->display == FILE_IMGDISPLAY) {
|
||||
thumbnails_start(sfile->files, C);
|
||||
}
|
||||
} else {
|
||||
filelist_filter(sfile->files);
|
||||
if(params->sort!=FILE_SORT_NONE) {
|
||||
thumbnails_stop(sfile->files, C);
|
||||
filelist_sort(sfile->files, params->sort);
|
||||
thumbnails_start(sfile->files, C);
|
||||
if(params->display == FILE_IMGDISPLAY) {
|
||||
thumbnails_start(sfile->files, C);
|
||||
}
|
||||
} else {
|
||||
if(params->display == FILE_IMGDISPLAY) {
|
||||
if (!thumbnails_running(sfile->files,C)) {
|
||||
thumbnails_start(sfile->files, C);
|
||||
}
|
||||
} else {
|
||||
/* stop any running thumbnail jobs if we're not
|
||||
displaying them - speedup for NFS */
|
||||
thumbnails_stop(sfile->files, C);
|
||||
}
|
||||
filelist_filter(sfile->files);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (params->renamefile[0] != '\0') {
|
||||
@@ -382,6 +393,9 @@ void file_keymap(struct wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "FILE_OT_directory_new", IKEY, KM_PRESS, 0, 0); /* XXX needs button */
|
||||
WM_keymap_add_item(keymap, "FILE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_delete", BACKSPACEKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_delete", BACKSPACEKEY, KM_PRESS, KM_OSKEY, 0);
|
||||
WM_keymap_verify_item(keymap, "FILE_OT_smoothscroll", TIMER1, KM_ANY, KM_ANY, 0);
|
||||
|
||||
/* keys for main area */
|
||||
keymap= WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
|
||||
@@ -409,7 +423,7 @@ void file_keymap(struct wmKeyConfig *keyconf)
|
||||
RNA_int_set(kmi->ptr, "increment", -10);
|
||||
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_int_set(kmi->ptr, "increment",-100);
|
||||
WM_keymap_verify_item(keymap, "FILE_OT_smoothscroll", TIMER1, KM_ANY, KM_ANY, 0);
|
||||
|
||||
|
||||
/* keys for button area (top) */
|
||||
keymap= WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0);
|
||||
@@ -455,7 +469,12 @@ static void file_channel_area_listener(ARegion *ar, wmNotifier *wmn)
|
||||
/* add handlers, stuff you only do once or on area/region changes */
|
||||
static void file_header_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
{
|
||||
wmKeyMap *keymap;
|
||||
|
||||
ED_region_header_init(ar);
|
||||
|
||||
keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
|
||||
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
|
||||
}
|
||||
|
||||
static void file_header_area_draw(const bContext *C, ARegion *ar)
|
||||
|
||||
@@ -502,7 +502,15 @@ static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *
|
||||
float samplefreq, ctime;
|
||||
float stime, etime;
|
||||
float unitFac;
|
||||
|
||||
float dx, dy;
|
||||
|
||||
/* when opening a blend file on a different sized screen or while dragging the toolbar this can happen
|
||||
* best just bail out in this case */
|
||||
UI_view2d_grid_size(grid, &dx, &dy);
|
||||
if(dx <= 0.0f)
|
||||
return;
|
||||
|
||||
|
||||
/* disable any drivers temporarily */
|
||||
driver= fcu->driver;
|
||||
fcu->driver= NULL;
|
||||
@@ -522,11 +530,9 @@ static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *
|
||||
* loop (i.e. too close to 0), then clamp it to a determined "safe" value. The value
|
||||
* chosen here is just the coarsest value which still looks reasonable...
|
||||
*/
|
||||
/* grid->dx is the first float in View2DGrid struct, so just cast to float pointer, and use it
|
||||
* It represents the number of 'frames' between gridlines, but we divide by U.v2d_min_gridsize to get pixels-steps
|
||||
*/
|
||||
/* grid->dx represents the number of 'frames' between gridlines, but we divide by U.v2d_min_gridsize to get pixels-steps */
|
||||
// TODO: perhaps we should have 1.0 frames as upper limit so that curves don't get too distorted?
|
||||
samplefreq= *((float *)grid) / U.v2d_min_gridsize;
|
||||
samplefreq= dx / U.v2d_min_gridsize;
|
||||
if (samplefreq < 0.00001f) samplefreq= 0.00001f;
|
||||
|
||||
|
||||
|
||||
@@ -346,6 +346,7 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
||||
|
||||
WM_keymap_add_item(keymap, "GRAPH_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "GRAPH_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "GRAPH_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "GRAPH_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
|
||||
@@ -898,7 +898,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
|
||||
uiItemR(col, userptr, "frames", 0, str, 0);
|
||||
if(ima->anim) {
|
||||
block= uiLayoutGetBlock(row);
|
||||
but= uiDefBut(block, BUT, 0, "<", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, 0, 0, 0, 0, 0, "Set the number of frames from the movie or sequence.");
|
||||
but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, 0, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence.");
|
||||
uiButSetFunc(but, set_frames_cb, ima, iuser);
|
||||
}
|
||||
|
||||
|
||||
@@ -385,6 +385,8 @@ static SpaceLink *image_new(const bContext *C)
|
||||
simage->iuser.ok= 1;
|
||||
simage->iuser.fie_ima= 2;
|
||||
simage->iuser.frames= 100;
|
||||
|
||||
scopes_new(&simage->scopes);
|
||||
|
||||
/* header */
|
||||
ar= MEM_callocN(sizeof(ARegion), "header for image");
|
||||
@@ -409,13 +411,6 @@ static SpaceLink *image_new(const bContext *C)
|
||||
ar->alignment= RGN_ALIGN_RIGHT;
|
||||
ar->flag = RGN_FLAG_HIDDEN;
|
||||
|
||||
simage->scopes.accuracy=30.0;
|
||||
simage->scopes.hist.mode=HISTO_MODE_RGB;
|
||||
simage->scopes.wavefrm_alpha=0.3;
|
||||
simage->scopes.vecscope_alpha=0.3;
|
||||
simage->scopes.wavefrm_height= 100;
|
||||
simage->scopes.hist.height= 100;
|
||||
|
||||
/* main area */
|
||||
ar= MEM_callocN(sizeof(ARegion), "main area for image");
|
||||
|
||||
|
||||
@@ -259,10 +259,27 @@ static int sensor_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
bSensor *sens;
|
||||
PointerRNA sens_ptr;
|
||||
PropertyRNA *prop;
|
||||
const char *sens_name;
|
||||
int type= RNA_enum_get(op->ptr, "type");
|
||||
char name[32];
|
||||
|
||||
sens= new_sensor(type);
|
||||
BLI_addtail(&(ob->sensors), sens);
|
||||
|
||||
/* set the sensor name based on rna type enum */
|
||||
RNA_pointer_create((ID *)ob, &RNA_Sensor, sens, &sens_ptr);
|
||||
prop = RNA_struct_find_property(&sens_ptr, "type");
|
||||
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
if(BLI_strnlen(name, 32) < 1){
|
||||
RNA_property_enum_name(C, &sens_ptr, prop, RNA_property_enum_get(&sens_ptr, prop), &sens_name);
|
||||
BLI_strncpy(sens->name, sens_name, sizeof(sens->name));
|
||||
}
|
||||
else
|
||||
BLI_strncpy(sens->name, name, sizeof(sens->name));
|
||||
|
||||
make_unique_prop_names(C, sens->name);
|
||||
ob->scaflag |= OB_SHOWSENS;
|
||||
|
||||
@@ -291,6 +308,7 @@ void LOGIC_OT_sensor_add(wmOperatorType *ot)
|
||||
/* properties */
|
||||
prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
|
||||
RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
|
||||
prop= RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add");
|
||||
}
|
||||
|
||||
/* ************* Add/Remove Controller Operator ************* */
|
||||
@@ -345,13 +363,29 @@ static int controller_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
bController *cont;
|
||||
PointerRNA cont_ptr;
|
||||
PropertyRNA *prop;
|
||||
const char *cont_name;
|
||||
int type= RNA_enum_get(op->ptr, "type");
|
||||
int bit;
|
||||
char name[32];
|
||||
|
||||
cont= new_controller(type);
|
||||
BLI_addtail(&(ob->controllers), cont);
|
||||
make_unique_prop_names(C, cont->name);
|
||||
|
||||
/* set the controller name based on rna type enum */
|
||||
RNA_pointer_create((ID *)ob, &RNA_Controller, cont, &cont_ptr);
|
||||
prop = RNA_struct_find_property(&cont_ptr, "type");
|
||||
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
if(BLI_strnlen(name, 32) < 1){
|
||||
RNA_property_enum_name(C, &cont_ptr, prop, RNA_property_enum_get(&cont_ptr, prop), &cont_name);
|
||||
BLI_strncpy(cont->name, cont_name, sizeof(cont->name));
|
||||
}
|
||||
else
|
||||
BLI_strncpy(cont->name, name, sizeof(cont->name));
|
||||
|
||||
make_unique_prop_names(C, cont->name);
|
||||
/* set the controller state mask from the current object state.
|
||||
A controller is always in a single state, so select the lowest bit set
|
||||
from the object state */
|
||||
@@ -391,6 +425,7 @@ void LOGIC_OT_controller_add(wmOperatorType *ot)
|
||||
|
||||
/* properties */
|
||||
prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
|
||||
prop= RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add");
|
||||
}
|
||||
|
||||
/* ************* Add/Remove Actuator Operator ************* */
|
||||
@@ -445,13 +480,31 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
bActuator *act;
|
||||
PointerRNA act_ptr;
|
||||
PropertyRNA *prop;
|
||||
const char *act_name;
|
||||
char name[32];
|
||||
//XXX RNA_string_get is not using maxlen, it's using UserPreferencesFilePaths_python_scripts_directory_get instead (what limits the string copy to 160 chars in this case and CRASHES Blender).
|
||||
int type= RNA_enum_get(op->ptr, "type");
|
||||
|
||||
act= new_actuator(type);
|
||||
BLI_addtail(&(ob->actuators), act);
|
||||
|
||||
/* set the actuator name based on rna type enum */
|
||||
RNA_pointer_create((ID *)ob, &RNA_Actuator, act, &act_ptr);
|
||||
prop = RNA_struct_find_property(&act_ptr, "type");
|
||||
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
if (BLI_strnlen(name, 32) < 1){
|
||||
RNA_property_enum_name(C, &act_ptr, prop, RNA_property_enum_get(&act_ptr, prop), &act_name);
|
||||
BLI_strncpy(act->name, act_name, sizeof(act->name));
|
||||
}
|
||||
else
|
||||
BLI_strncpy(act->name, name, sizeof(act->name));
|
||||
|
||||
make_unique_prop_names(C, act->name);
|
||||
ob->scaflag |= OB_SHOWACT;
|
||||
|
||||
|
||||
WM_event_add_notifier(C, NC_LOGIC, NULL);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -477,6 +530,7 @@ void LOGIC_OT_actuator_add(wmOperatorType *ot)
|
||||
/* properties */
|
||||
prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
|
||||
RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
|
||||
prop= RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add");
|
||||
}
|
||||
|
||||
void ED_operatortypes_logic(void)
|
||||
|
||||
@@ -448,8 +448,8 @@ void do_logic_buts(bContext *C, void *arg, int event)
|
||||
|
||||
case B_SET_STATE_BIT:
|
||||
for(ob=G.main->object.first; ob; ob=ob->id.next) {
|
||||
if(ob->scaflag & OB_SETSTBIT) {
|
||||
ob->scaflag &= ~OB_SETSTBIT;
|
||||
if(ob->scaflag & OB_ALLSTATE) {
|
||||
ob->scaflag &= ~OB_ALLSTATE;
|
||||
ob->state = 0x3FFFFFFF;
|
||||
}
|
||||
}
|
||||
@@ -3208,24 +3208,33 @@ static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
|
||||
|
||||
static void draw_sensor_actuator(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
/* -- couldnt make it work for actuators
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
PointerRNA settings_ptr;
|
||||
|
||||
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
|
||||
uiItemPointerR(layout, ptr, "actuator", &settings_ptr, "actuators", "", 0);
|
||||
*/
|
||||
|
||||
uiItemR(layout, ptr, "actuator", 0, NULL, 0);
|
||||
uiItemPointerR(layout, ptr, "actuator", &settings_ptr, "actuators", NULL, ICON_LOGIC);
|
||||
}
|
||||
|
||||
static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
bSensor *sens = (bSensor*)ptr->data;
|
||||
bArmatureSensor *as = (bArmatureSensor *) sens->data;
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
PointerRNA pose_ptr, pchan_ptr;
|
||||
PropertyRNA *bones_prop;
|
||||
uiLayout *row;
|
||||
row = uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "channel_name", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "constraint_name", 0, NULL, 0);
|
||||
|
||||
if (ob->pose) {
|
||||
RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose, &pose_ptr);
|
||||
bones_prop = RNA_struct_find_property(&pose_ptr, "bones");
|
||||
}
|
||||
|
||||
if (&pose_ptr.data) {
|
||||
uiItemPointerR(layout, ptr, "bone", &pose_ptr, "bones", NULL, ICON_BONE_DATA);
|
||||
|
||||
if (RNA_property_collection_lookup_string(&pose_ptr, bones_prop, as->posechannel, &pchan_ptr))
|
||||
uiItemPointerR(layout, ptr, "constraint", &pchan_ptr, "constraints", NULL, ICON_CONSTRAINT_BONE);
|
||||
}
|
||||
row = uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "test_type", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "value", 0, NULL, 0);
|
||||
@@ -3350,7 +3359,7 @@ static void draw_sensor_near(uiLayout *layout, PointerRNA *ptr)
|
||||
|
||||
uiItemR(layout, ptr, "property", 0, NULL, 0);
|
||||
|
||||
row= uiLayoutRow(layout, 0);
|
||||
row= uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "distance", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "reset_distance", 0, NULL, 0);
|
||||
}
|
||||
@@ -3405,19 +3414,19 @@ static void draw_sensor_ray(uiLayout *layout, PointerRNA *ptr)
|
||||
uiLayout *split, *row;
|
||||
|
||||
split= uiLayoutSplit(layout, 0.3, 0);
|
||||
uiItemR(split, ptr, "ray_type", UI_ITEM_R_TOGGLE, NULL, 0);
|
||||
uiItemR(split, ptr, "ray_type", 0, "", 0);
|
||||
switch (RNA_enum_get(ptr, "ray_type")) {
|
||||
case SENS_RAY_PROPERTY:
|
||||
uiItemR(split, ptr, "property", 0, NULL, 0); break;
|
||||
uiItemR(split, ptr, "property", 0, "", 0); break;
|
||||
case SENS_RAY_MATERIAL:
|
||||
uiItemR(split, ptr, "material", 0, NULL, 0); break;
|
||||
uiItemR(split, ptr, "material", 0, "", 0); break;
|
||||
}
|
||||
|
||||
split= uiLayoutSplit(layout, 0.3, 0);
|
||||
uiItemR(split, ptr, "x_ray_mode", UI_ITEM_R_TOGGLE, NULL, 0);
|
||||
row= uiLayoutRow(split, 0);
|
||||
uiItemR(split, ptr, "axis", 0, "", 0);
|
||||
row= uiLayoutRow(split, 0);
|
||||
uiItemR(row, ptr, "range", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "axis", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "x_ray_mode", UI_ITEM_R_TOGGLE, NULL, 0);
|
||||
}
|
||||
|
||||
static void draw_sensor_touch(uiLayout *layout, PointerRNA *ptr)
|
||||
@@ -3507,7 +3516,7 @@ static void draw_controller_expression(uiLayout *layout, PointerRNA *ptr)
|
||||
|
||||
static void draw_controller_python(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
uiLayout *row, *split, *subsplit;
|
||||
uiLayout *split, *subsplit;
|
||||
|
||||
split = uiLayoutSplit(layout, 0.3, 1);
|
||||
uiItemR(split, ptr, "mode", 0, "", 0);
|
||||
@@ -3609,34 +3618,50 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
|
||||
|
||||
static void draw_actuator_armature(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
uiLayout *row;
|
||||
bActuator *act = (bActuator*)ptr->data;
|
||||
bArmatureActuator *aa = (bArmatureActuator *) act->data;
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
PointerRNA pose_ptr, pchan_ptr;
|
||||
PropertyRNA *bones_prop;
|
||||
|
||||
if (ob->pose) {
|
||||
RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose, &pose_ptr);
|
||||
bones_prop = RNA_struct_find_property(&pose_ptr, "bones");
|
||||
}
|
||||
|
||||
uiItemR(layout, ptr, "mode", 0, NULL, 0);
|
||||
|
||||
switch (RNA_enum_get(ptr, "mode"))
|
||||
{
|
||||
case ACT_ARM_RUN:
|
||||
break;
|
||||
case ACT_ARM_ENABLE:
|
||||
row = uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "bone", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "constraint", 0, NULL, 0);
|
||||
break;
|
||||
case ACT_ARM_DISABLE:
|
||||
row = uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "bone", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "constraint", 0, NULL, 0);
|
||||
if (&pose_ptr.data) {
|
||||
uiItemPointerR(layout, ptr, "bone", &pose_ptr, "bones", NULL, ICON_BONE_DATA);
|
||||
|
||||
if (RNA_property_collection_lookup_string(&pose_ptr, bones_prop, aa->posechannel, &pchan_ptr))
|
||||
uiItemPointerR(layout, ptr, "constraint", &pchan_ptr, "constraints", NULL, ICON_CONSTRAINT_BONE);
|
||||
}
|
||||
break;
|
||||
case ACT_ARM_SETTARGET:
|
||||
row = uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "bone", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "constraint", 0, NULL, 0);
|
||||
if (&pose_ptr.data) {
|
||||
uiItemPointerR(layout, ptr, "bone", &pose_ptr, "bones", NULL, ICON_BONE_DATA);
|
||||
|
||||
if (RNA_property_collection_lookup_string(&pose_ptr, bones_prop, aa->posechannel, &pchan_ptr))
|
||||
uiItemPointerR(layout, ptr, "constraint", &pchan_ptr, "constraints", NULL, ICON_CONSTRAINT_BONE);
|
||||
}
|
||||
|
||||
uiItemR(layout, ptr, "target", 0, NULL, 0);
|
||||
uiItemR(layout, ptr, "secondary_target", 0, NULL, 0);
|
||||
break;
|
||||
case ACT_ARM_SETWEIGHT:
|
||||
row = uiLayoutRow(layout, 1);
|
||||
uiItemR(row, ptr, "bone", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "constraint", 0, NULL, 0);
|
||||
if (&pose_ptr.data) {
|
||||
uiItemPointerR(layout, ptr, "bone", &pose_ptr, "bones", NULL, ICON_BONE_DATA);
|
||||
|
||||
if (RNA_property_collection_lookup_string(&pose_ptr, bones_prop, aa->posechannel, &pchan_ptr))
|
||||
uiItemPointerR(layout, ptr, "constraint", &pchan_ptr, "constraints", NULL, ICON_CONSTRAINT_BONE);
|
||||
}
|
||||
|
||||
uiItemR(layout, ptr, "weight", 0, NULL, 0);
|
||||
break;
|
||||
@@ -3659,7 +3684,7 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr)
|
||||
|
||||
static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
uiLayout *row, *subrow, *col, *subcol, *split;
|
||||
uiLayout *row, *col, *subcol, *split;
|
||||
|
||||
uiItemR(layout, ptr, "mode", 0, NULL, 0);
|
||||
switch (RNA_enum_get(ptr, "mode"))
|
||||
@@ -3803,7 +3828,7 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
|
||||
|
||||
static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
uiLayout *split;
|
||||
uiLayout *row, *split;
|
||||
|
||||
uiItemR(layout, ptr, "mode", 0, NULL, 0);
|
||||
switch (RNA_enum_get(ptr, "mode"))
|
||||
@@ -3813,8 +3838,10 @@ static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr)
|
||||
uiItemR(layout, ptr, "glsl_shader", 0, NULL, 0);
|
||||
break;
|
||||
case ACT_2DFILTER_MOTIONBLUR:
|
||||
split=uiLayoutSplit(layout, 0.9, 0);
|
||||
uiItemR(split, ptr, "motion_blur_value", 0, NULL, 0);
|
||||
split=uiLayoutSplit(layout, 0.75, 1);
|
||||
row= uiLayoutRow(split, 0);
|
||||
uiLayoutSetActive(row, RNA_boolean_get(ptr, "enable_motion_blur")==1);
|
||||
uiItemR(row, ptr, "motion_blur_value", 0, NULL, 0);
|
||||
uiItemR(split, ptr, "enable_motion_blur", UI_ITEM_R_TOGGLE, NULL, 0);
|
||||
break;
|
||||
default: // all other 2D Filters
|
||||
@@ -3992,12 +4019,16 @@ static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)
|
||||
static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
PointerRNA settings_ptr;
|
||||
uiLayout *row;
|
||||
bActuator *act = (bActuator *)ptr->data;
|
||||
bPropertyActuator *pa = (bPropertyActuator *) act->data;
|
||||
Object *ob_from= pa->ob;
|
||||
PointerRNA settings_ptr, obj_settings_ptr;
|
||||
|
||||
uiItemR(layout, ptr, "mode", 0, NULL, 0);
|
||||
uiLayout *row, *subrow;
|
||||
|
||||
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
|
||||
|
||||
uiItemR(layout, ptr, "mode", 0, NULL, 0);
|
||||
uiItemPointerR(layout, ptr, "property", &settings_ptr, "properties", NULL, 0);
|
||||
|
||||
switch(RNA_enum_get(ptr, "mode"))
|
||||
@@ -4013,7 +4044,16 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
|
||||
case ACT_PROP_COPY:
|
||||
row = uiLayoutRow(layout, 0);
|
||||
uiItemR(row, ptr, "object", 0, NULL, 0);
|
||||
uiItemR(row, ptr, "object_property", 0, NULL, 0);
|
||||
if(ob_from){
|
||||
RNA_pointer_create((ID *)ob_from, &RNA_GameObjectSettings, ob_from, &obj_settings_ptr);
|
||||
uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, 0);
|
||||
}else
|
||||
{
|
||||
subrow= uiLayoutRow(row, 0);
|
||||
uiLayoutSetActive(subrow, 0);
|
||||
uiItemR(subrow, ptr, "object_property", 0, NULL, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4265,9 +4305,9 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
ID **idar;
|
||||
|
||||
PointerRNA logic_ptr;
|
||||
PointerRNA logic_ptr, settings_ptr;
|
||||
|
||||
uiLayout *layout, *row;
|
||||
uiLayout *layout, *row, *split, *subsplit, *box, *col;
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
char name[32];
|
||||
@@ -4315,29 +4355,38 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
|
||||
uiItemR(row, &logic_ptr, "controllers_show_active_objects", 0, "Act", 0);
|
||||
uiItemR(row, &logic_ptr, "controllers_show_linked_controller", 0, "Link", 0);
|
||||
|
||||
{
|
||||
PointerRNA settings_ptr;
|
||||
row = uiLayoutRow(layout, 0);
|
||||
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
|
||||
uiItemR(row, &logic_ptr, "controllers_show_initial_state", UI_ITEM_R_NO_BG, "", 0);
|
||||
uiTemplateLayers(row, &settings_ptr, "state", &settings_ptr, "used_state", 0);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All", 0, 0, UI_UNIT_X, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
|
||||
uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D", 0, 0, UI_UNIT_X, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
if (RNA_boolean_get(&logic_ptr, "controllers_show_initial_state")) {
|
||||
row = uiLayoutRow(layout, 0);
|
||||
uiItemL(row, "Initial State:", 0);
|
||||
uiTemplateLayers(row, &settings_ptr, "initial_state", &settings_ptr, "used_state", 0);
|
||||
}
|
||||
}
|
||||
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
|
||||
|
||||
row = uiLayoutRow(layout, 1);
|
||||
split= uiLayoutSplit(layout, 0.05, 0);
|
||||
uiItemR(split, &settings_ptr, "show_state_panel", UI_ITEM_R_NO_BG, "", ICON_DISCLOSURE_TRI_RIGHT);
|
||||
|
||||
row = uiLayoutRow(split, 1);
|
||||
uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers");
|
||||
uiItemMenuEnumO(row, "LOGIC_OT_controller_add", "type", "Add Controller", 0);
|
||||
|
||||
|
||||
if (RNA_boolean_get(&settings_ptr, "show_state_panel")) {
|
||||
|
||||
box= uiLayoutBox(layout);
|
||||
uiLayoutSetAlignment(box, UI_LAYOUT_ALIGN_CENTER); //XXX doesn't seem to work
|
||||
split= uiLayoutSplit(box, 0.2, 0);
|
||||
|
||||
col= uiLayoutColumn(split, 0);
|
||||
uiItemL(col, "Visible", 0);
|
||||
uiItemL(col, "Initial", 0);
|
||||
|
||||
subsplit= uiLayoutSplit(split, 0.85, 0);
|
||||
col= uiLayoutColumn(subsplit, 0);
|
||||
row= uiLayoutRow(col, 0);
|
||||
uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "all_states")==0);
|
||||
uiTemplateLayers(row, &settings_ptr, "state", &settings_ptr, "used_state", 0);
|
||||
row= uiLayoutRow(col, 0);
|
||||
uiTemplateLayers(row, &settings_ptr, "initial_state", &settings_ptr, "used_state", 0);
|
||||
|
||||
col= uiLayoutColumn(subsplit, 0);
|
||||
uiItemR(col, &settings_ptr, "all_states", UI_ITEM_R_TOGGLE, NULL, 0);
|
||||
uiItemR(col, &settings_ptr, "debug_state", 0, "", 0);
|
||||
}
|
||||
|
||||
for(a=0; a<count; a++) {
|
||||
bController *cont;
|
||||
PointerRNA ptr;
|
||||
@@ -4353,7 +4402,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
|
||||
for(cont= ob->controllers.first; cont; cont=cont->next) {
|
||||
RNA_pointer_create((ID *)ob, &RNA_Controller, cont, &ptr);
|
||||
|
||||
if (!(ob->state & cont->state_mask))
|
||||
if (!(ob->scaflag & OB_ALLSTATE) && !(ob->state & cont->state_mask))
|
||||
continue;
|
||||
//if (!(cont->state_mask & (1<<stbit)))
|
||||
// continue;
|
||||
@@ -4428,7 +4477,8 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
|
||||
for(sens= ob->sensors.first; sens; sens=sens->next) {
|
||||
RNA_pointer_create((ID *)ob, &RNA_Sensor, sens, &ptr);
|
||||
|
||||
if ((slogic->scaflag & BUTS_SENS_STATE) ||
|
||||
if ((ob->scaflag & OB_ALLSTATE) ||
|
||||
(slogic->scaflag & BUTS_SENS_STATE) ||
|
||||
(sens->totlinks == 0) || /* always display sensor without links so that is can be edited */
|
||||
(sens->flag & SENS_PIN && slogic->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */
|
||||
(is_sensor_linked(block, sens))
|
||||
@@ -4487,7 +4537,8 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
|
||||
|
||||
RNA_pointer_create((ID *)ob, &RNA_Actuator, act, &ptr);
|
||||
|
||||
if ((slogic->scaflag & BUTS_ACT_STATE) ||
|
||||
if ((ob->scaflag & OB_ALLSTATE) ||
|
||||
(slogic->scaflag & BUTS_ACT_STATE) ||
|
||||
!(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */
|
||||
(act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */
|
||||
(act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE) /* states can hide some sensors, pinned sensors ignore the visible state */
|
||||
@@ -4543,7 +4594,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
||||
* pin so changing states dosnt hide the logic brick */
|
||||
char pin;
|
||||
|
||||
if (G.rt != 0) {
|
||||
if (G.rt == 0) {
|
||||
logic_buttons_new(C, ar);
|
||||
return;
|
||||
}
|
||||
@@ -4640,7 +4691,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
||||
}
|
||||
}
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
|
||||
uiDefButBitS(block, TOG, OB_ALLSTATE, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
|
||||
uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state");
|
||||
uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
@@ -177,6 +177,7 @@ static void nla_keymap_channels (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
||||
/* delete tracks */
|
||||
WM_keymap_add_item(keymap, "NLA_OT_delete_tracks", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NLA_OT_delete_tracks", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NLA_OT_delete_tracks", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
/* General Animation Channels keymap (see anim_channels.c) ----------------------- */
|
||||
/* selection */
|
||||
@@ -246,6 +247,7 @@ static void nla_keymap_main (wmKeyConfig *keyconf, wmKeyMap *keymap)
|
||||
/* delete */
|
||||
WM_keymap_add_item(keymap, "NLA_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NLA_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NLA_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
/* split */
|
||||
WM_keymap_add_item(keymap, "NLA_OT_split", YKEY, KM_PRESS, 0, 0);
|
||||
|
||||
@@ -922,6 +922,79 @@ void node_deselectall(SpaceNode *snode)
|
||||
node->flag &= ~SELECT;
|
||||
}
|
||||
|
||||
/* return 1 if we need redraw otherwise zero. */
|
||||
int node_select_same_type(SpaceNode *snode)
|
||||
{
|
||||
bNode *nac, *p;
|
||||
int redraw;
|
||||
|
||||
/* search for the active node. */
|
||||
for (nac= snode->edittree->nodes.first; nac; nac= nac->next) {
|
||||
if (nac->flag & SELECT)
|
||||
break;
|
||||
}
|
||||
|
||||
/* no active node, return. */
|
||||
if (!nac)
|
||||
return(0);
|
||||
|
||||
redraw= 0;
|
||||
for (p= snode->edittree->nodes.first; p; p= p->next) {
|
||||
if (p->type != nac->type && p->flag & SELECT) {
|
||||
/* if it's selected but different type, unselect */
|
||||
redraw= 1;
|
||||
p->flag &= ~SELECT;
|
||||
}
|
||||
else if (p->type == nac->type && (!(p->flag & SELECT))) {
|
||||
/* if it's the same type and is not selected, select! */
|
||||
redraw= 1;
|
||||
p->flag |= SELECT;
|
||||
}
|
||||
}
|
||||
return(redraw);
|
||||
}
|
||||
|
||||
/* return 1 if we need redraw, otherwise zero.
|
||||
* dir can be 0 == next or 0 != prev.
|
||||
*/
|
||||
int node_select_same_type_np(SpaceNode *snode, int dir)
|
||||
{
|
||||
bNode *nac, *p;
|
||||
|
||||
/* search the active one. */
|
||||
for (nac= snode->edittree->nodes.first; nac; nac= nac->next) {
|
||||
if (nac->flag & SELECT)
|
||||
break;
|
||||
}
|
||||
|
||||
/* no active node, return. */
|
||||
if (!nac)
|
||||
return(0);
|
||||
|
||||
if (dir == 0)
|
||||
p= nac->next;
|
||||
else
|
||||
p= nac->prev;
|
||||
|
||||
while (p) {
|
||||
/* Now search the next with the same type. */
|
||||
if (p->type == nac->type)
|
||||
break;
|
||||
|
||||
if (dir == 0)
|
||||
p= p->next;
|
||||
else
|
||||
p= p->prev;
|
||||
}
|
||||
|
||||
if (p) {
|
||||
node_deselectall(snode);
|
||||
p->flag |= SELECT;
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int node_has_hidden_sockets(bNode *node)
|
||||
{
|
||||
bNodeSocket *sock;
|
||||
@@ -961,22 +1034,31 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode)
|
||||
}
|
||||
|
||||
if(node) {
|
||||
bNodeLink *link;
|
||||
bNodeSocket *sock;
|
||||
|
||||
/* get link to viewer */
|
||||
for(link= snode->edittree->links.first; link; link= link->next)
|
||||
if(link->tonode==node)
|
||||
/* get a good socket to view from */
|
||||
for(sock= tonode->outputs.first; sock; sock= sock->next)
|
||||
if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
|
||||
break;
|
||||
|
||||
if(link==NULL) {
|
||||
nodeAddLink(snode->edittree, tonode, tonode->outputs.first, node, node->inputs.first);
|
||||
if(sock) {
|
||||
bNodeLink *link;
|
||||
|
||||
/* get link to viewer */
|
||||
for(link= snode->edittree->links.first; link; link= link->next)
|
||||
if(link->tonode==node)
|
||||
break;
|
||||
|
||||
if(link==NULL) {
|
||||
nodeAddLink(snode->edittree, tonode, sock, node, node->inputs.first);
|
||||
}
|
||||
else {
|
||||
link->fromnode= tonode;
|
||||
link->fromsock= sock;
|
||||
}
|
||||
ntreeSolveOrder(snode->edittree);
|
||||
NodeTagChanged(snode->edittree, node);
|
||||
}
|
||||
else {
|
||||
link->fromnode= tonode;
|
||||
link->fromsock= tonode->outputs.first;
|
||||
}
|
||||
ntreeSolveOrder(snode->edittree);
|
||||
NodeTagChanged(snode->edittree, node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2030,4 +2112,86 @@ void NODE_OT_show_cyclic_dependencies(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/* ****************** Add File Node Operator ******************* */
|
||||
|
||||
static int node_add_file_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
SpaceNode *snode= CTX_wm_space_node(C);
|
||||
bNode *node;
|
||||
Image *ima= NULL;
|
||||
int ntype=0;
|
||||
|
||||
/* check input variables */
|
||||
if (RNA_property_is_set(op->ptr, "path"))
|
||||
{
|
||||
char path[FILE_MAX];
|
||||
RNA_string_get(op->ptr, "path", path);
|
||||
ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1);
|
||||
}
|
||||
else if(RNA_property_is_set(op->ptr, "name"))
|
||||
{
|
||||
char name[32];
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
ima= (Image *)find_id("IM", name);
|
||||
}
|
||||
|
||||
if(!ima) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Not an Image.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
|
||||
node_deselectall(snode);
|
||||
|
||||
if (snode->nodetree->type==NTREE_COMPOSIT)
|
||||
ntype = CMP_NODE_IMAGE;
|
||||
|
||||
node = node_add_node(snode, scene, ntype, snode->mx, snode->my);
|
||||
|
||||
if (!node) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Could not add an image node.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
node->id = (ID *)ima;
|
||||
|
||||
snode_notify(C, snode);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
SpaceNode *snode= CTX_wm_space_node(C);
|
||||
|
||||
/* convert mouse coordinates to v2d space */
|
||||
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
|
||||
&snode->mx, &snode->my);
|
||||
|
||||
if (RNA_property_is_set(op->ptr, "path") || RNA_property_is_set(op->ptr, "name"))
|
||||
return node_add_file_exec(C, op);
|
||||
else
|
||||
return WM_operator_filesel(C, op, event);
|
||||
}
|
||||
|
||||
void NODE_OT_add_file(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Add File Node";
|
||||
ot->description= "Add a file node to the current node editor";
|
||||
ot->idname= "NODE_OT_add_file";
|
||||
|
||||
/* callbacks */
|
||||
ot->exec= node_add_file_exec;
|
||||
ot->invoke= node_add_file_invoke;
|
||||
ot->poll= ED_operator_node_active;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE);
|
||||
RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign.");
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,9 @@ void NODE_OT_select_linked_from(wmOperatorType *ot);
|
||||
void NODE_OT_visibility_toggle(struct wmOperatorType *ot);
|
||||
void NODE_OT_view_all(struct wmOperatorType *ot);
|
||||
void NODE_OT_select_border(struct wmOperatorType *ot);
|
||||
void NODE_OT_select_same_type(struct wmOperatorType *ot);
|
||||
void NODE_OT_select_same_type_next(wmOperatorType *ot);
|
||||
void NODE_OT_select_same_type_prev(wmOperatorType *ot);
|
||||
|
||||
/* drawnode.c */
|
||||
void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link);
|
||||
@@ -80,6 +83,8 @@ void snode_set_context(SpaceNode *snode, Scene *scene);
|
||||
void snode_make_group_editable(SpaceNode *snode, bNode *gnode);
|
||||
void node_set_active(SpaceNode *snode, bNode *node);
|
||||
void node_deselectall(SpaceNode *snode);
|
||||
int node_select_same_type(SpaceNode *snode);
|
||||
int node_select_same_type_np(SpaceNode *snode, int dir);
|
||||
void snode_composite_job(const struct bContext *C, ScrArea *sa);
|
||||
bNode *node_tree_get_editgroup(bNodeTree *ntree);
|
||||
void node_tree_verify_groups(bNodeTree *nodetree);
|
||||
@@ -108,6 +113,8 @@ void NODE_OT_read_renderlayers(struct wmOperatorType *ot);
|
||||
void NODE_OT_backimage_move(struct wmOperatorType *ot);
|
||||
void NODE_OT_backimage_zoom(struct wmOperatorType *ot);
|
||||
|
||||
void NODE_OT_add_file(struct wmOperatorType *ot);
|
||||
|
||||
// XXXXXX
|
||||
|
||||
// XXX from BSE_node.h
|
||||
|
||||
@@ -51,7 +51,10 @@ void node_operatortypes(void)
|
||||
WM_operatortype_append(NODE_OT_select_linked_to);
|
||||
WM_operatortype_append(NODE_OT_select_linked_from);
|
||||
WM_operatortype_append(NODE_OT_select_border);
|
||||
|
||||
WM_operatortype_append(NODE_OT_select_same_type);
|
||||
WM_operatortype_append(NODE_OT_select_same_type_next);
|
||||
WM_operatortype_append(NODE_OT_select_same_type_prev);
|
||||
|
||||
WM_operatortype_append(NODE_OT_view_all);
|
||||
WM_operatortype_append(NODE_OT_visibility_toggle);
|
||||
WM_operatortype_append(NODE_OT_mute);
|
||||
@@ -77,6 +80,8 @@ void node_operatortypes(void)
|
||||
|
||||
WM_operatortype_append(NODE_OT_backimage_move);
|
||||
WM_operatortype_append(NODE_OT_backimage_zoom);
|
||||
|
||||
WM_operatortype_append(NODE_OT_add_file);
|
||||
}
|
||||
|
||||
void ED_operatormacros_node(void)
|
||||
@@ -147,10 +152,14 @@ void node_keymap(struct wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_border", BKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_linked_to", LKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_linked_from", LKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_same_type", GKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_same_type_next", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_select_same_type_prev", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "NODE_OT_group_make", GKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "NODE_OT_group_ungroup", GKEY, KM_PRESS, KM_ALT, 0);
|
||||
|
||||
@@ -363,3 +363,78 @@ void NODE_OT_select_linked_from(wmOperatorType *ot)
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/* ****** Select Same Type ****** */
|
||||
|
||||
static int node_select_same_type_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
|
||||
node_select_same_type(snode);
|
||||
WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void NODE_OT_select_same_type(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Select Same Type";
|
||||
ot->description = "Select all the same type";
|
||||
ot->idname = "NODE_OT_select_same_type";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = node_select_same_type_exec;
|
||||
ot->poll = ED_operator_node_active;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/* ****** Select The Next/Prev Node Of The Same Type ****** */
|
||||
|
||||
static int node_select_same_type_next_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
|
||||
node_select_same_type_np(snode, 0);
|
||||
WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void NODE_OT_select_same_type_next(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Select Same Type Next";
|
||||
ot->description = "Select the next node of the same type.";
|
||||
ot->idname = "NODE_OT_select_same_type_next";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = node_select_same_type_next_exec;
|
||||
ot->poll = ED_operator_node_active;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
static int node_select_same_type_prev_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
|
||||
node_select_same_type_np(snode, 1);
|
||||
WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void NODE_OT_select_same_type_prev(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Select Same Type Prev";
|
||||
ot->description = "Select the prev node of the same type.";
|
||||
ot->idname = "NODE_OT_select_same_type_prev";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = node_select_same_type_prev_exec;
|
||||
ot->poll = ED_operator_node_active;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
#include "UI_resources.h"
|
||||
#include "UI_view2d.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
@@ -135,8 +136,8 @@ static SpaceLink *node_new(const bContext *C)
|
||||
ar->v2d.max[0]= 32000.0f;
|
||||
ar->v2d.max[1]= 32000.0f;
|
||||
|
||||
ar->v2d.minzoom= 0.2f;
|
||||
ar->v2d.maxzoom= 1.21f;
|
||||
ar->v2d.minzoom= 0.09f;
|
||||
ar->v2d.maxzoom= 2.31f;
|
||||
|
||||
ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
|
||||
ar->v2d.keepzoom= V2D_LIMITZOOM|V2D_KEEPASPECT;
|
||||
@@ -263,6 +264,7 @@ static void node_buttons_area_draw(const bContext *C, ARegion *ar)
|
||||
static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
{
|
||||
wmKeyMap *keymap;
|
||||
ListBase *lb;
|
||||
|
||||
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
|
||||
|
||||
@@ -272,6 +274,11 @@ static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
|
||||
keymap= WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
|
||||
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
|
||||
|
||||
/* add drop boxes */
|
||||
lb = WM_dropboxmap_find("Node Editor", SPACE_NODE, RGN_TYPE_WINDOW);
|
||||
|
||||
WM_event_add_dropbox_handler(&ar->handlers, lb);
|
||||
}
|
||||
|
||||
static void node_main_area_draw(const bContext *C, ARegion *ar)
|
||||
@@ -281,6 +288,47 @@ static void node_main_area_draw(const bContext *C, ARegion *ar)
|
||||
drawnodespace(C, ar, v2d);
|
||||
}
|
||||
|
||||
|
||||
/* ************* dropboxes ************* */
|
||||
|
||||
static int node_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
||||
{
|
||||
if(drag->type==WM_DRAG_ID) {
|
||||
ID *id= (ID *)drag->poin;
|
||||
if( GS(id->name)==ID_IM )
|
||||
return 1;
|
||||
}
|
||||
else if(drag->type==WM_DRAG_PATH){
|
||||
if(ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void node_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
{
|
||||
ID *id= (ID *)drag->poin;
|
||||
|
||||
if(id) {
|
||||
RNA_string_set(drop->ptr, "name", id->name+2);
|
||||
}
|
||||
if (drag->path[0]) {
|
||||
RNA_string_set(drop->ptr, "path", drag->path);
|
||||
}
|
||||
}
|
||||
|
||||
/* this region dropbox definition */
|
||||
static void node_dropboxes(void)
|
||||
{
|
||||
ListBase *lb= WM_dropboxmap_find("Node Editor", SPACE_NODE, RGN_TYPE_WINDOW);
|
||||
|
||||
WM_dropbox_add(lb, "NODE_OT_add_file", node_drop_poll, node_id_path_drop_copy);
|
||||
|
||||
}
|
||||
|
||||
/* ************* end drop *********** */
|
||||
|
||||
|
||||
/* add handlers, stuff you only do once or on area/region changes */
|
||||
static void node_header_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
{
|
||||
@@ -366,6 +414,7 @@ void ED_spacetype_node(void)
|
||||
st->listener= node_area_listener;
|
||||
st->refresh= node_area_refresh;
|
||||
st->context= node_context;
|
||||
st->dropboxes = node_dropboxes;
|
||||
|
||||
/* regions: main window */
|
||||
art= MEM_callocN(sizeof(ARegionType), "spacetype node region");
|
||||
|
||||
@@ -75,6 +75,8 @@ void outliner_keymap(wmKeyConfig *keyconf)
|
||||
{
|
||||
wmKeyMap *keymap= WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
|
||||
|
||||
RNA_boolean_set(WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "extend", 0);
|
||||
RNA_boolean_set(WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1);
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
|
||||
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
@@ -605,7 +605,7 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot)
|
||||
/* identifiers */
|
||||
ot->name= "Select More";
|
||||
ot->idname= "SEQUENCER_OT_select_more";
|
||||
ot->description="DOC_BROKEN";
|
||||
ot->description="Select more strips adjacent to the current selection";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= sequencer_select_more_exec;
|
||||
@@ -636,7 +636,7 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot)
|
||||
/* identifiers */
|
||||
ot->name= "Select less";
|
||||
ot->idname= "SEQUENCER_OT_select_less";
|
||||
ot->description="DOC_BROKEN";
|
||||
ot->description="Shrink the current selection of adjacent selected strips";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= sequencer_select_less_exec;
|
||||
@@ -726,7 +726,7 @@ void SEQUENCER_OT_select_linked(wmOperatorType *ot)
|
||||
/* identifiers */
|
||||
ot->name= "Select linked";
|
||||
ot->idname= "SEQUENCER_OT_select_linked";
|
||||
ot->description="DOC_BROKEN";
|
||||
ot->description="Select all strips adjacent to the current selection";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= sequencer_select_linked_exec;
|
||||
@@ -813,7 +813,7 @@ void SEQUENCER_OT_select_active_side(wmOperatorType *ot)
|
||||
/* identifiers */
|
||||
ot->name= "Select Active Side";
|
||||
ot->idname= "SEQUENCER_OT_select_active_side";
|
||||
ot->description="DOC_BROKEN";
|
||||
ot->description="Select strips on the nominated side of the active strip";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= sequencer_select_active_side_exec;
|
||||
|
||||
@@ -306,7 +306,7 @@ static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
||||
static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
||||
{
|
||||
if(drag->type==WM_DRAG_PATH)
|
||||
if(ELEM(drag->icon, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
|
||||
if(ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -307,6 +307,8 @@ static void text_keymap(struct wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "TEXT_OT_line_break", RETKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "TEXT_OT_line_break", PADENTER, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_menu(keymap, "TEXT_MT_toolbox", RIGHTMOUSE, KM_PRESS, KM_ANY, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "TEXT_OT_line_number", KM_TEXTINPUT, KM_ANY, KM_ANY, 0);
|
||||
WM_keymap_add_item(keymap, "TEXT_OT_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last!
|
||||
}
|
||||
@@ -334,12 +336,18 @@ static int text_context(const bContext *C, const char *member, bContextDataResul
|
||||
static void text_main_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
{
|
||||
wmKeyMap *keymap;
|
||||
ListBase *lb;
|
||||
|
||||
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
|
||||
|
||||
/* own keymap */
|
||||
keymap= WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0);
|
||||
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
|
||||
|
||||
/* add drop boxes */
|
||||
lb = WM_dropboxmap_find("Text", SPACE_TEXT, RGN_TYPE_WINDOW);
|
||||
|
||||
WM_event_add_dropbox_handler(&ar->handlers, lb);
|
||||
}
|
||||
|
||||
static void text_main_area_draw(const bContext *C, ARegion *ar)
|
||||
@@ -368,6 +376,36 @@ static void text_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
|
||||
WM_cursor_set(win, BC_TEXTEDITCURSOR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ************* dropboxes ************* */
|
||||
|
||||
static int text_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
||||
{
|
||||
if(drag->type==WM_DRAG_PATH)
|
||||
if(ELEM(drag->icon, 0, ICON_FILE_BLANK)) /* rule might not work? */
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void text_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
{
|
||||
/* copy drag path to properties */
|
||||
RNA_string_set(drop->ptr, "path", drag->path);
|
||||
}
|
||||
|
||||
/* this region dropbox definition */
|
||||
static void text_dropboxes(void)
|
||||
{
|
||||
ListBase *lb= WM_dropboxmap_find("Text", SPACE_TEXT, RGN_TYPE_WINDOW);
|
||||
|
||||
WM_dropbox_add(lb, "TEXT_OT_open", text_drop_poll, text_drop_copy);
|
||||
|
||||
}
|
||||
|
||||
/* ************* end drop *********** */
|
||||
|
||||
|
||||
/****************** header region ******************/
|
||||
|
||||
/* add handlers, stuff you only do once or on area/region changes */
|
||||
@@ -413,6 +451,7 @@ void ED_spacetype_text(void)
|
||||
st->keymap= text_keymap;
|
||||
st->listener= text_listener;
|
||||
st->context= text_context;
|
||||
st->dropboxes = text_dropboxes;
|
||||
|
||||
/* regions: main window */
|
||||
art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
|
||||
|
||||
@@ -349,6 +349,11 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
|
||||
}
|
||||
}
|
||||
|
||||
if(i >= 8) {
|
||||
/* fallback, avoid using buffer over-run */
|
||||
i= 0;
|
||||
}
|
||||
|
||||
// printf("i: %d\n", i);
|
||||
// printf("point %f, %f, %f\n", cv[i][0], cv[i][1], cv[i][2]);
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
||||
#include "UI_resources.h"
|
||||
|
||||
#include "view3d_intern.h" // own include
|
||||
|
||||
/* ******************** manage regions ********************* */
|
||||
@@ -411,10 +413,16 @@ static int view3d_mat_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
||||
|
||||
static int view3d_ima_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
|
||||
{
|
||||
if(drag->type==WM_DRAG_ID) {
|
||||
ID *id= (ID *)drag->poin;
|
||||
if( GS(id->name)==ID_IM )
|
||||
return 1;
|
||||
if( ED_view3d_give_base_under_cursor(C, event->mval) ) {
|
||||
if(drag->type==WM_DRAG_ID) {
|
||||
ID *id= (ID *)drag->poin;
|
||||
if( GS(id->name)==ID_IM )
|
||||
return 1;
|
||||
}
|
||||
else if(drag->type==WM_DRAG_PATH){
|
||||
if(ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -435,10 +443,20 @@ static void view3d_ob_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
static void view3d_id_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
{
|
||||
ID *id= (ID *)drag->poin;
|
||||
|
||||
|
||||
RNA_string_set(drop->ptr, "name", id->name+2);
|
||||
}
|
||||
|
||||
static void view3d_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
{
|
||||
ID *id= (ID *)drag->poin;
|
||||
|
||||
if(id)
|
||||
RNA_string_set(drop->ptr, "name", id->name+2);
|
||||
if(drag->path[0])
|
||||
RNA_string_set(drop->ptr, "path", drag->path);
|
||||
}
|
||||
|
||||
|
||||
/* region dropbox definition */
|
||||
static void view3d_dropboxes(void)
|
||||
@@ -447,7 +465,7 @@ static void view3d_dropboxes(void)
|
||||
|
||||
WM_dropbox_add(lb, "OBJECT_OT_add_named_cursor", view3d_ob_drop_poll, view3d_ob_drop_copy);
|
||||
WM_dropbox_add(lb, "OBJECT_OT_drop_named_material", view3d_mat_drop_poll, view3d_id_drop_copy);
|
||||
WM_dropbox_add(lb, "MESH_OT_drop_named_image", view3d_ima_drop_poll, view3d_id_drop_copy);
|
||||
WM_dropbox_add(lb, "MESH_OT_drop_named_image", view3d_ima_drop_poll, view3d_id_path_drop_copy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ void UV_OT_minimize_stretch(wmOperatorType *ot)
|
||||
ot->name= "Minimize Stretch";
|
||||
ot->idname= "UV_OT_minimize_stretch";
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
ot->description="DOC_BROKEN";
|
||||
ot->description="Reduce UV stretching by relaxing angles";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= minimize_stretch_exec;
|
||||
|
||||
@@ -133,7 +133,7 @@ typedef struct Scopes {
|
||||
} Scopes;
|
||||
|
||||
/* scopes->wavefrm_mode */
|
||||
#define SCOPES_WAVEFRM_LUM 0
|
||||
#define SCOPES_WAVEFRM_LUMA 0
|
||||
#define SCOPES_WAVEFRM_RGB 1
|
||||
#define SCOPES_WAVEFRM_YCC_601 2
|
||||
#define SCOPES_WAVEFRM_YCC_709 3
|
||||
|
||||
@@ -496,9 +496,10 @@ extern Object workob;
|
||||
#define OB_ADDCONT 512
|
||||
#define OB_ADDACT 1024
|
||||
#define OB_SHOWCONT 2048
|
||||
#define OB_SETSTBIT 4096
|
||||
#define OB_ALLSTATE 4096
|
||||
#define OB_INITSTBIT 8192
|
||||
#define OB_DEBUGSTATE 16384
|
||||
#define OB_SHOWSTATE 32768
|
||||
|
||||
/* ob->restrictflag */
|
||||
#define OB_RESTRICT_VIEW 1
|
||||
|
||||
@@ -260,8 +260,7 @@ typedef struct bJoystickSensor {
|
||||
* ... The reason for this is that we need to be backward compatible,
|
||||
* and have a proper default value for this thing.
|
||||
* */
|
||||
/* #define SENS_COLLISION_PROPERTY 0 */
|
||||
#define SENS_COLLISION_PROPERTY 0 // uncommenting to use with RNA/UI. will check if it's working/fix it later - dfelinto
|
||||
#define SENS_COLLISION_PROPERTY 0
|
||||
#define SENS_COLLISION_MATERIAL 1
|
||||
#define SENS_COLLISION_PULSE 2
|
||||
|
||||
|
||||
@@ -665,6 +665,7 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name);
|
||||
void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free);
|
||||
int RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value);
|
||||
int RNA_property_enum_identifier(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier);
|
||||
int RNA_property_enum_name(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name);
|
||||
int RNA_property_enum_bitflag_identifiers(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier);
|
||||
|
||||
StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop);
|
||||
|
||||
@@ -343,6 +343,9 @@ typedef struct ExtensionRNA {
|
||||
#define MainGroups Main
|
||||
#define MainTextures Main
|
||||
#define MainCurves Main
|
||||
#define MainBrushes Main
|
||||
#define MainLattices Main
|
||||
#define MainMetaBall Main
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1101,6 +1101,22 @@ int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name)
|
||||
{
|
||||
EnumPropertyItem *item= NULL;
|
||||
int result, free;
|
||||
|
||||
RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
|
||||
if(item) {
|
||||
result= RNA_enum_name(item, value, name);
|
||||
if(free)
|
||||
MEM_freeN(item);
|
||||
|
||||
return result;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
|
||||
{
|
||||
EnumPropertyItem *item= NULL;
|
||||
|
||||
@@ -27,21 +27,23 @@
|
||||
#include "RNA_define.h"
|
||||
|
||||
#include "rna_internal.h"
|
||||
#include "DNA_constraint_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_actuator_types.h"
|
||||
#include "DNA_scene_types.h" // for MAXFRAME
|
||||
|
||||
#include "WM_types.h"
|
||||
|
||||
/* Always keep in alphabetical order */
|
||||
EnumPropertyItem actuator_type_items[] ={
|
||||
{ACT_ACTION, "ACTION", 0, "Action", ""},
|
||||
{ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
|
||||
{ACT_CAMERA, "CAMERA", 0, "Camera", ""},
|
||||
{ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
|
||||
{ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""},
|
||||
{ACT_2DFILTER, "FILTER_2D", 0, "2D Filter", ""},
|
||||
{ACT_GAME, "GAME", 0, "Game", ""},
|
||||
{ACT_IPO, "F-Curve", 0, "F-Curve", ""},
|
||||
{ACT_2DFILTER, "FILTER_2D", 0, "Filter 2D", ""},
|
||||
{ACT_GAME, "GAME", 0, "Game", ""},
|
||||
{ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
|
||||
{ACT_OBJECT, "OBJECT", 0, "Motion", ""},
|
||||
{ACT_PARENT, "PARENT", 0, "Parent", ""},
|
||||
@@ -366,6 +368,7 @@ static EnumPropertyItem *rna_EditObjectActuator_mode_itemf(bContext *C, PointerR
|
||||
return item;
|
||||
}
|
||||
|
||||
/* Always keep in alphabetical order */
|
||||
EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *free)
|
||||
{
|
||||
EnumPropertyItem *item= NULL;
|
||||
@@ -389,9 +392,9 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *fre
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_IPO);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_2DFILTER);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_GAME);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_IPO);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_MESSAGE);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_OBJECT);
|
||||
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_PARENT);
|
||||
@@ -415,6 +418,40 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, int *fre
|
||||
return item;
|
||||
}
|
||||
|
||||
static void rna_Actuator_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bActuator *act= (bActuator *)ptr->data;
|
||||
bArmatureActuator *aa = act->data;
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
|
||||
char *posechannel= aa->posechannel;
|
||||
char *constraint= aa->constraint;
|
||||
|
||||
/* check that bone exist in the active object */
|
||||
if (ob->type == OB_ARMATURE && ob->pose) {
|
||||
bPoseChannel *pchan;
|
||||
bPose *pose = ob->pose;
|
||||
for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
|
||||
if (!strcmp(pchan->name, posechannel)) {
|
||||
/* found it, now look for constraint channel */
|
||||
bConstraint *con;
|
||||
for (con=pchan->constraints.first; con; con=con->next) {
|
||||
if (!strcmp(con->name, constraint)) {
|
||||
/* found it, all ok */
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* didn't find constraint, make empty */
|
||||
constraint[0] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* didn't find any */
|
||||
posechannel[0] = 0;
|
||||
constraint[0] = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void rna_def_actuator(BlenderRNA *brna)
|
||||
@@ -429,6 +466,7 @@ void rna_def_actuator(BlenderRNA *brna)
|
||||
|
||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Name", "");
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
|
||||
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
@@ -1287,8 +1325,9 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Scene", "");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
//XXX filter only camera objects
|
||||
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Camera");
|
||||
RNA_def_property_struct_type(prop, "Object");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Camera Object", "Set this Camera. Leave empty to refer to self object");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
@@ -1589,7 +1628,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
|
||||
RNA_def_property_range(prop, 0, 99); //MAX_RENDER_PASS-1
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "motion_blur_value", PROP_FLOAT, PROP_PERCENTAGE);
|
||||
prop= RNA_def_property(srna, "motion_blur_value", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "float_arg");
|
||||
RNA_def_property_ui_text(prop, "Value", "Set motion blur value");
|
||||
RNA_def_property_range(prop, 0.0, 1.0);
|
||||
@@ -1598,7 +1637,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
|
||||
/* booleans */
|
||||
prop= RNA_def_property(srna, "enable_motion_blur", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
|
||||
RNA_def_property_ui_text(prop, "D", "Enable/Disable Motion Blur");
|
||||
RNA_def_property_ui_text(prop, "Enable", "Enable/Disable Motion Blur");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
}
|
||||
|
||||
@@ -1755,11 +1794,11 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
|
||||
PropertyRNA* prop;
|
||||
|
||||
static EnumPropertyItem prop_type_items[] ={
|
||||
{ACT_ARM_RUN, "RUN", 0, "Run armature", ""},
|
||||
{ACT_ARM_RUN, "RUN", 0, "Run Armature", ""},
|
||||
{ACT_ARM_ENABLE, "ENABLE", 0, "Enable", ""},
|
||||
{ACT_ARM_DISABLE, "DISABLE", 0, "Disable", ""},
|
||||
{ACT_ARM_SETTARGET, "SETTARGET", 0, "Set target", ""},
|
||||
{ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set weight", ""},
|
||||
{ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""},
|
||||
{ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator");
|
||||
@@ -1775,18 +1814,12 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
|
||||
prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "posechannel");
|
||||
RNA_def_property_ui_text(prop, "Bone", "Bone on which the constraint is defined");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
// XXX uiButSetFunc(but, check_armature_actuator, but, armAct); // the bone must be from the armature
|
||||
/* XXX eventually move to a datablock pointer. However datablocking this may be a problem
|
||||
we would need to update the value whenever the armature changes. */
|
||||
RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
|
||||
|
||||
prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "constraint");
|
||||
RNA_def_property_ui_text(prop, "Constraint", "Name of the constraint you want to control");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
// XXX uiButSetFunc(but, check_armature_actuator, but, armAct); // the constraintbone must be from the armature
|
||||
/* XXX eventually move to a datablock pointer.
|
||||
(more likely to work than for the Bone in my opinion) */
|
||||
RNA_def_property_update(prop, NC_LOGIC, "rna_Actuator_Armature_update");
|
||||
|
||||
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "Object");
|
||||
@@ -1818,7 +1851,7 @@ void RNA_def_actuator(BlenderRNA *brna)
|
||||
rna_def_camera_actuator(brna);
|
||||
rna_def_sound_actuator(brna);
|
||||
rna_def_property_actuator(brna);
|
||||
rna_def_constraint_actuator(brna); // to be done
|
||||
rna_def_constraint_actuator(brna);
|
||||
rna_def_edit_object_actuator(brna);
|
||||
rna_def_scene_actuator(brna);
|
||||
rna_def_random_actuator(brna);
|
||||
|
||||
@@ -453,10 +453,10 @@ static void rna_def_histogram(BlenderRNA *brna)
|
||||
|
||||
static EnumPropertyItem prop_mode_items[] = {
|
||||
{HISTO_MODE_LUMA, "Luma", ICON_COLOR, "Luma", ""},
|
||||
{HISTO_MODE_RGB, "RGB", ICON_COLOR, "RGB", ""},
|
||||
{HISTO_MODE_R, "R", ICON_COLOR, "R", ""},
|
||||
{HISTO_MODE_G, "G", ICON_COLOR, "G", ""},
|
||||
{HISTO_MODE_B, "B", ICON_COLOR, "B", ""},
|
||||
{HISTO_MODE_RGB, "RGB", ICON_COLOR, "Red Green Blue", ""},
|
||||
{HISTO_MODE_R, "R", ICON_COLOR, "Red", ""},
|
||||
{HISTO_MODE_G, "G", ICON_COLOR, "Green", ""},
|
||||
{HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "Histogram", NULL);
|
||||
@@ -475,7 +475,7 @@ static void rna_def_scopes(BlenderRNA *brna)
|
||||
PropertyRNA *prop;
|
||||
|
||||
static EnumPropertyItem prop_wavefrm_mode_items[] = {
|
||||
{SCOPES_WAVEFRM_LUM, "LUMINANCE", ICON_COLOR, "Luminance", ""},
|
||||
{SCOPES_WAVEFRM_LUMA, "LUMA", ICON_COLOR, "Luma", ""},
|
||||
{SCOPES_WAVEFRM_RGB, "RGB", ICON_COLOR, "Red Green Blue", ""},
|
||||
{SCOPES_WAVEFRM_YCC_601, "YCBCR601", ICON_COLOR, "YCbCr (ITU 601)", ""},
|
||||
{SCOPES_WAVEFRM_YCC_709, "YCBCR709", ICON_COLOR, "YCbCr (ITU 709)", ""},
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
#include "BKE_text.h"
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_group.h"
|
||||
#include "BKE_brush.h"
|
||||
#include "BKE_lattice.h"
|
||||
#include "BKE_mball.h"
|
||||
|
||||
#include "DNA_armature_types.h"
|
||||
#include "DNA_camera_types.h"
|
||||
@@ -61,6 +64,9 @@
|
||||
#include "DNA_text_types.h"
|
||||
#include "DNA_texture_types.h"
|
||||
#include "DNA_group_types.h"
|
||||
#include "DNA_brush_types.h"
|
||||
#include "DNA_lattice_types.h"
|
||||
#include "DNA_meta_types.h"
|
||||
|
||||
#include "ED_screen.h"
|
||||
|
||||
@@ -243,6 +249,20 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
|
||||
/* XXX python now has invalid pointer? */
|
||||
}
|
||||
|
||||
Lattice *rna_Main_lattices_new(Main *bmain, char* name)
|
||||
{
|
||||
Lattice *lt= add_lattice(name);
|
||||
lt->id.us--;
|
||||
return lt;
|
||||
}
|
||||
void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *lt)
|
||||
{
|
||||
if(ID_REAL_USERS(lt) <= 0)
|
||||
free_libblock(&bmain->latt, lt);
|
||||
else
|
||||
BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d.", lt->id.name+2, ID_REAL_USERS(lt));
|
||||
}
|
||||
|
||||
Curve *rna_Main_curves_new(Main *bmain, char* name, int type)
|
||||
{
|
||||
Curve *cu= add_curve(name, type);
|
||||
@@ -257,6 +277,20 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
|
||||
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu));
|
||||
}
|
||||
|
||||
MetaBall *rna_Main_metaballs_new(Main *bmain, char* name)
|
||||
{
|
||||
MetaBall *mb= add_mball(name);
|
||||
mb->id.us--;
|
||||
return mb;
|
||||
}
|
||||
void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall *mb)
|
||||
{
|
||||
if(ID_REAL_USERS(mb) <= 0)
|
||||
free_libblock(&bmain->mball, mb);
|
||||
else
|
||||
BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb));
|
||||
}
|
||||
|
||||
Tex *rna_Main_textures_new(Main *bmain, char* name)
|
||||
{
|
||||
Tex *tex= add_texture(name);
|
||||
@@ -271,6 +305,20 @@ void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
|
||||
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex));
|
||||
}
|
||||
|
||||
Brush *rna_Main_brushes_new(Main *bmain, char* name)
|
||||
{
|
||||
Brush *brush = add_brush(name);
|
||||
brush->id.us--;
|
||||
return brush;
|
||||
}
|
||||
void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *brush)
|
||||
{
|
||||
if(ID_REAL_USERS(brush) <= 0)
|
||||
free_libblock(&bmain->brush, brush);
|
||||
else
|
||||
BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d.", brush->id.name+2, ID_REAL_USERS(brush));
|
||||
}
|
||||
|
||||
Group *rna_Main_groups_new(Main *bmain, char* name)
|
||||
{
|
||||
return add_group(name);
|
||||
@@ -562,7 +610,27 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
|
||||
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
StructRNA *srna;
|
||||
FunctionRNA *func;
|
||||
PropertyRNA *parm;
|
||||
|
||||
RNA_def_property_srna(cprop, "MainLattices");
|
||||
srna= RNA_def_struct(brna, "MainLattices", NULL);
|
||||
RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
|
||||
|
||||
func= RNA_def_function(srna, "new", "rna_Main_lattices_new");
|
||||
RNA_def_function_ui_description(func, "Add a new lattice to the main database");
|
||||
parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
/* return type */
|
||||
parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock.");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
|
||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile.");
|
||||
parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
}
|
||||
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
@@ -592,7 +660,27 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
}
|
||||
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
StructRNA *srna;
|
||||
FunctionRNA *func;
|
||||
PropertyRNA *parm;
|
||||
|
||||
RNA_def_property_srna(cprop, "MainMetaBall");
|
||||
srna= RNA_def_struct(brna, "MainMetaBall", NULL);
|
||||
RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs");
|
||||
|
||||
func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
|
||||
RNA_def_function_ui_description(func, "Add a new metaball to the main database");
|
||||
parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
/* return type */
|
||||
parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock.");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
|
||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||
RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile.");
|
||||
parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
}
|
||||
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
@@ -624,7 +712,27 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
}
|
||||
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
StructRNA *srna;
|
||||
FunctionRNA *func;
|
||||
PropertyRNA *parm;
|
||||
|
||||
RNA_def_property_srna(cprop, "MainBrushes");
|
||||
srna= RNA_def_struct(brna, "MainBrushes", NULL);
|
||||
RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
|
||||
|
||||
func= RNA_def_function(srna, "new", "rna_Main_brushes_new");
|
||||
RNA_def_function_ui_description(func, "Add a new brush to the main database");
|
||||
parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
/* return type */
|
||||
parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock.");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
|
||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile.");
|
||||
parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
}
|
||||
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
|
||||
@@ -1273,6 +1273,16 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
|
||||
prop= RNA_def_property(srna, "debug_state", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE);
|
||||
RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine");
|
||||
RNA_def_property_ui_icon(prop, ICON_INFO, 0);
|
||||
|
||||
prop= RNA_def_property(srna, "all_states", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_ALLSTATE);
|
||||
RNA_def_property_ui_text(prop, "All", "Set all state bits");
|
||||
|
||||
prop= RNA_def_property(srna, "show_state_panel", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSTATE);
|
||||
RNA_def_property_ui_text(prop, "States", "Show state panel");
|
||||
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
|
||||
}
|
||||
|
||||
static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
|
||||
@@ -749,7 +749,7 @@ static void rna_def_pointcache(BlenderRNA *brna)
|
||||
|
||||
prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH);
|
||||
RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked indo another file.");
|
||||
RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file.");
|
||||
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
|
||||
|
||||
prop= RNA_def_property(srna, "point_cache_list", PROP_COLLECTION, PROP_NONE);
|
||||
|
||||
@@ -29,11 +29,13 @@
|
||||
|
||||
#include "rna_internal.h"
|
||||
|
||||
#include "DNA_constraint_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_sensor_types.h"
|
||||
|
||||
#include "WM_types.h"
|
||||
|
||||
/* Always keep in alphabetical order */
|
||||
EnumPropertyItem sensor_type_items[] ={
|
||||
{SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
|
||||
{SENS_ALWAYS, "ALWAYS", 0, "Always", ""},
|
||||
@@ -106,6 +108,7 @@ static void rna_Sensor_type_set(struct PointerRNA *ptr, int value)
|
||||
}
|
||||
}
|
||||
|
||||
/* Always keep in alphabetical order */
|
||||
EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, int *free)
|
||||
{
|
||||
EnumPropertyItem *item= NULL;
|
||||
@@ -180,6 +183,58 @@ static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
|
||||
ks->qual2 = value;
|
||||
}
|
||||
|
||||
static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value)
|
||||
{
|
||||
bSensor *sens= (bSensor*)ptr->data;
|
||||
|
||||
sens->tap = value;
|
||||
if(sens->tap == 1)
|
||||
sens->level = 0;
|
||||
}
|
||||
|
||||
static void rna_Sensor_level_set(struct PointerRNA *ptr, int value)
|
||||
{
|
||||
bSensor *sens= (bSensor*)ptr->data;
|
||||
|
||||
sens->level = value;
|
||||
if(sens->level == 1)
|
||||
sens->tap = 0;
|
||||
}
|
||||
|
||||
static void rna_Sensor_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
bSensor *sens= (bSensor *)ptr->data;
|
||||
bArmatureSensor *as = sens->data;
|
||||
Object *ob = (Object *)ptr->id.data;
|
||||
|
||||
char *posechannel= as->posechannel;
|
||||
char *constraint= as->constraint;
|
||||
|
||||
/* check that bone exist in the active object */
|
||||
if (ob->type == OB_ARMATURE && ob->pose) {
|
||||
bPoseChannel *pchan;
|
||||
bPose *pose = ob->pose;
|
||||
for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
|
||||
if (!strcmp(pchan->name, posechannel)) {
|
||||
/* found it, now look for constraint channel */
|
||||
bConstraint *con;
|
||||
for (con=pchan->constraints.first; con; con=con->next) {
|
||||
if (!strcmp(con->name, constraint)) {
|
||||
/* found it, all ok */
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* didn't find constraint, make empty */
|
||||
constraint[0] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* didn't find any */
|
||||
posechannel[0] = 0;
|
||||
constraint[0] = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void rna_def_sensor(BlenderRNA *brna)
|
||||
@@ -216,6 +271,7 @@ static void rna_def_sensor(BlenderRNA *brna)
|
||||
|
||||
prop= RNA_def_property(srna, "level", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Level", "Level detector, trigger controllers of new states(only applicable upon logic state transition)");
|
||||
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "pulse_true_level", PROP_BOOLEAN, PROP_NONE);
|
||||
@@ -234,8 +290,9 @@ static void rna_def_sensor(BlenderRNA *brna)
|
||||
RNA_def_property_range(prop, 0, 10000);
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "tap", PROP_BOOLEAN, PROP_NONE);\
|
||||
prop= RNA_def_property(srna, "tap", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "tap", 1);
|
||||
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set");
|
||||
RNA_def_property_ui_text(prop, "Tap", "Trigger controllers only for an instant, even while the sensor remains true");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
}
|
||||
@@ -429,15 +486,15 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Test Type", "Type of value and test");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "channel_name", PROP_STRING, PROP_NONE);
|
||||
prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "posechannel");
|
||||
RNA_def_property_ui_text(prop, "Bone name", "Identify the bone to check value from");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
|
||||
|
||||
prop= RNA_def_property(srna, "constraint_name", PROP_STRING, PROP_NONE);
|
||||
prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "constraint");
|
||||
RNA_def_property_ui_text(prop, "Constraint name", "Identify the bone constraint to check value from");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
|
||||
|
||||
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "value");
|
||||
@@ -592,10 +649,21 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
|
||||
{SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""},
|
||||
{SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
static const EnumPropertyItem prop_ray_type_items[]= {
|
||||
{SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"},
|
||||
{SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "RaySensor", "Sensor");
|
||||
RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
|
||||
RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
|
||||
|
||||
prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
|
||||
RNA_def_property_enum_items(prop, prop_ray_type_items);
|
||||
RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "propname");
|
||||
@@ -616,11 +684,6 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
|
||||
*/
|
||||
|
||||
prop= RNA_def_property(srna, "ray_type", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL);
|
||||
RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "x_ray_mode", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
|
||||
RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)");
|
||||
|
||||
@@ -2129,7 +2129,7 @@ static void rna_def_space_logic(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "sensors_show_active_states", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
|
||||
RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
@@ -2148,12 +2148,6 @@ static void rna_def_space_logic(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
|
||||
RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "controllers_show_initial_state", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_INIT_STATE);
|
||||
RNA_def_property_ui_text(prop, "Show Initial State", "Show the initial controller state for this object");
|
||||
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
/* actuators */
|
||||
prop= RNA_def_property(srna, "actuators_show_selected_objects", PROP_BOOLEAN, PROP_NONE);
|
||||
@@ -2172,7 +2166,7 @@ static void rna_def_space_logic(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "actuators_show_active_states", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
|
||||
RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
|
||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||
|
||||
|
||||
@@ -283,8 +283,10 @@ static void copyData(ModifierData *md, ModifierData *target)
|
||||
tsmd->mode = smd->mode;
|
||||
tsmd->axis = smd->axis;
|
||||
tsmd->origin= smd->origin;
|
||||
tsmd->originOpts= smd->originOpts;
|
||||
tsmd->factor= smd->factor;
|
||||
memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit));
|
||||
strcpy(tsmd->vgroup_name, smd->vgroup_name);
|
||||
}
|
||||
|
||||
static CustomDataMask requiredDataMask(Object *ob, ModifierData *md)
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#include "stddef.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BKE_cdderivedmesh.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_smoke.h"
|
||||
@@ -52,6 +54,14 @@ static void initData(ModifierData *md)
|
||||
smd->time = -1;
|
||||
}
|
||||
|
||||
static void copyData(ModifierData *md, ModifierData *target)
|
||||
{
|
||||
SmokeModifierData *smd = (SmokeModifierData*)md;
|
||||
SmokeModifierData *tsmd = (SmokeModifierData*)target;
|
||||
|
||||
smokeModifier_copy(smd, tsmd);
|
||||
}
|
||||
|
||||
static void freeData(ModifierData *md)
|
||||
{
|
||||
SmokeModifierData *smd = (SmokeModifierData*) md;
|
||||
@@ -117,7 +127,7 @@ ModifierTypeInfo modifierType_Smoke = {
|
||||
| eModifierTypeFlag_UsesPointCache
|
||||
| eModifierTypeFlag_Single,
|
||||
|
||||
/* copyData */ 0,
|
||||
/* copyData */ copyData,
|
||||
/* deformVerts */ deformVerts,
|
||||
/* deformVertsEM */ 0,
|
||||
/* deformMatricesEM */ 0,
|
||||
|
||||
@@ -117,30 +117,6 @@ DerivedMesh *get_cddm(struct Scene *scene, Object *ob, struct EditMesh *em, Deri
|
||||
return dm;
|
||||
}
|
||||
|
||||
|
||||
static int is_last_displist(Object *ob)
|
||||
{
|
||||
Curve *cu = ob->data;
|
||||
static int curvecount=0, totcurve=0;
|
||||
|
||||
if(curvecount == 0){
|
||||
DispList *dl;
|
||||
|
||||
totcurve = 0;
|
||||
for(dl=cu->disp.first; dl; dl=dl->next)
|
||||
totcurve++;
|
||||
}
|
||||
|
||||
curvecount++;
|
||||
|
||||
if(curvecount == totcurve){
|
||||
curvecount = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* returns a derived mesh if dm == NULL, for deforming modifiers that need it */
|
||||
DerivedMesh *get_dm(struct Scene *scene, Object *ob, struct EditMesh *em, DerivedMesh *dm, float (*vertexCos)[3], int orco)
|
||||
{
|
||||
@@ -160,9 +136,7 @@ DerivedMesh *get_dm(struct Scene *scene, Object *ob, struct EditMesh *em, Derive
|
||||
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob));
|
||||
}
|
||||
else if(ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) {
|
||||
if(is_last_displist(ob)) {
|
||||
dm= CDDM_from_curve(ob);
|
||||
}
|
||||
dm= CDDM_from_curve(ob);
|
||||
}
|
||||
|
||||
return dm;
|
||||
|
||||
@@ -290,6 +290,9 @@ def rna2sphinx(BASEPATH):
|
||||
fw("copyright = u'Blender Foundation'\n")
|
||||
fw("version = '%s - UNSTABLE API'\n" % version_string)
|
||||
fw("release = '%s - UNSTABLE API'\n" % version_string)
|
||||
fw("html_theme = 'blender-org'\n")
|
||||
fw("html_theme_path = ['../']\n")
|
||||
fw("html_favicon = 'favicon.ico'\n")
|
||||
# not helpful since the source us generated, adds to upload size.
|
||||
fw("html_copy_source = False\n")
|
||||
fw("\n")
|
||||
@@ -681,6 +684,9 @@ if __name__ == '__main__':
|
||||
# only for partial updates
|
||||
path_in_tmp = path_in + "-tmp"
|
||||
|
||||
if not os.path.exists(path_in):
|
||||
os.mkdir(path_in)
|
||||
|
||||
for f in os.listdir(path_examples):
|
||||
if f.endswith(".py"):
|
||||
EXAMPLE_SET.add(os.path.splitext(f)[0])
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
#include "bpy_app.h"
|
||||
#include "bpy_props.h"
|
||||
#include "bpy_operator.h"
|
||||
|
||||
|
||||
#include "BLI_path_util.h"
|
||||
#include "BLI_bpath.h"
|
||||
|
||||
/* external util modules */
|
||||
#include "../generic/geometry.h"
|
||||
@@ -45,7 +46,7 @@
|
||||
static char bpy_home_paths_doc[] =
|
||||
".. function:: home_paths(subfolder)\n"
|
||||
"\n"
|
||||
" return 3 paths to blender home directories.\n"
|
||||
" Return 3 paths to blender home directories.\n"
|
||||
"\n"
|
||||
" :arg subfolder: The name of a subfolder to find within the blenders home directory.\n"
|
||||
" :type subfolder: string\n"
|
||||
@@ -73,7 +74,56 @@ PyObject *bpy_home_paths(PyObject *self, PyObject *args)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char bpy_blend_paths_doc[] =
|
||||
".. function:: blend_paths(absolute=False)\n"
|
||||
"\n"
|
||||
" Returns a list of paths assosiated with this blend file.\n"
|
||||
"\n"
|
||||
" :arg absolute: When true the paths returned are made absolute.\n"
|
||||
" :type absolute: boolean\n"
|
||||
" :return: path list.\n"
|
||||
" :rtype: list of strigs\n";
|
||||
static PyObject *bpy_blend_paths(PyObject * self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
struct BPathIterator bpi;
|
||||
PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */
|
||||
/* be sure there is low chance of the path being too short */
|
||||
char filepath_expanded[1024];
|
||||
char *lib;
|
||||
|
||||
int absolute = 0;
|
||||
static char *kwlist[] = {"absolute", NULL};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "|i:blend_paths", kwlist, &absolute))
|
||||
return NULL;
|
||||
|
||||
for(BLI_bpathIterator_init(&bpi, NULL); !BLI_bpathIterator_isDone(&bpi); BLI_bpathIterator_step(&bpi)) {
|
||||
/* build the list */
|
||||
if (absolute) {
|
||||
BLI_bpathIterator_getPathExpanded(&bpi, filepath_expanded);
|
||||
}
|
||||
else {
|
||||
lib = BLI_bpathIterator_getLib(&bpi);
|
||||
if (lib && (strcmp(lib, bpi.base_path))) { /* relative path to the library is NOT the same as our blendfile path, return an absolute path */
|
||||
BLI_bpathIterator_getPathExpanded(&bpi, filepath_expanded);
|
||||
}
|
||||
else {
|
||||
BLI_bpathIterator_getPath(&bpi, filepath_expanded);
|
||||
}
|
||||
}
|
||||
st = PyUnicode_FromString(filepath_expanded);
|
||||
|
||||
PyList_Append(list, st);
|
||||
Py_DECREF(st);
|
||||
}
|
||||
|
||||
BLI_bpathIterator_free(&bpi);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
static PyMethodDef meth_bpy_home_paths[] = {{ "home_paths", (PyCFunction)bpy_home_paths, METH_VARARGS, bpy_home_paths_doc}};
|
||||
static PyMethodDef meth_bpy_blend_paths[] = {{ "blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}};
|
||||
|
||||
static void bpy_import_test(char *modname)
|
||||
{
|
||||
@@ -141,6 +191,7 @@ void BPy_init_modules( void )
|
||||
|
||||
/* utility func's that have nowhere else to go */
|
||||
PyModule_AddObject(mod, meth_bpy_home_paths->ml_name, (PyObject *)PyCFunction_New(meth_bpy_home_paths, NULL));
|
||||
PyModule_AddObject(mod, meth_bpy_blend_paths->ml_name, (PyObject *)PyCFunction_New(meth_bpy_blend_paths, NULL));
|
||||
|
||||
/* add our own modules dir, this is a python package */
|
||||
bpy_import_test("bpy");
|
||||
|
||||
@@ -1794,7 +1794,7 @@ static PyObject *pyrna_struct_values(BPy_PropertyRNA *self)
|
||||
}
|
||||
|
||||
/* for keyframes and drivers */
|
||||
static int pyrna_struct_anim_args_parse(PointerRNA *ptr, char *error_prefix, char *path,
|
||||
static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefix, const char *path,
|
||||
char **path_full, int *index)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -1844,15 +1844,15 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, char *error_prefix, cha
|
||||
}
|
||||
|
||||
/* internal use for insert and delete */
|
||||
static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, char *error_prefix,
|
||||
static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
|
||||
char **path_full, int *index, float *cfra, char **group_name) /* return values */
|
||||
{
|
||||
static char *kwlist[] = {"path", "index", "frame", "group", NULL};
|
||||
char *path;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s|ifs", &path, index, cfra, group_name)) {
|
||||
PyErr_Format(PyExc_TypeError, "%.200s expected a string and optionally an int, float, and string arguments", error_prefix);
|
||||
/* note, parse_str MUST start with 's|ifs' */
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw, parse_str, (char **)kwlist, &path, index, cfra, group_name))
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(pyrna_struct_anim_args_parse(ptr, error_prefix, path, path_full, index) < 0)
|
||||
return -1;
|
||||
@@ -1879,7 +1879,7 @@ static char pyrna_struct_keyframe_insert_doc[] =
|
||||
" :return: Success of keyframe insertion.\n"
|
||||
" :rtype: boolean";
|
||||
|
||||
static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args)
|
||||
static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
PyObject *result;
|
||||
/* args, pyrna_struct_keyframe_parse handles these */
|
||||
@@ -1888,7 +1888,7 @@ static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *arg
|
||||
float cfra= FLT_MAX;
|
||||
char *group_name= NULL;
|
||||
|
||||
if(pyrna_struct_keyframe_parse(&self->ptr, args, "bpy_struct.keyframe_insert():", &path_full, &index, &cfra, &group_name) == -1)
|
||||
if(pyrna_struct_keyframe_parse(&self->ptr, args, kw, "s|ifs:bpy_struct.keyframe_insert()", "bpy_struct.keyframe_insert()", &path_full, &index, &cfra, &group_name) == -1)
|
||||
return NULL;
|
||||
|
||||
result= PyBool_FromLong(insert_keyframe((ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, 0));
|
||||
@@ -1913,7 +1913,7 @@ static char pyrna_struct_keyframe_delete_doc[] =
|
||||
" :return: Success of keyframe deleation.\n"
|
||||
" :rtype: boolean";
|
||||
|
||||
static PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args)
|
||||
static PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
PyObject *result;
|
||||
/* args, pyrna_struct_keyframe_parse handles these */
|
||||
@@ -1922,7 +1922,7 @@ static PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *arg
|
||||
float cfra= FLT_MAX;
|
||||
char *group_name= NULL;
|
||||
|
||||
if(pyrna_struct_keyframe_parse(&self->ptr, args, "bpy_struct.keyframe_delete():", &path_full, &index, &cfra, &group_name) == -1)
|
||||
if(pyrna_struct_keyframe_parse(&self->ptr, args, kw, "s|ifs:bpy_struct.keyframe_delete()", "bpy_struct.keyframe_insert()", &path_full, &index, &cfra, &group_name) == -1)
|
||||
return NULL;
|
||||
|
||||
result= PyBool_FromLong(delete_keyframe((ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, 0));
|
||||
@@ -3002,8 +3002,8 @@ static struct PyMethodDef pyrna_struct_methods[] = {
|
||||
|
||||
{"as_pointer", (PyCFunction)pyrna_struct_as_pointer, METH_NOARGS, pyrna_struct_as_pointer_doc},
|
||||
|
||||
{"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS, pyrna_struct_keyframe_insert_doc},
|
||||
{"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS, pyrna_struct_keyframe_delete_doc},
|
||||
{"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS|METH_KEYWORDS, pyrna_struct_keyframe_insert_doc},
|
||||
{"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS|METH_KEYWORDS, pyrna_struct_keyframe_delete_doc},
|
||||
{"driver_add", (PyCFunction)pyrna_struct_driver_add, METH_VARARGS, pyrna_struct_driver_add_doc},
|
||||
{"driver_remove", (PyCFunction)pyrna_struct_driver_remove, METH_VARARGS, pyrna_struct_driver_remove_doc},
|
||||
{"is_property_set", (PyCFunction)pyrna_struct_is_property_set, METH_VARARGS, pyrna_struct_is_property_set_doc},
|
||||
|
||||
@@ -225,7 +225,7 @@ static int print_help(int argc, char **argv, void *data)
|
||||
printf (" \tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
|
||||
printf (" -x <bool>\tSet option to add the file extension to the end of the file.\n");
|
||||
printf (" -t <threads>\tUse amount of <threads> for rendering (background mode only).\n");
|
||||
printf (" [1-8], 0 for systems processor count.\n");
|
||||
printf (" [1-%d], 0 for systems processor count.\n", BLENDER_MAX_THREADS);
|
||||
printf ("\nAnimation playback options:\n");
|
||||
printf (" -a <options> <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
|
||||
printf (" -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
|
||||
|
||||
Reference in New Issue
Block a user