Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2009-10-23 03:22:05 +0400
committerJoseph Eagar <joeedh@gmail.com>2009-10-23 03:22:05 +0400
commit8f788c64db587e74079d812dbcea40c2bd4b91ff (patch)
treec767e8318a9e7aded16be6cab2042f3ea11e7912 /source/blender/makesrna
parent36bb566d4e6e06e08d782d610d60d755cbda2396 (diff)
merge with trunk/2.5 at r23876
[[Split portion of a mixed commit.]]
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h30
-rw-r--r--source/blender/makesrna/RNA_define.h2
-rw-r--r--source/blender/makesrna/RNA_enum_types.h13
-rw-r--r--source/blender/makesrna/RNA_types.h66
-rw-r--r--source/blender/makesrna/SConscript10
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt6
-rw-r--r--source/blender/makesrna/intern/Makefile1
-rw-r--r--source/blender/makesrna/intern/SConscript14
-rw-r--r--source/blender/makesrna/intern/makesrna.c21
-rw-r--r--source/blender/makesrna/intern/rna_ID.c53
-rw-r--r--source/blender/makesrna/intern/rna_access.c46
-rw-r--r--source/blender/makesrna/intern/rna_action.c2
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c1
-rw-r--r--source/blender/makesrna/intern/rna_animation.c95
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c1
-rw-r--r--source/blender/makesrna/intern/rna_armature.c118
-rw-r--r--source/blender/makesrna/intern/rna_boid.c27
-rw-r--r--source/blender/makesrna/intern/rna_brush.c141
-rw-r--r--source/blender/makesrna/intern/rna_camera.c21
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c5
-rw-r--r--source/blender/makesrna/intern/rna_color.c6
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c221
-rw-r--r--source/blender/makesrna/intern/rna_curve.c4
-rw-r--r--source/blender/makesrna/intern/rna_define.c29
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c67
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c1
-rw-r--r--source/blender/makesrna/intern/rna_image.c180
-rw-r--r--source/blender/makesrna/intern/rna_internal.h10
-rw-r--r--source/blender/makesrna/intern/rna_key.c12
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c219
-rw-r--r--source/blender/makesrna/intern/rna_main.c4
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c129
-rw-r--r--source/blender/makesrna/intern/rna_material.c697
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c78
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c201
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c57
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c490
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_object.c302
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c383
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c528
-rw-r--r--source/blender/makesrna/intern/rna_particle.c442
-rw-r--r--source/blender/makesrna/intern/rna_pose.c478
-rw-r--r--source/blender/makesrna/intern/rna_rna.c9
-rw-r--r--source/blender/makesrna/intern/rna_scene.c429
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c78
-rw-r--r--source/blender/makesrna/intern/rna_screen.c31
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c30
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c38
-rw-r--r--source/blender/makesrna/intern/rna_sequence.c45
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c11
-rw-r--r--source/blender/makesrna/intern/rna_space.c232
-rw-r--r--source/blender/makesrna/intern/rna_text.c6
-rw-r--r--source/blender/makesrna/intern/rna_texture.c454
-rw-r--r--source/blender/makesrna/intern/rna_ui.c27
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c69
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c415
-rw-r--r--source/blender/makesrna/intern/rna_wm.c391
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c74
-rw-r--r--source/blender/makesrna/intern/rna_world.c134
60 files changed, 5453 insertions, 2235 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index ca3ac62ba00..810fb110f7a 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -56,6 +56,7 @@ extern StructRNA RNA_Area;
extern StructRNA RNA_AreaLamp;
extern StructRNA RNA_Armature;
extern StructRNA RNA_ArmatureModifier;
+extern StructRNA RNA_ArmatureSensor;
extern StructRNA RNA_ArrayModifier;
extern StructRNA RNA_BackgroundImage;
extern StructRNA RNA_BevelModifier;
@@ -76,6 +77,7 @@ extern StructRNA RNA_BoneGroup;
extern StructRNA RNA_BooleanModifier;
extern StructRNA RNA_BooleanProperty;
extern StructRNA RNA_Brush;
+extern StructRNA RNA_BrushTextureSlot;
extern StructRNA RNA_BuildModifier;
extern StructRNA RNA_Camera;
extern StructRNA RNA_CastModifier;
@@ -99,7 +101,8 @@ extern StructRNA RNA_CompositorNodeBilateralblur;
extern StructRNA RNA_CompositorNodeBlur;
extern StructRNA RNA_CompositorNodeBrightContrast;
extern StructRNA RNA_CompositorNodeChannelMatte;
-extern StructRNA RNA_CompositorNodeChroma;
+extern StructRNA RNA_CompositorNodeChromaMatte;
+extern StructRNA RNA_CompositorNodeColorMatte;
extern StructRNA RNA_CompositorNodeColorSpill;
extern StructRNA RNA_CompositorNodeCombHSVA;
extern StructRNA RNA_CompositorNodeCombRGBA;
@@ -114,6 +117,7 @@ extern StructRNA RNA_CompositorNodeDefocus;
extern StructRNA RNA_CompositorNodeDiffMatte;
extern StructRNA RNA_CompositorNodeDilateErode;
extern StructRNA RNA_CompositorNodeDisplace;
+extern StructRNA RNA_CompositorNodeDistanceMatte;
extern StructRNA RNA_CompositorNodeFilter;
extern StructRNA RNA_CompositorNodeFlip;
extern StructRNA RNA_CompositorNodeGamma;
@@ -123,6 +127,7 @@ extern StructRNA RNA_CompositorNodeIDMask;
extern StructRNA RNA_CompositorNodeImage;
extern StructRNA RNA_CompositorNodeInvert;
extern StructRNA RNA_CompositorNodeLensdist;
+extern StructRNA RNA_CompositorNodeLevels;
extern StructRNA RNA_CompositorNodeLumaMatte;
extern StructRNA RNA_CompositorNodeMapUV;
extern StructRNA RNA_CompositorNodeMapValue;
@@ -174,9 +179,11 @@ extern StructRNA RNA_DistortedNoiseTexture;
extern StructRNA RNA_DomainFluidSettings;
extern StructRNA RNA_Driver;
extern StructRNA RNA_DriverTarget;
+extern StructRNA RNA_DupliObject;
extern StructRNA RNA_EdgeSplitModifier;
extern StructRNA RNA_EditBone;
extern StructRNA RNA_EffectSequence;
+extern StructRNA RNA_EffectorWeights;
extern StructRNA RNA_EnumProperty;
extern StructRNA RNA_EnumPropertyItem;
extern StructRNA RNA_EnvironmentMap;
@@ -204,6 +211,10 @@ extern StructRNA RNA_FluidSettings;
extern StructRNA RNA_FluidSimulationModifier;
extern StructRNA RNA_FollowPathConstraint;
extern StructRNA RNA_Function;
+extern StructRNA RNA_GPencilFrame;
+extern StructRNA RNA_GPencilLayer;
+extern StructRNA RNA_GPencilStroke;
+extern StructRNA RNA_GPencilStrokePoint;
extern StructRNA RNA_GameBooleanProperty;
extern StructRNA RNA_GameFloatProperty;
extern StructRNA RNA_GameIntProperty;
@@ -214,10 +225,6 @@ extern StructRNA RNA_GameStringProperty;
extern StructRNA RNA_GameTimerProperty;
extern StructRNA RNA_GlowSequence;
extern StructRNA RNA_GreasePencil;
-extern StructRNA RNA_GPencilLayer;
-extern StructRNA RNA_GPencilFrame;
-extern StructRNA RNA_GPencilStroke;
-extern StructRNA RNA_GPencilStrokePoint;
extern StructRNA RNA_Group;
extern StructRNA RNA_Header;
extern StructRNA RNA_HemiLamp;
@@ -225,6 +232,7 @@ extern StructRNA RNA_HookModifier;
extern StructRNA RNA_ID;
extern StructRNA RNA_IDProperty;
extern StructRNA RNA_IDPropertyGroup;
+extern StructRNA RNA_IKParam;
extern StructRNA RNA_Image;
extern StructRNA RNA_ImagePaint;
extern StructRNA RNA_ImageSequence;
@@ -232,8 +240,12 @@ extern StructRNA RNA_ImageTexture;
extern StructRNA RNA_ImageUser;
extern StructRNA RNA_InflowFluidSettings;
extern StructRNA RNA_IntProperty;
+extern StructRNA RNA_Itasc;
extern StructRNA RNA_JoystickSensor;
extern StructRNA RNA_Key;
+extern StructRNA RNA_KeyConfig;
+extern StructRNA RNA_KeyMap;
+extern StructRNA RNA_KeyMapItem;
extern StructRNA RNA_KeyboardSensor;
extern StructRNA RNA_KeyingSet;
extern StructRNA RNA_KeyingSetPath;
@@ -249,7 +261,6 @@ extern StructRNA RNA_LimitDistanceConstraint;
extern StructRNA RNA_LimitLocationConstraint;
extern StructRNA RNA_LimitRotationConstraint;
extern StructRNA RNA_LimitScaleConstraint;
-extern StructRNA RNA_LocalLamp;
extern StructRNA RNA_LockedTrackConstraint;
extern StructRNA RNA_MagicTexture;
extern StructRNA RNA_Main;
@@ -264,6 +275,7 @@ extern StructRNA RNA_MaterialSlot;
extern StructRNA RNA_MaterialStrand;
extern StructRNA RNA_MaterialSubsurfaceScattering;
extern StructRNA RNA_MaterialTextureSlot;
+extern StructRNA RNA_MaterialVolume;
extern StructRNA RNA_Menu;
extern StructRNA RNA_Mesh;
extern StructRNA RNA_MeshColor;
@@ -314,6 +326,7 @@ extern StructRNA RNA_Paint;
extern StructRNA RNA_Panel;
extern StructRNA RNA_Particle;
extern StructRNA RNA_ParticleBrush;
+extern StructRNA RNA_ParticleDupliWeight;
extern StructRNA RNA_ParticleEdit;
extern StructRNA RNA_ParticleFluidSettings;
extern StructRNA RNA_ParticleHairKey;
@@ -328,6 +341,7 @@ extern StructRNA RNA_PluginTexture;
extern StructRNA RNA_PointCache;
extern StructRNA RNA_PointDensity;
extern StructRNA RNA_PointDensityTexture;
+extern StructRNA RNA_PointLamp;
extern StructRNA RNA_PointerProperty;
extern StructRNA RNA_Pose;
extern StructRNA RNA_PoseChannel;
@@ -343,7 +357,6 @@ extern StructRNA RNA_RenderEngine;
extern StructRNA RNA_RenderLayer;
extern StructRNA RNA_RenderPass;
extern StructRNA RNA_RenderResult;
-extern StructRNA RNA_RenderValue;
extern StructRNA RNA_RigidBodyJointConstraint;
extern StructRNA RNA_Scene;
extern StructRNA RNA_SceneGameData;
@@ -491,12 +504,12 @@ extern StructRNA RNA_TransformSequence;
extern StructRNA RNA_UILayout;
extern StructRNA RNA_UIListItem;
extern StructRNA RNA_UVProjectModifier;
+extern StructRNA RNA_UVProjector;
extern StructRNA RNA_UnitSettings;
extern StructRNA RNA_UnknownType;
extern StructRNA RNA_UserPreferences;
extern StructRNA RNA_UserPreferencesEdit;
extern StructRNA RNA_UserPreferencesFilePaths;
-extern StructRNA RNA_UserPreferencesLanguage;
extern StructRNA RNA_UserPreferencesSystem;
extern StructRNA RNA_UserPreferencesView;
extern StructRNA RNA_UserSolidLight;
@@ -692,6 +705,7 @@ char *RNA_path_back(const char *path);
int RNA_path_resolve(PointerRNA *ptr, const char *path,
PointerRNA *r_ptr, PropertyRNA **r_prop);
+char *RNA_path_from_ID_to_struct(PointerRNA *ptr);
char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop);
#if 0
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 595562503aa..37b175fbf12 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -102,6 +102,8 @@ PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *
*/
PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
const char *ui_name, const char *ui_description, float softmin, float softmax);
+PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
+ const char *ui_name, const char *ui_description, float softmin, float softmax);
PropertyRNA *RNA_def_pointer(StructOrFunctionRNA *cont, const char *identifier, const char *type,
const char *ui_name, const char *ui_description);
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index ccf4b7a2db3..ca44e3405f6 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -29,9 +29,14 @@
/* Types */
+extern EnumPropertyItem id_type_items[];
+
+
extern EnumPropertyItem object_mode_items[];
-extern EnumPropertyItem prop_mode_items[];
+extern EnumPropertyItem proportional_falloff_items[];
+extern EnumPropertyItem proportional_editing_items[];
+extern EnumPropertyItem snap_mode_items[];
extern EnumPropertyItem space_type_items[];
extern EnumPropertyItem region_type_items[];
extern EnumPropertyItem modifier_type_items[];
@@ -58,6 +63,12 @@ extern EnumPropertyItem unpack_method_items[];
extern EnumPropertyItem object_type_items[];
+extern EnumPropertyItem space_type_items[];
+
+struct bContext;
+struct PointerRNA;
+EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, int *free);
+
#endif /* RNA_ENUM_TYPES */
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index e7fe86afd03..20160946ff3 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -54,6 +54,11 @@ typedef struct PointerRNA {
void *data;
} PointerRNA;
+typedef struct PropertyPointerRNA {
+ PointerRNA ptr;
+ struct PropertyRNA *prop;
+} PropertyPointerRNA;
+
/* Property */
typedef enum PropertyType {
@@ -94,9 +99,10 @@ typedef enum PropertySubType {
/* numbers */
PROP_UNSIGNED = 13,
PROP_PERCENTAGE = 14,
- PROP_ANGLE = 15|PROP_UNIT_ROTATION,
- PROP_TIME = 16|PROP_UNIT_TIME,
- PROP_DISTANCE = 17|PROP_UNIT_LENGTH,
+ PROP_FACTOR = 15,
+ PROP_ANGLE = 16|PROP_UNIT_ROTATION,
+ PROP_TIME = 17|PROP_UNIT_TIME,
+ PROP_DISTANCE = 18|PROP_UNIT_LENGTH,
/* number arrays */
PROP_COLOR = 20,
@@ -107,11 +113,9 @@ typedef enum PropertySubType {
PROP_MATRIX = 25,
PROP_EULER = 26|PROP_UNIT_ROTATION,
PROP_QUATERNION = 27,
- PROP_XYZ = 28,
- PROP_RGB = 29,
-
- /* pointers */
- PROP_NEVER_NULL = 30,
+ PROP_AXISANGLE = 28,
+ PROP_XYZ = 29,
+ PROP_RGB = 30,
/* booleans */
PROP_LAYER = 40,
@@ -122,43 +126,51 @@ typedef enum PropertyFlag {
/* editable means the property is editable in the user
* interface, properties are editable by default except
* for pointers and collections. */
- PROP_EDITABLE = 1,
+ PROP_EDITABLE = 1<<0,
/* this property is editable even if it is lib linked,
* meaning it will get lost on reload, but it's useful
* for editing. */
- PROP_LIB_EXCEPTION = 65536,
+ PROP_LIB_EXCEPTION = 1<<16,
/* animateable means the property can be driven by some
* other input, be it animation curves, expressions, ..
* properties are animateable by default except for pointers
* and collections */
- PROP_ANIMATEABLE = 2,
+ PROP_ANIMATEABLE = 1<<1,
/* icon */
- PROP_ICONS_CONSECUTIVE = 4096,
+ PROP_ICONS_CONSECUTIVE = 1<12,
- /* function paramater flags */
- PROP_REQUIRED = 4,
- PROP_RETURN = 8,
- PROP_RNAPTR = 2048,
+ /* hidden in the user interface */
+ PROP_HIDDEN = 1<<19,
+ /* function paramater flags */
+ PROP_REQUIRED = 1<<2,
+ PROP_RETURN = 1<<3,
+ PROP_RNAPTR = 1<<11,
/* registering */
- PROP_REGISTER = 16,
- PROP_REGISTER_OPTIONAL = 16|32,
+ PROP_REGISTER = 1<<4,
+ PROP_REGISTER_OPTIONAL = (1<<4)|(1<<5),
/* pointers */
- PROP_ID_REFCOUNT = 64,
+ PROP_ID_REFCOUNT = 1<<6,
+
+ /* disallow assigning a variable to its self, eg an object tracking its self
+ * only apply this to types that are derived from an ID ()*/
+ PROP_ID_SELF_CHECK = 1<<20,
+
+ PROP_NEVER_NULL = 1<<18,
/* internal flags */
- PROP_BUILTIN = 128,
- PROP_EXPORT = 256,
- PROP_RUNTIME = 512,
- PROP_IDPROPERTY = 1024,
- PROP_RAW_ACCESS = 8192,
- PROP_RAW_ARRAY = 16384,
- PROP_FREE_POINTERS = 32768,
- PROP_DYNAMIC = 131072 /* for dynamic arrays, and retvals of type string */
+ PROP_BUILTIN = 1<<7,
+ PROP_EXPORT = 1<<8,
+ PROP_RUNTIME = 1<<9,
+ PROP_IDPROPERTY = 1<<10,
+ PROP_RAW_ACCESS = 1<<13,
+ PROP_RAW_ARRAY = 1<<14,
+ PROP_FREE_POINTERS = 1<<15,
+ PROP_DYNAMIC = 1<<17 /* for dynamic arrays, and retvals of type string */
} PropertyFlag;
typedef struct CollectionPropertyIterator {
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
index 6234bd8d2af..e814a7891ca 100644
--- a/source/blender/makesrna/SConscript
+++ b/source/blender/makesrna/SConscript
@@ -7,7 +7,7 @@ o = SConscript('intern/SConscript')
objs += o
incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .'
-incs += ' ../windowmanager ../editors/include ../imbuf'
+incs += ' ../windowmanager ../editors/include ../imbuf ../ikplugin'
incs += ' ../render/extern/include ../bmesh'
defs = []
@@ -40,4 +40,12 @@ if env['WITH_BF_GAMEENGINE']:
if env['BF_UNIT_TEST']:
defs.append('UNIT_TEST')
+
+if env['OURPLATFORM'] == 'linux2':
+ cflags='-pthread'
+ incs += ' ../../../extern/binreloc/include'
+
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs += ' ' + env['BF_PTHREADS_INC']
+
env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] )
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index b68f48c3194..c9c02fbecde 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -39,9 +39,13 @@ SET(SRC
../../../../intern/guardedalloc/intern/mallocn.c
../../../../intern/guardedalloc/intern/mmap_win.c)
-INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include ../../bmesh .)
+INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
+IF(WIN32)
+ SET(INC ${INC} ${PTHREADS_INC})
+ENDIF(WIN32)
+
IF(WITH_GAMEENGINE)
ADD_DEFINITIONS(-DGAMEBLENDER)
ENDIF(WITH_GAMEENGINE)
diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile
index a1e824de657..e597046c8ba 100644
--- a/source/blender/makesrna/intern/Makefile
+++ b/source/blender/makesrna/intern/Makefile
@@ -49,6 +49,7 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../ikplugin
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../editors/include
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index 19d6af3e9eb..317f3a9779e 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -29,10 +29,10 @@ makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" '
defs = []
-incs = '#/intern/guardedalloc ../../bmesh ../../blenlib ../../blenkernel'
-incs += ' ../../imbuf ../../makesdna ../../makesrna'
+incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel'
+incs += ' ../../imbuf ../../makesdna ../../makesrna ../../ikplugin'
incs += ' ../../windowmanager ../../editors/include'
-incs += ' ../../render/extern/include'
+incs += ' ../../render/extern/include ../../bmesh'
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')
@@ -74,6 +74,14 @@ if env['WITH_BF_JACK']:
if env['BF_UNIT_TEST']:
defs.append('UNIT_TEST')
+
+if env['OURPLATFORM'] == 'linux2':
+ cflags='-pthread'
+ incs += ' ../../../extern/binreloc/include'
+
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs += ' ' + env['BF_PTHREADS_INC']
+
makesrna_tool.Append(CPPDEFINES=defs)
makesrna_tool.Append (CPPPATH = Split(incs))
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index d0c7824dc9d..7e473fcb096 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -144,6 +144,11 @@ static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
fprintf(f, " %s *data= (%s*)(ptr->data);\n", dp->dnastructname, dp->dnastructname);
}
+static void rna_print_id_get(FILE *f, PropertyDefRNA *dp)
+{
+ fprintf(f, " ID *id= ptr->id.data;\n");
+}
+
static char *rna_alloc_function_name(const char *structname, const char *propname, const char *type)
{
AllocDefRNA *alloc;
@@ -530,6 +535,11 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
else {
rna_print_data_get(f, dp);
+ if(prop->flag & PROP_ID_SELF_CHECK) {
+ rna_print_id_get(f, dp);
+ fprintf(f, " if(id==value.data) return;\n\n");
+ }
+
if(prop->flag & PROP_ID_REFCOUNT) {
fprintf(f, "\n if(data->%s)\n", dp->dnaname);
fprintf(f, " id_us_min((ID*)data->%s);\n", dp->dnaname);
@@ -1406,6 +1416,7 @@ static const char *rna_property_subtypename(PropertyType type)
case PROP_DIRPATH: return "PROP_DIRPATH";
case PROP_UNSIGNED: return "PROP_UNSIGNED";
case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
+ case PROP_FACTOR: return "PROP_FACTOR";
case PROP_ANGLE: return "PROP_ANGLE";
case PROP_TIME: return "PROP_TIME";
case PROP_DISTANCE: return "PROP_DISTANCE";
@@ -1415,11 +1426,11 @@ static const char *rna_property_subtypename(PropertyType type)
case PROP_MATRIX: return "PROP_MATRIX";
case PROP_EULER: return "PROP_EULER";
case PROP_QUATERNION: return "PROP_QUATERNION";
+ case PROP_AXISANGLE: return "PROP_AXISANGLE";
case PROP_VELOCITY: return "PROP_VELOCITY";
case PROP_ACCELERATION: return "PROP_ACCELERATION";
case PROP_XYZ: return "PROP_XYZ";
case PROP_RGB: return "PROP_RGB";
- case PROP_NEVER_NULL: return "PROP_NEVER_NULL";
case PROP_LAYER: return "PROP_LAYER";
case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
default: {
@@ -1969,7 +1980,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_rna.c", NULL, RNA_def_rna},
{"rna_ID.c", NULL, RNA_def_ID},
{"rna_texture.c", NULL, RNA_def_texture},
- {"rna_action.c", NULL, RNA_def_action},
+ {"rna_action.c", "rna_action_api.c", RNA_def_action},
{"rna_animation.c", "rna_animation_api.c", RNA_def_animation},
{"rna_actuator.c", NULL, RNA_def_actuator},
{"rna_armature.c", NULL, RNA_def_armature},
@@ -1986,12 +1997,12 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_fluidsim.c", NULL, RNA_def_fluidsim},
{"rna_gpencil.c", NULL, RNA_def_gpencil},
{"rna_group.c", NULL, RNA_def_group},
- {"rna_image.c", NULL, RNA_def_image},
+ {"rna_image.c", "rna_image_api.c", RNA_def_image},
{"rna_key.c", NULL, RNA_def_key},
{"rna_lamp.c", NULL, RNA_def_lamp},
{"rna_lattice.c", NULL, RNA_def_lattice},
{"rna_main.c", "rna_main_api.c", RNA_def_main},
- {"rna_material.c", NULL, RNA_def_material},
+ {"rna_material.c", "rna_material_api.c", RNA_def_material},
{"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},
{"rna_meta.c", NULL, RNA_def_meta},
{"rna_modifier.c", NULL, RNA_def_modifier},
@@ -2001,7 +2012,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_object_force.c", NULL, RNA_def_object_force},
{"rna_packedfile.c", NULL, RNA_def_packedfile},
{"rna_particle.c", NULL, RNA_def_particle},
- {"rna_pose.c", NULL, RNA_def_pose},
+ {"rna_pose.c", "rna_pose_api.c", RNA_def_pose},
{"rna_property.c", NULL, RNA_def_gameproperty},
{"rna_render.c", NULL, RNA_def_render},
{"rna_scene.c", "rna_scene_api.c", RNA_def_scene},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index f5c6063e892..2fc1fcfc681 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -33,6 +33,38 @@
#include "rna_internal.h"
+/* enum of ID-block types
+ * NOTE: need to keep this in line with the other defines for these
+ */
+EnumPropertyItem id_type_items[] = {
+ {ID_AC, "ACTION", ICON_ACTION, "Action", ""},
+ {ID_AR, "ARMATURE", ICON_ARMATURE_DATA, "Armature", ""},
+ {ID_BR, "BRUSH", ICON_BRUSH_DATA, "Brush", ""},
+ {ID_CA, "CAMERA", ICON_CAMERA_DATA, "Camera", ""},
+ {ID_CU, "CURVE", ICON_CURVE_DATA, "Curve", ""},
+ {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""},
+ {ID_GD, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""},
+ {ID_GR, "GROUP", ICON_GROUP, "Group", ""},
+ {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""},
+ {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""},
+ {ID_LA, "LAMP", ICON_LAMP_DATA, "Lamp", ""},
+ {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""},
+ {ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},
+ {ID_MA, "MATERIAL", ICON_MATERIAL_DATA, "Material", ""},
+ {ID_MB, "META", ICON_META_DATA, "MetaBall", ""},
+ {ID_ME, "MESH", ICON_MESH_DATA, "Mesh", ""},
+ {ID_NT, "NODETREE", ICON_NODE, "NodeTree", ""},
+ {ID_OB, "OBJECT", ICON_OBJECT_DATA, "Object", ""},
+ {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""},
+ {ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""},
+ {ID_SCR, "SCREEN", ICON_SPLITSCREEN, "Screen", ""},
+ {ID_SO, "SOUND", ICON_PLAY_AUDIO, "Sound", ""},
+ {ID_TXT, "TEXT", ICON_TEXT, "Text", ""},
+ {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
+ {ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""},
+ {ID_WM, "WINDOWMANAGER", ICON_FULLSCREEN, "Window Manager", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "BKE_idprop.h"
@@ -178,6 +210,18 @@ StructRNA* rna_IDPropertyGroup_refine(PointerRNA *ptr)
return ptr->type;
}
+ID *rna_ID_copy(ID *id)
+{
+ ID *newid;
+
+ if(id_copy(id, &newid, 0)) {
+ if(newid) newid->us--;
+ return newid;
+ }
+
+ return NULL;
+}
+
#else
static void rna_def_ID_properties(BlenderRNA *brna)
@@ -243,7 +287,8 @@ static void rna_def_ID_properties(BlenderRNA *brna)
static void rna_def_ID(BlenderRNA *brna)
{
StructRNA *srna;
- PropertyRNA *prop;
+ FunctionRNA *func;
+ PropertyRNA *prop, *parm;
srna= RNA_def_struct(brna, "ID", NULL);
RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection.");
@@ -271,6 +316,12 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "lib");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from.");
+
+ /* functions */
+ func= RNA_def_function(srna, "copy", "rna_ID_copy");
+ RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks).");
+ parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID.");
+ RNA_def_function_return(func, parm);
}
static void rna_def_library(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 9472cdb300c..6cf2fd0c60f 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -620,7 +620,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
PropertySubType subtype= rna_ensure_property(prop)->subtype;
/* get string to use for array index */
- if ((index < 4) && (subtype == PROP_QUATERNION))
+ if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE))
return quatitem[index];
else if((index < 4) && ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
return vectoritem[index];
@@ -727,7 +727,7 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En
*free= 0;
- if(eprop->itemf) {
+ if(eprop->itemf && C) {
int tot= 0;
*item= eprop->itemf(C, ptr, free);
@@ -1409,10 +1409,17 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value)
{
- PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ /* not supported */
+ }
+ else {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
- if(pprop->set)
- pprop->set(ptr, ptr_value);
+ if(pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL))
+ pprop->set(ptr, ptr_value);
+ }
}
void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
@@ -2219,6 +2226,9 @@ int RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, Prope
prop= NULL;
curptr= *ptr;
+ if(path==NULL)
+ return 0;
+
while(*path) {
/* look up property name in current struct */
token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
@@ -2380,12 +2390,11 @@ char *RNA_path_back(const char *path)
return result;
}
-char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
+char *RNA_path_from_ID_to_struct(PointerRNA *ptr)
{
- char *ptrpath=NULL, *path;
- const char *propname;
+ char *ptrpath=NULL;
- if(!ptr->id.data || !ptr->data || !prop)
+ if(!ptr->id.data || !ptr->data)
return NULL;
if(!RNA_struct_is_ID(ptr->type)) {
@@ -2411,6 +2420,20 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
else
return NULL;
}
+
+ return ptrpath;
+}
+
+char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
+{
+ const char *propname;
+ char *ptrpath, *path;
+
+ if(!ptr->id.data || !ptr->data || !prop)
+ return NULL;
+
+ /* path from ID to the struct holding this property */
+ ptrpath= RNA_path_from_ID_to_struct(ptr);
propname= RNA_property_identifier(prop);
@@ -2762,7 +2785,10 @@ int RNA_property_is_set(PointerRNA *ptr, const char *name)
PropertyRNA *prop= RNA_struct_find_property(ptr, name);
if(prop) {
- return (rna_idproperty_find(ptr, name) != NULL);
+ if(prop->flag & PROP_IDPROPERTY)
+ return (rna_idproperty_find(ptr, name) != NULL);
+ else
+ return 1;
}
else {
// printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name);
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 99090b62938..eaa11b4ad38 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -100,6 +100,8 @@ static void rna_def_action(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses.");
+
+ RNA_api_action(srna);
}
/* --------- */
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 473e726db60..ce83d1c469b 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -58,6 +58,7 @@ void RNA_def_actuator(BlenderRNA *brna)
{ACT_PARENT, "PARENT", 0, "Parent", ""},
{ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""},
{ACT_STATE, "STATE", 0, "State", ""},
+ {ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Actuator", NULL);
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index a8d3a6edaae..23a9c48710e 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
+#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_types.h"
#include "RNA_enum_types.h"
@@ -57,6 +58,26 @@ static int rna_AnimData_action_editable(PointerRNA *ptr)
return 1;
}
+static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value)
+{
+ AnimData *adt= (AnimData*)(ptr->data);
+ adt->action= value.data;
+}
+
+/* ****************************** */
+
+static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr)
+{
+ KS_Path *ksp= (KS_Path*)ptr->data;
+ return ID_code_to_RNA_type(ksp->idtype);
+}
+
+static int rna_ksPath_id_editable(PointerRNA *ptr)
+{
+ KS_Path *ksp= (KS_Path*)ptr->data;
+ return (ksp->idtype)? PROP_EDITABLE : 0;
+}
+
static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value)
{
KS_Path *ksp= (KS_Path *)ptr->data;
@@ -90,6 +111,50 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
ksp->rna_path= NULL;
}
+/* ****************************** */
+
+static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+
+ /* only editable if there are some paths to change to */
+ return (ks->paths.first != NULL);
+}
+
+static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path-1));
+}
+
+static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr, PointerRNA value)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+ KS_Path *ksp= (KS_Path*)value.data;
+ ks->active_path= BLI_findindex(&ks->paths, ksp) + 1;
+}
+
+static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+ return MAX2(ks->active_path-1, 0);
+}
+
+static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+ ks->active_path= value+1;
+}
+
+static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ KeyingSet *ks= (KeyingSet *)ptr->data;
+
+ *min= 0;
+ *max= BLI_countlist(&ks->paths)-1;
+ *max= MAX2(0, *max);
+}
+
#else
@@ -104,8 +169,18 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
/* ID */
prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_editable_func(prop, "rna_ksPath_id_editable");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef");
RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only).");
+ prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "idtype");
+ RNA_def_property_enum_items(prop, id_type_items);
+ RNA_def_property_enum_default(prop, ID_OB);
+ RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used.");
+
/* Group */
prop= RNA_def_property(srna, "group", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to.");
@@ -118,12 +193,11 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
/* Path + Array Index */
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
- //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now editable
RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set");
RNA_def_property_ui_text(prop, "RNA Path", "RNA Path to property setting.");
+ RNA_def_struct_name_property(srna, prop); // XXX this is the best indicator for now...
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
- //RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now editable
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable.");
/* Flags */
@@ -151,6 +225,18 @@ static void rna_def_keyingset(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together.");
+ prop= RNA_def_property(srna, "active_path", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyingSetPath");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
+ RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL);
+ RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes.");
+
+ prop= RNA_def_property(srna, "active_path_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_path");
+ RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
+ RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index.");
+
/* Flags */
prop= RNA_def_property(srna, "builtin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -202,8 +288,11 @@ void rna_def_animdata(BlenderRNA *brna)
/* Active Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
- RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
+ RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock.");
+
/* Active Action Settings */
prop= RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c
index 6af87335e02..5852c494936 100644
--- a/source/blender/makesrna/intern/rna_animation_api.c
+++ b/source/blender/makesrna/intern/rna_animation_api.c
@@ -54,6 +54,7 @@ static void rna_KeyingSet_add_destination(KeyingSet *keyingset, ReportList *repo
/* if data is valid, call the API function for this */
if (keyingset) {
BKE_keyingset_add_destination(keyingset, id, group_name, rna_path, array_index, flag, grouping_method);
+ keyingset->active_path= BLI_countlist(&keyingset->paths);
}
else {
BKE_report(reports, RPT_ERROR, "Keying Set Destination could not be added.");
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index dcf89b7ac1e..6c9d9263eeb 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -52,6 +52,7 @@ static void rna_Armature_update_data(bContext *C, PointerRNA *ptr)
DAG_id_flush_update(id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
+ //WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL);
}
static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr)
@@ -61,6 +62,11 @@ static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr)
WM_event_add_notifier(C, NC_GEOM|ND_DATA, id);
}
+static char *rna_Bone_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("bones[\"%s\"]", ((Bone*)ptr->data)->name);
+}
+
static void rna_bone_layer_set(short *layer, const int *values)
{
int i, tot= 0;
@@ -374,6 +380,11 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET);
RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects.");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
+ prop= RNA_def_property(srna, "selectable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_UNSELECTABLE);
+ RNA_def_property_ui_text(prop, "Selectable", "Bone is able to be selected");
+ RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Number values */
/* envelope deform settings */
@@ -430,6 +441,7 @@ static void rna_def_bone(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Bone", NULL);
RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock.");
RNA_def_struct_ui_icon(srna, ICON_BONE_DATA);
+ RNA_def_struct_path_func(srna, "rna_Bone_path");
/* pointers/collections */
/* parent (pointer) */
@@ -457,6 +469,37 @@ static void rna_def_bone(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+
+ /* XXX better matrix descriptions possible (Arystan) */
+ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "bone_mat");
+ RNA_def_property_array(prop, 9);
+ RNA_def_property_ui_text(prop, "Bone Matrix", "3x3 bone matrix.");
+
+ prop= RNA_def_property(srna, "armature_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "arm_mat");
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Bone Armature-Relative Matrix", "4x4 bone matrix relative to armature.");
+
+ prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "tail");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone.");
+
+ prop= RNA_def_property(srna, "armature_tail", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "arm_tail");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Armature-Relative Tail", "Location of tail end of the bone relative to armature.");
+
+ prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "head");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone.");
+
+ prop= RNA_def_property(srna, "armature_head", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "arm_head");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Armature-Relative Head", "Location of head end of the bone relative to armature.");
}
static void rna_def_edit_bone(BlenderRNA *brna)
@@ -526,23 +569,37 @@ static void rna_def_armature(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_drawtype_items[] = {
- {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Draw bones as octahedral shape (default)."},
- {ARM_LINE, "STICK", 0, "Stick", "Draw bones as simple 2D lines with dots."},
- {ARM_B_BONE, "BBONE", 0, "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"},
- {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."},
+ {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)."},
+ {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots."},
+ {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"},
+ {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing defomation influence volume."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_ghost_type_items[] = {
- {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."},
- {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Draw Ghosts of poses within specified range."},
- {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Draw Ghosts of poses on Keyframes."},
+ {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame."},
+ {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range."},
+ {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes."},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_paths_type_items[]= {
+ {ARM_PATH_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame."},
+ {0, "RANGE", 0, "In Range", "Display Paths of poses within specified range."},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_paths_location_items[]= {
+ {ARM_PATH_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
+ {0, "TAILS", 0, "Tails", "Calculate bone paths from tails"},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_pose_position_items[]= {
+ {0, "POSE_POSITION", 0, "Pose Position", "Show armature in posed state."},
+ {ARM_RESTPOS, "REST_POSITION", 0, "Rest Position", "Show Armature in binding pose state. No posing possible."},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Armature", "ID");
RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters.");
RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA);
-
RNA_def_struct_sdna(srna, "bArmature");
+ /* Animation Data */
+ rna_def_animdata_common(srna);
+
/* Collections */
prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL);
@@ -556,6 +613,17 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Edit Bones", "");
/* Enum values */
+// prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
+// RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
+// RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
+// RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
+ prop= RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_pose_position_items);
+ RNA_def_property_ui_text(prop, "Pose Position", "Show armature in binding pose or final posed state.");
+ RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
prop= RNA_def_property(srna, "drawtype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_drawtype_items);
RNA_def_property_ui_text(prop, "Draw Type", "");
@@ -564,7 +632,19 @@ static void rna_def_armature(BlenderRNA *brna)
prop= RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ghosttype");
RNA_def_property_enum_items(prop, prop_ghost_type_items);
- RNA_def_property_ui_text(prop, "Ghost Drawing", "Method of Onion-skinning for active Action");
+ RNA_def_property_ui_text(prop, "Ghost Type", "Method of Onion-skinning for active Action");
+ RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+
+ prop= RNA_def_property(srna, "paths_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag");
+ RNA_def_property_enum_items(prop, prop_paths_type_items);
+ RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Bone Paths");
+ RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
+
+ prop= RNA_def_property(srna, "paths_location", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag");
+ RNA_def_property_enum_items(prop, prop_paths_location_items);
+ RNA_def_property_ui_text(prop, "Paths Location", "When calculating Bone Paths, use Head or Tips");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Boolean values */
@@ -574,7 +654,7 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_array(prop, 16);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* layer protection */
@@ -585,10 +665,7 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flag */
- prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
- RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
- RNA_def_property_update(prop, 0, "rna_Armature_update_data");
+
prop= RNA_def_property(srna, "draw_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
@@ -626,8 +703,8 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
prop= RNA_def_property(srna, "ghost_only_selected", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
- RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Keyframes Only", "");
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
+ RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Bones Only", "");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* deformflag */
@@ -672,15 +749,6 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Paths Show Keyframe Numbers", "When drawing Armature in Pose Mode, show frame numbers of Keyframes on Bone Paths");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
- prop= RNA_def_property(srna, "paths_show_around_current_frame", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_ACFRA);
- RNA_def_property_ui_text(prop, "Paths Around Current Frame", "When drawing Armature in Pose Mode, only show section of Bone Paths that falls around current frame");
- RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
-
- prop= RNA_def_property(srna, "paths_calculate_head_positions", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_HEADS);
- RNA_def_property_ui_text(prop, "Paths Use Heads", "When calculating Bone Paths, use Head locations instead of Tips");
- RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Number fields */
/* ghost/onionskining settings */
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 8002aa89313..36a648c8a82 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -74,44 +74,33 @@ EnumPropertyItem boidruleset_type_items[] ={
static void rna_Boids_reset(bContext *C, PointerRNA *ptr)
{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
-
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
psys->recalc = PSYS_RECALC_RESET;
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+ else
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
}
static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr)
{
Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
psys->recalc = PSYS_RECALC_RESET;
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
- DAG_scene_sort(scene);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+ else
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
+
+ DAG_scene_sort(scene);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 70daa3690da..e9744c7f5ed 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ * Contributor(s): Blender Foundation (2008), Juho Veps�l�inen
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -51,6 +51,9 @@ EnumPropertyItem brush_sculpt_tool_items[] = {
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static void rna_Brush_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Brush *brush= (Brush*)ptr->data;
@@ -62,33 +65,68 @@ static PointerRNA rna_Brush_active_texture_get(PointerRNA *ptr)
Brush *br= (Brush*)ptr->data;
Tex *tex;
- tex= (br->mtex[(int)br->texact])? br->mtex[(int)br->texact]->tex: NULL;
+ tex= give_current_brush_texture(br);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
Brush *br= (Brush*)ptr->data;
- int act= br->texact;
- if(br->mtex[act] && br->mtex[act]->tex)
- id_us_min(&br->mtex[act]->tex->id);
+ set_current_brush_texture(br, value.data);
+}
- if(value.data) {
- if(!br->mtex[act])
- br->mtex[act]= add_mtex();
-
- br->mtex[act]->tex= value.data;
- id_us_plus(&br->mtex[act]->tex->id);
- }
- else if(br->mtex[act]) {
- MEM_freeN(br->mtex[act]);
- br->mtex[act]= NULL;
- }
+static void rna_Brush_update(bContext *C, PointerRNA *ptr)
+{
+ Brush *br= (Brush*)ptr->data;
+ WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, br);
+}
+
+static float rna_BrushTextureSlot_angle_get(PointerRNA *ptr)
+{
+ MTex *tex= (MTex*)ptr->data;
+ const float conv = 57.295779506;
+ return tex->rot * conv;
+}
+
+static void rna_BrushTextureSlot_angle_set(PointerRNA *ptr, float v)
+{
+ MTex *tex= (MTex*)ptr->data;
+ const float conv = 0.017453293;
+ tex->rot = v * conv;
}
#else
+static void rna_def_brush_texture_slot(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_map_mode_items[] = {
+ {MTEX_MAP_MODE_FIXED, "FIXED", 0, "Fixed", ""},
+ {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
+ {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
+ RNA_def_struct_sdna(srna, "MTex");
+ RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock.");
+
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "rot");
+ RNA_def_property_range(prop, 0, 360);
+ RNA_def_property_float_funcs(prop, "rna_BrushTextureSlot_angle_get", "rna_BrushTextureSlot_angle_set", NULL);
+ RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation.");
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
+
+ prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
+ RNA_def_property_enum_items(prop, prop_map_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
+}
+
static void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
@@ -118,129 +156,157 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_blend_items);
RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
RNA_def_property_ui_text(prop, "Sculpt Tool", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_flip_direction_items);
RNA_def_property_ui_text(prop, "Direction", "Mapping type to use for this image in the game engine.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* number values */
prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 200);
RNA_def_property_ui_text(prop, "Size", "Diameter of the brush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "innerradius");
+ prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "jitter");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Falloff", "Falloff radius of the brush.");
-
+ RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 1.0f, 100.0f);
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 10, 200);
RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.5, 0.99);
RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate");
RNA_def_property_range(prop, 0.010f, 1.0f);
RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "rgb");
RNA_def_property_ui_text(prop, "Color", "");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Strength", "The amount of pressure on the brush.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* flag */
- prop= RNA_def_property(srna, "airbrush", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray).");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "strength_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "size_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_size_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "falloff_pressure", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAD_PRESSURE);
+ prop= RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
- RNA_def_property_ui_text(prop, "Falloff Pressure", "Enable tablet pressure sensitivity for falloff.");
-
- prop= RNA_def_property(srna, "spacing_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+ prop= RNA_def_property(srna, "use_spacing_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "rake", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE);
RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "anchored", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "space", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "smooth_stroke", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "persistent", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
RNA_def_property_ui_text(prop, "Persistent", "Sculpts on a persistent layer of the mesh.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* not exposed in the interface yet
prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
- RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");*/
+ RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update"); */
- prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* texture */
rna_def_mtex_common(srna, "rna_Brush_mtex_begin", "rna_Brush_active_texture_get",
- "rna_Brush_active_texture_set", "TextureSlot");
+ "rna_Brush_active_texture_set", "BrushTextureSlot", "rna_Brush_update");
/* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_opacity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clone Opacity", "Opacity of clone image display.");
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", "");
RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
}
@@ -292,6 +358,7 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
void RNA_def_brush(BlenderRNA *brna)
{
rna_def_brush(brna);
+ rna_def_brush_texture_slot(brna);
rna_def_operator_stroke_element(brna);
}
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 9c33b0afb00..6254041c7ef 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -22,7 +22,9 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#define _USE_MATH_DEFINES
#include <stdlib.h>
+#include <math.h>
#include "RNA_define.h"
#include "RNA_types.h"
@@ -35,6 +37,19 @@
#ifdef RNA_RUNTIME
+static void rna_Camera_angle_update(bContext *C, PointerRNA *ptr)
+{
+ Camera *cam= (Camera*)ptr->id.data;
+ cam->lens = 16.0f / tan(M_PI*cam->angle/360.0f);
+}
+
+static void rna_Camera_lens_update(bContext *C, PointerRNA *ptr)
+{
+ Camera *cam= (Camera*)ptr->id.data;
+ cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI;
+}
+
+
#else
void RNA_def_camera(BlenderRNA *brna)
@@ -62,7 +77,7 @@ void RNA_def_camera(BlenderRNA *brna)
/* Number values */
- prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view.");
@@ -72,7 +87,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lend field of view in degrees.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_angle_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
@@ -90,7 +105,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "lens");
RNA_def_property_range(prop, 1.0f, 250.0f);
RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in mm.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_lens_update");
prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 22cc2e2c9c3..d64e2c7119b 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -306,6 +306,11 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness.");
RNA_def_property_update(prop, 0, "rna_cloth_update");
+ prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "EffectorWeights");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Weights", "");
+
/* unused */
/* unused still
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 420add2622a..4cef6fa481f 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -216,13 +216,15 @@ static void rna_def_curvemapping(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", "");
- prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_RGB);
RNA_def_property_float_sdna(prop, NULL, "black");
+ RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
- prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
+ prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_RGB);
RNA_def_property_float_sdna(prop, NULL, "white");
+ RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL);
}
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 04d56eb666e..53c8db6ff0f 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -33,6 +33,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "ED_object.h"
#include "WM_types.h"
EnumPropertyItem constraint_type_items[] ={
@@ -80,6 +81,18 @@ EnumPropertyItem space_object_items[] = {
{1, "LOCAL", 0, "Local (Without Parent) Space", ""},
{0, NULL, 0, NULL, NULL}};
+EnumPropertyItem constraint_ik_type_items[] ={
+ {CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
+ {CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
+EnumPropertyItem constraint_ik_axisref_items[] ={
+ {0, "BONE", 0, "Bone", ""},
+ {CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
#ifdef RNA_RUNTIME
#include "BKE_action.h"
@@ -139,6 +152,24 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
}
}
+static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
+{
+ bConstraint *con= ptr->data;
+
+ /* copy the new name into the name slot */
+ BLI_strncpy(con->name, value, sizeof(con->name));
+
+ /* make sure name is unique */
+ if (ptr->id.data) {
+ Object *ob= ptr->id.data;
+ ListBase *list= get_active_constraints(ob);
+
+ /* if we have the list, check for unique name, otherwise give up */
+ if (list)
+ unique_constraint_name(con, list);
+ }
+}
+
static char *rna_Constraint_path(PointerRNA *ptr)
{
Object *ob= ptr->id.data;
@@ -160,24 +191,12 @@ static char *rna_Constraint_path(PointerRNA *ptr)
static void rna_Constraint_update(bContext *C, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
-
- if(ob->pose) update_pose_constraint_flags(ob->pose);
-
- object_test_constraints(ob);
-
- if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
- else DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+ ED_object_constraint_update(ptr->id.data);
}
static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr)
{
- Object *ob= ptr->id.data;
-
- rna_Constraint_update(C, ptr);
-
- if(ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(CTX_data_scene(C));
+ ED_object_constraint_dependency_update(CTX_data_scene(C), ptr->id.data);
}
static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
@@ -190,25 +209,29 @@ static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr)
rna_Constraint_update(C, ptr);
}
+static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value)
+{
+ bConstraint *con = ptr->data;
+ bKinematicConstraint *ikdata = con->data;
+
+ if (ikdata->type != value) {
+ // the type of IK constraint has changed, set suitable default values
+ // in case constraints reuse same fields incompatible
+ switch (value) {
+ case CONSTRAINT_IK_COPYPOSE:
+ break;
+ case CONSTRAINT_IK_DISTANCE:
+ break;
+ }
+ ikdata->type = value;
+ }
+}
+
static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Object *ob= (Object*)ptr->id.data;
bConstraint *con= (bConstraint*)ptr->data;
- if(C==NULL) {
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- /* needed for doc generation */
- RNA_enum_items_add(&item, &totitem, space_object_items);
- RNA_enum_items_add(&item, &totitem, space_pchan_items);
- RNA_enum_item_end(&item, &totitem);
-
- *free= 1;
-
- return item;
- }
-
if(BLI_findindex(&ob->constraints, con) == -1)
return space_pchan_items;
else /* object */
@@ -222,20 +245,6 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR
ListBase targets = {NULL, NULL};
bConstraintTarget *ct;
- if(C==NULL) {
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- /* needed for doc generation */
- RNA_enum_items_add(&item, &totitem, space_object_items);
- RNA_enum_items_add(&item, &totitem, space_pchan_items);
- RNA_enum_item_end(&item, &totitem);
-
- *free= 1;
-
- return item;
- }
-
if(cti && cti->get_constraint_targets) {
cti->get_constraint_targets(con, &targets);
@@ -253,8 +262,32 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR
return space_object_items;
}
+static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max)
+{
+ bConstraint *con= (bConstraint*)ptr->data;
+ bActionConstraint *acon = (bActionConstraint *)con->data;
+
+ /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */
+ if (ELEM3(acon->type, 0, 1, 2)) {
+ *min= -90.f;
+ *max= 90.f;
+ } else {
+ *min= -1000.f;
+ *max= 1000.f;
+ }
+}
+
+
#else
+EnumPropertyItem constraint_distance_items[] = {
+ {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""},
+ {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""},
+ {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+
static void rna_def_constrainttarget(BlenderRNA *brna)
{
StructRNA *srna;
@@ -417,7 +450,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
prop= RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE); // XXX - todo, convert to rad
RNA_def_property_float_sdna(prop, NULL, "poleangle");
- RNA_def_property_range(prop, 0.0, 180.f);
+ RNA_def_property_range(prop, -180.0f, 180.f);
RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -440,21 +473,81 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
prop= RNA_def_property(srna, "tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain.");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "axis_reference", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, constraint_ik_axisref_items);
+ RNA_def_property_ui_text(prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "position", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_POS);
+ RNA_def_property_ui_text(prop, "Position", "Chain follows position of target.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "pos_lock_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_X);
+ RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "pos_lock_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Y);
+ RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "pos_lock_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Z);
+ RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target.");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "rot_lock_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_X);
+ RNA_def_property_ui_text(prop, "Lock X Rot", "Constraint rotation along X axis");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "rot_lock_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Y);
+ RNA_def_property_ui_text(prop, "Lock Y Rot", "Constraint rotation along Y axis");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "rot_lock_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Z);
+ RNA_def_property_ui_text(prop, "Lock Z Rot", "Constraint rotation along Z axis");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "targetless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
RNA_def_property_ui_text(prop, "Targetless", "Use targetless IK.");
- RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Constraint_ik_type_set", NULL);
+ RNA_def_property_enum_items(prop, constraint_ik_type_items);
+ RNA_def_property_ui_text(prop, "IK Type", "");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, constraint_distance_items);
+ RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dist");
+ RNA_def_property_range(prop, 0.0, 100.f);
+ RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -575,7 +668,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target.");
- prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@@ -781,15 +874,17 @@ static void rna_def_constraint_action(BlenderRNA *brna)
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
- RNA_def_property_range(prop, 0.0, 1000.f);
+ RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
- RNA_def_property_range(prop, 0.0, 1000.f);
+ RNA_def_property_range(prop, -1000.f, 1000.f);
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range");
}
static void rna_def_constraint_locked_track(BlenderRNA *brna)
@@ -875,10 +970,10 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
- prop= RNA_def_property(srna, "offset_percentage", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "offset"); // XXX we might be better with another var or some hackery?
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Offset Percentage", "Percentage value defining target position along length of bone.");
+ RNA_def_property_ui_text(prop, "Offset Factor", "Percentage value defining target position along length of bone.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "forward", PROP_ENUM, PROP_NONE);
@@ -1457,12 +1552,6 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem distance_items[] = {
- {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""},
- {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""},
- {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint");
RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object.");
RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data");
@@ -1486,7 +1575,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna)
prop= RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
- RNA_def_property_enum_items(prop, distance_items);
+ RNA_def_property_enum_items(prop, constraint_distance_items);
RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
}
@@ -1555,6 +1644,7 @@ void RNA_def_constraint(BlenderRNA *brna)
/* strings */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
@@ -1599,12 +1689,23 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature).");
/* values */
- prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "enforce");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount of influence constraint will have on the final solution.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_influence_update");
-
+
+ /* readonly values */
+ prop= RNA_def_property(srna, "lin_error", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "lin_error");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Lin error", "Amount of residual error in Blender space unit for constraints that work on position.");
+
+ prop= RNA_def_property(srna, "rot_error", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rot_error");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Rot error", "Amount of residual error in radiant for constraints that work on orientation.");
+
/* pointers */
rna_def_constrainttarget(brna);
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 4a5af56d64a..1f1caeaa9b5 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -54,6 +54,7 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = {
EnumPropertyItem beztriple_keyframe_type_items[] = {
{BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""},
{BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""},
+ {BEZT_KEYTYPE_EXTREME, "EXTREME", 0, "Extreme", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
@@ -470,7 +471,8 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
/* number values */
prop= RNA_def_property(srna, "text_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
- RNA_def_property_range(prop, 0.1f, 10.0f);
+ RNA_def_property_range(prop, 0.0001f, 10000.0f);
+ RNA_def_property_ui_range(prop, 0.01, 10, 1, 1);
RNA_def_property_ui_text(prop, "Font size", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 0b54d4a8e14..48de7ace222 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -134,7 +134,7 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_property_def: only at preprocess time.\n");
+ fprintf(stderr, "rna_find_struct_property_def: only at preprocess time.\n");
return NULL;
}
@@ -155,6 +155,7 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
return NULL;
}
+#if 0
static PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
{
PropertyDefRNA *dprop;
@@ -175,6 +176,7 @@ static PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
return NULL;
}
+#endif
FunctionDefRNA *rna_find_function_def(FunctionRNA *func)
{
@@ -665,6 +667,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
}
prop= RNA_def_property(&srna->cont, "rna_type", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_ui_text(prop, "RNA", "RNA type definition.");
if(DefRNA.preprocess) {
@@ -888,7 +891,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
fprop->softmin= 0.0f;
fprop->softmax= 1.0f;
}
- else if(subtype == PROP_PERCENTAGE) {
+ else if(subtype == PROP_FACTOR) {
fprop->softmin= fprop->hardmin= 0.0f;
fprop->softmax= fprop->hardmax= 1.0f;
}
@@ -1528,7 +1531,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
iprop->softmax= 10000;
}
- if(prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE)
+ if(prop->subtype == PROP_UNSIGNED || prop->subtype == PROP_PERCENTAGE || prop->subtype == PROP_FACTOR)
iprop->hardmin= iprop->softmin= 0;
}
}
@@ -2132,6 +2135,11 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co
{
ContainerRNA *cont= cont_;
PropertyRNA *prop;
+
+ if(!items) {
+ printf("RNA_def_enum: items not allowed to be NULL.\n");
+ return NULL;
+ }
prop= RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE);
if(items) RNA_def_property_enum_items(prop, items);
@@ -2259,6 +2267,21 @@ PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont_, const char *id
return prop;
}
+PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, float default_value,
+ float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
+{
+ ContainerRNA *cont= cont_;
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_default(prop, default_value);
+ if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax);
+ RNA_def_property_ui_text(prop, ui_name, ui_description);
+ RNA_def_property_ui_range(prop, softmin, softmax, 1, 3);
+
+ return prop;
+}
+
PropertyRNA *RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type,
const char *ui_name, const char *ui_description)
{
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 2802665c639..e69e2cd0e2c 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -24,12 +24,15 @@
#include <stdlib.h>
+#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
#include "rna_internal.h"
#include "DNA_anim_types.h"
+#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
@@ -50,7 +53,7 @@ EnumPropertyItem fmodifier_type_items[] = {
#ifdef RNA_RUNTIME
-/* --------- */
+#include "WM_api.h"
static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
{
@@ -80,6 +83,33 @@ static StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr)
/* ****************************** */
+#include "BKE_depsgraph.h"
+
+static void rna_ChannelDriver_update_data(bContext *C, PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ // TODO: this really needs an update guard...
+ DAG_scene_sort(CTX_data_scene(C));
+ DAG_id_flush_update(id, OB_RECALC_DATA);
+
+ WM_event_add_notifier(C, NC_SCENE, id);
+}
+
+/* ----------- */
+
+static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr)
+{
+ DriverTarget *dtar= (DriverTarget*)ptr->data;
+ return ID_code_to_RNA_type(dtar->idtype);
+}
+
+static int rna_DriverTarget_id_editable(PointerRNA *ptr)
+{
+ DriverTarget *dtar= (DriverTarget*)ptr->data;
+ return (dtar->idtype)? PROP_EDITABLE : 0;
+}
+
static void rna_DriverTarget_RnaPath_get(PointerRNA *ptr, char *value)
{
DriverTarget *dtar= (DriverTarget *)ptr->data;
@@ -157,7 +187,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_mode_items[] = {
+ static EnumPropertyItem generator_mode_items[] = {
{FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""},
{FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""},
{0, NULL, 0, NULL, NULL}};
@@ -174,7 +204,7 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
// XXX this has a special validation func
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_enum_items(prop, generator_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Type of generator to use.");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
@@ -521,19 +551,34 @@ static void rna_def_drivertarget(BlenderRNA *brna)
/* Variable Name */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_ui_text(prop, "Name", "Name to use in scripted expressions/functions.");
-
- /* Target Properties */
- prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "id");
- RNA_def_property_ui_text(prop, "Object", "Object the specific property used can be found from");
-
+ RNA_def_property_ui_text(prop, "Name", "Name to use in scripted expressions/functions. (No spaces or dots are allowed. Also, must not start with a symbol or digit)");
+ //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates
+
+ /* Target Properties - ID-block to Drive */
+ prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable");
+ RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_DriverTarget_id_typef");
+ RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from");
+ //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates
+
+ prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "idtype");
+ RNA_def_property_enum_items(prop, id_type_items);
+ RNA_def_property_enum_default(prop, ID_OB);
+ RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used.");
+ //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates
+
+ /* Target Properties - Property to Drive */
prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length", "rna_DriverTarget_RnaPath_set");
RNA_def_property_ui_text(prop, "RNA Path", "RNA Path (from Object) to property used");
+ //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property used (if applicable)");
+ //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates
}
static void rna_def_channeldriver(BlenderRNA *brna)
@@ -555,10 +600,12 @@ static void rna_def_channeldriver(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Driver types.");
+ RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data");
/* String values */
prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Expression", "Expression to use for Scripted Expression.");
+ //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates
/* Collections */
prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index c415b3d716a..ae52c811c92 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -114,6 +114,7 @@ static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr)
sprintf(psmd->modifier.name, "FluidParticleSystem" );
psmd->psys= psys;
BLI_addtail(&ob->modifiers, psmd);
+ modifier_unique_name(&ob->modifiers, (ModifierData *)psmd);
}
}
else {
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 4d04f4ee1f3..44c55e821a9 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -37,6 +37,14 @@
#include "WM_types.h"
+static EnumPropertyItem image_source_items[]= {
+ {IMA_SRC_FILE, "FILE", 0, "File", "Single image file"},
+ {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Sequence", "Multiple image files, as a sequence"},
+ {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
+ {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
+ {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "IMB_imbuf_types.h"
@@ -66,6 +74,107 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
return 0;
}
+static void rna_Image_source_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
+}
+
+static void rna_Image_fields_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ ImBuf *ibuf;
+ void *lock;
+
+ ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+
+ if(ibuf) {
+ short nr= 0;
+
+ if(!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr= 1;
+ if((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr= 1;
+
+ if(nr)
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
+ }
+
+ BKE_image_release_ibuf(ima, lock);
+}
+
+static void rna_Image_reload_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
+ printf("reload %p\n", ima);
+}
+
+static void rna_Image_generated_update(bContext *C, PointerRNA *ptr)
+{
+ Image *ima= ptr->id.data;
+ BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
+}
+
+static void rna_ImageUser_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= CTX_data_scene(C);
+ ImageUser *iuser= ptr->data;
+
+ BKE_image_user_calc_imanr(iuser, scene->r.cfra, 0);
+}
+
+static EnumPropertyItem *rna_Image_source_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Image *ima= (Image*)ptr->data;
+ EnumPropertyItem *item= NULL;
+ int totitem= 0;
+
+ if(ima->source == IMA_SRC_VIEWER) {
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER);
+ }
+ else {
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_FILE);
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_SEQUENCE);
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_MOVIE);
+ RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_GENERATED);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+
+static int rna_Image_has_data_get(PointerRNA *ptr)
+{
+ Image *im= (Image*)ptr->data;
+
+ if (im->ibufs.first)
+ return 1;
+
+ return 0;
+}
+
+static int rna_Image_depth_get(PointerRNA *ptr)
+{
+ Image *im= (Image*)ptr->data;
+ ImBuf *ibuf;
+ void *lock;
+ int depth;
+
+ ibuf= BKE_image_acquire_ibuf(im, NULL, &lock);
+
+ if(!ibuf)
+ depth= 0;
+ else if(ibuf->rect_float)
+ depth= 128;
+ else
+ depth= ibuf->depth;
+
+ BKE_image_release_ibuf(im, lock);
+
+ return depth;
+}
+
#else
static void rna_def_imageuser(BlenderRNA *brna)
@@ -79,29 +188,35 @@ static void rna_def_imageuser(BlenderRNA *brna)
prop= RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
/* animation */
prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie.");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image).");
+ RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "layer");
@@ -121,25 +236,22 @@ static void rna_def_image(BlenderRNA *brna)
static const EnumPropertyItem prop_type_items[]= {
{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
- {IMA_TYPE_UV_TEST, "UVTEST", 0, "UV Test", ""},
- {IMA_TYPE_R_RESULT, "RENDERRESULT", 0, "Render Result", ""},
+ {IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
+ {IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_source_items[]= {
- {IMA_SRC_FILE, "FILE", 0, "File", "Single image file"},
- {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Sequence", "Multiple image files, as a sequence"},
- {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
- {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
- {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
- {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_generated_type_items[]= {
{0, "BLANK", 0, "Blank", "Generate a blank image"},
- {1, "UVTESTGRID", 0, "UV Test Grid", "Generated grid to test UV mappings"},
+ {1, "UVGRID", 0, "UV Grid", "Generated grid to test UV mappings"},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_mapping_items[]= {
{0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
{IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
{0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_field_order_items[]= {
+ {0, "EVEN", 0, "Even", "Even Fields first"},
+ {IMA_STD_FIELD, "ODD", 0, "Odd", "Odd Fields first"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Image", "ID");
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image.");
@@ -147,36 +259,36 @@ static void rna_def_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */
RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_source_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */
+ RNA_def_property_enum_items(prop, image_source_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
RNA_def_property_ui_text(prop, "Source", "Where the image comes from.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Type", "How to generate the image.");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", "");
-
+
+ prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_field_order_items);
+ RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines are displayed first.");
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+
/* booleans */
prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
RNA_def_property_ui_text(prop, "Fields", "Use fields of the image.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
-
- prop= RNA_def_property(srna, "odd_fields", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_STD_FIELD);
- RNA_def_property_ui_text(prop, "Odd Fields", "Standard field toggle.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
prop= RNA_def_property(srna, "antialias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANTIALI);
@@ -198,19 +310,19 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "gen_type");
RNA_def_property_enum_items(prop, prop_generated_type_items);
RNA_def_property_ui_text(prop, "Generated Type", "Generated image type.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_x");
RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Width", "Generated image width.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_y");
RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Height", "Generated image height.");
- RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+ RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
/* realtime properties */
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
@@ -275,6 +387,22 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically.");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+
+ /*
+ Image.has_data and Image.depth are temporary,
+ Update import_obj.py when they are replaced (Arystan)
+ */
+ prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Has data", "True if this image has data.");
+
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Depth", "Image bit depth.");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+ RNA_api_image(srna);
}
void RNA_def_image(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 4d8ef7082b6..23592212f68 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -173,7 +173,7 @@ void RNA_def_world(struct BlenderRNA *brna);
void rna_def_animdata_common(struct StructRNA *srna);
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
-void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname);
+void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update);
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
@@ -197,14 +197,20 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch
void rna_Object_update(struct bContext *C, struct PointerRNA *ptr);
void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr);
void rna_Mesh_update_draw(struct bContext *C, struct PointerRNA *ptr);
+void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr);
/* API functions */
+void RNA_api_action(StructRNA *srna);
+void RNA_api_image(struct StructRNA *srna);
+void RNA_api_keyconfig(struct StructRNA *srna);
void RNA_api_keyingset(struct StructRNA *srna);
+void RNA_api_keymap(struct StructRNA *srna);
void RNA_api_main(struct StructRNA *srna);
+void RNA_api_material(StructRNA *srna);
void RNA_api_mesh(struct StructRNA *srna);
void RNA_api_object(struct StructRNA *srna);
-void RNA_api_scene(struct StructRNA *srna);
+void RNA_api_scene(struct StructRNA *srna);
void RNA_api_text(struct StructRNA *srna);
void RNA_api_ui_layout(struct StructRNA *srna);
void RNA_api_wm(struct StructRNA *srna);
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index fbe339fe7f3..e1551404438 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -257,6 +257,11 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter));
}
+static char *rna_ShapeKey_path(PointerRNA *ptr)
+{
+ return BLI_sprintfN("keys[\"%s\"]", ((KeyBlock*)ptr->data)->name);
+}
+
static void rna_Key_update_data(bContext *C, PointerRNA *ptr)
{
Main *bmain= CTX_data_main(C);
@@ -343,6 +348,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
srna= RNA_def_struct(brna, "ShapeKey", NULL);
RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock.");
RNA_def_struct_sdna(srna, "KeyBlock");
+ RNA_def_struct_path_func(srna, "rna_ShapeKey_path");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
@@ -414,7 +420,8 @@ static void rna_def_key(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Key", "Shape keys datablock containing different shapes of geometric datablocks.");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
- prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "refkey");
RNA_def_property_ui_text(prop, "Reference Key", "");
@@ -426,7 +433,8 @@ static void rna_def_key(BlenderRNA *brna)
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "from");
RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys.");
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index dc59a75edbc..a518bd28d24 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -33,14 +33,17 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
-#include "WM_types.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
{
Lamp *la= (Lamp*)ptr->data;
@@ -66,31 +69,15 @@ static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr)
Lamp *la= (Lamp*)ptr->data;
Tex *tex;
- tex= (la->mtex[(int)la->texact])? la->mtex[(int)la->texact]->tex: NULL;
+ tex= give_current_lamp_texture(la);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_Lamp_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
Lamp *la= (Lamp*)ptr->data;
- int act= la->texact;
- if(la->mtex[act] && la->mtex[act]->tex)
- id_us_min(&la->mtex[act]->tex->id);
-
- if(value.data) {
- if(!la->mtex[act]) {
- la->mtex[act]= add_mtex();
- la->mtex[act]->texco= TEXCO_GLOB;
- }
-
- la->mtex[act]->tex= value.data;
- id_us_plus(&la->mtex[act]->tex->id);
- }
- else if(la->mtex[act]) {
- MEM_freeN(la->mtex[act]);
- la->mtex[act]= NULL;
- }
+ set_current_lamp_texture(la, value.data);
}
static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
@@ -99,7 +86,7 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
switch(la->type) {
case LA_LOCAL:
- return &RNA_LocalLamp;
+ return &RNA_PointLamp;
case LA_SUN:
return &RNA_SunLamp;
case LA_SPOT:
@@ -113,6 +100,30 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
}
}
+static void rna_Lamp_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, la);
+}
+
+static void rna_Lamp_draw_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING_DRAW, la);
+}
+
+static void rna_Lamp_sky_update(bContext *C, PointerRNA *ptr)
+{
+ Lamp *la= ptr->id.data;
+
+ DAG_id_flush_update(&la->id, 0);
+ WM_event_add_notifier(C, NC_LAMP|ND_SKY, la);
+}
+
#else
static void rna_def_lamp_mtex(BlenderRNA *brna)
@@ -144,24 +155,24 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "map_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
RNA_def_property_ui_text(prop, "Color", "Lets the texture affect the basic color of the lamp.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "map_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
RNA_def_property_ui_text(prop, "Shadow", "Lets the texture affect the shadow color of the lamp.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "shadowfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_lamp_sky_settings(BlenderRNA *brna)
@@ -203,92 +214,92 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace");
RNA_def_property_enum_items(prop, prop_skycolorspace_items);
RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
RNA_def_property_enum_items(prop, prop_blendmode_items);
RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* Number values */
prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Size", "Sun size.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor");
RNA_def_property_range(prop, 0.0f, 500.0f);
RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* boolean */
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere.");
- RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
}
static void rna_def_lamp(BlenderRNA *brna)
@@ -312,48 +323,51 @@ static void rna_def_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of Lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_range(prop, 0, 1000, 1.0, 2);
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10.0, 0.1, 2);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Light color.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
RNA_def_property_ui_text(prop, "Layer", "Illuminates objects only on the same layer the lamp is on.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
-
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
+
+ /* common */
+ rna_def_animdata_common(srna);
+
/* textures */
rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get",
- "rna_Lamp_active_texture_set", "LampTextureSlot");
+ "rna_Lamp_active_texture_set", "LampTextureSlot", "rna_Lamp_update");
}
static void rna_def_lamp_falloff(StructRNA *srna)
@@ -371,29 +385,29 @@ static void rna_def_lamp_falloff(StructRNA *srna)
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fallofftype_items);
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
RNA_def_property_ui_text(prop, "Sphere", "Sets light intensity to zero beyond lamp distance.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
@@ -426,64 +440,65 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "shdwr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Causes light to cast shadows only without illuminating objects.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_ray_sampling_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items);
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_samp");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Amount of samples taken extra (samples x samples).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
if(area) {
prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_sampy");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Amount of samples taken extra (samples x samples).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
prop= RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_sdna(prop, NULL, "soft");
+ RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Layer", "Causes only objects on the same layer to cast shadows.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
-static void rna_def_local_lamp(BlenderRNA *brna)
+static void rna_def_point_lamp(BlenderRNA *brna)
{
StructRNA *srna;
- srna= RNA_def_struct(brna, "LocalLamp", "Lamp");
+ srna= RNA_def_struct(brna, "PointLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
- RNA_def_struct_ui_text(srna, "Local Lamp", "Omnidirectional point lamp.");
+ RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT);
rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 0, 0);
@@ -502,47 +517,48 @@ static void rna_def_area_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "AreaLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA);
rna_def_lamp_shadow(srna, 0, 1);
prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "area_shape");
RNA_def_property_enum_items(prop, prop_areashape_items);
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_sizey");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k");
RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
}
static void rna_def_spot_lamp(BlenderRNA *brna)
@@ -554,6 +570,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
{LA_SHADBUF_REGULAR , "REGULAR", 0, "Classical", "Classic shadow buffer."},
{LA_SHADBUF_HALFWAY, "HALFWAY", 0, "Classic-Halfway", "Regular buffer, averaging the closest and 2nd closest Z value to reducing bias artifaces."},
{LA_SHADBUF_IRREGULAR, "IRREGULAR", 0, "Irregular", "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing."},
+ {LA_SHADBUF_DEEP, "DEEP", 0, "Deep", "Deep shadow buffer supports transparency and better filtering, at the cost of more memory usage and processing time."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_shadbuffiltertype_items[] = {
@@ -571,6 +588,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SpotLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT);
rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 1, 0);
@@ -578,101 +596,107 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
RNA_def_property_ui_text(prop, "Square", "Casts a square spot light shape.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "haint");
RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shadhalostep");
RNA_def_property_range(prop, 0, 12);
RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 512, 10240);
RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory");
RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows).");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buffers");
RNA_def_property_enum_items(prop, prop_numbuffer_items);
RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend");
RNA_def_property_range(prop, 0.0f ,1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotsize");
RNA_def_property_range(prop, 1.0f ,180.0f);
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start: objects closer will not generate shadows");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end beyond which objects will not generate shadows.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bias");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp");
RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buftype");
RNA_def_property_enum_items(prop, prop_shadbuftype_items);
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices.");
- RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
+
+ prop= RNA_def_property(srna, "compression_threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "compressthresh");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Compress", "Deep shadow map compression threshold.");
+ RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
static void rna_def_sun_lamp(BlenderRNA *brna)
@@ -683,11 +707,13 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SunLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);
rna_def_lamp_shadow(srna, 0, 0);
/* sky */
- prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "LampSkySettings");
RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps.");
@@ -702,12 +728,13 @@ static void rna_def_hemi_lamp(BlenderRNA *brna)
srna= RNA_def_struct(brna, "HemiLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp.");
+ RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI);
}
void RNA_def_lamp(BlenderRNA *brna)
{
rna_def_lamp(brna);
- rna_def_local_lamp(brna);
+ rna_def_point_lamp(brna);
rna_def_area_lamp(brna);
rna_def_spot_lamp(brna);
rna_def_sun_lamp(brna);
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 344135acaff..910a15890cb 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -259,9 +259,9 @@ void RNA_def_main(BlenderRNA *brna)
{"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL},
{"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL},
{"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL},
- {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL},
+ {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL, NULL},
{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL},
- {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
+ {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL},
{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL},
{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL},
{"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL},
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 5e3cdb2f842..7a63f7ebd1d 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -31,14 +31,23 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
+
+#include "DNA_object_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
#ifdef RNA_RUNTIME
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_library.h"
+#include "BKE_object.h"
+#include "BKE_material.h"
+#include "BKE_image.h"
+#include "BKE_texture.h"
-#include "DNA_mesh_types.h"
+#include "DNA_lamp_types.h"
static Mesh *rna_Main_add_mesh(Main *main, char *name)
{
@@ -57,24 +66,130 @@ static void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me)
/* XXX python now has invalid pointer? */
}
+static Lamp *rna_Main_add_lamp(Main *main, char *name)
+{
+ Lamp *la= add_lamp(name);
+ la->id.us--;
+ return la;
+}
+
+/*
+static void rna_Main_remove_lamp(Main *main, ReportList *reports, Lamp *la)
+{
+ if(la->id.us == 0)
+ free_libblock(&main->lamp, la);
+ else
+ BKE_report(reports, RPT_ERROR, "Lamp must have zero users to be removed.");
+}
+*/
+
+static Object* rna_Main_add_object(Main *main, int type, char *name)
+{
+ Object *ob= add_only_object(type, name);
+ ob->id.us--;
+ return ob;
+}
+
+/*
+ NOTE: the following example shows when this function should _not_ be called
+
+ ob = bpy.data.add_object()
+ scene.add_object(ob)
+
+ # ob is freed here
+ scene.remove_object(ob)
+
+ # don't do this since ob is already freed!
+ bpy.data.remove_object(ob)
+*/
+static void rna_Main_remove_object(Main *main, ReportList *reports, Object *ob)
+{
+ if(ob->id.us == 0)
+ free_libblock(&main->object, ob);
+ else
+ BKE_report(reports, RPT_ERROR, "Object must have zero users to be removed.");
+}
+
+static Material *rna_Main_add_material(Main *main, char *name)
+{
+ return add_material(name);
+}
+
+/* TODO: remove material? */
+
+struct Tex *rna_Main_add_texture(Main *main, char *name)
+{
+ return add_texture(name);
+}
+
+/* TODO: remove texture? */
+
+struct Image *rna_Main_add_image(Main *main, char *filename)
+{
+ return BKE_add_image_file(filename, 0);
+}
+
#else
void RNA_api_main(StructRNA *srna)
{
FunctionRNA *func;
- PropertyRNA *prop;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "add_object", "rna_Main_add_object");
+ RNA_def_function_ui_description(func, "Add a new object.");
+ parm= RNA_def_enum(func, "type", object_type_items, 0, "", "Type of Object.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "object", "Object", "", "New object.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove_object", "rna_Main_remove_object");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove an object if it has zero users.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "add_mesh", "rna_Main_add_mesh");
RNA_def_function_ui_description(func, "Add a new mesh.");
- prop= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
- prop= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh.");
- RNA_def_function_return(func, prop);
+ parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh.");
+ RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove_mesh", "rna_Main_remove_mesh");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a mesh if it has zero users.");
- prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
- RNA_def_property_flag(prop, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "add_lamp", "rna_Main_add_lamp");
+ RNA_def_function_ui_description(func, "Add a new lamp.");
+ parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Lamp", "", "New lamp.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_material", "rna_Main_add_material");
+ RNA_def_function_ui_description(func, "Add a new material.");
+ parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock."); /* optional */
+ parm= RNA_def_pointer(func, "material", "Material", "", "New material.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_texture", "rna_Main_add_texture");
+ RNA_def_function_ui_description(func, "Add a new texture.");
+ parm= RNA_def_string(func, "name", "Tex", 0, "", "New name for the datablock."); /* optional */
+ parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
+ RNA_def_function_ui_description(func, "Add a new image.");
+ parm= RNA_def_string(func, "filename", "", 0, "", "Filename to load image from.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
+ RNA_def_function_return(func, parm);
+
}
#endif
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index e23333713c4..74cb8675ad5 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -33,6 +33,7 @@
#include "DNA_material_types.h"
#include "DNA_texture_types.h"
+#include "WM_api.h"
#include "WM_types.h"
static EnumPropertyItem prop_texture_coordinates_items[] = {
@@ -53,10 +54,31 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
#include "MEM_guardedalloc.h"
+#include "DNA_node_types.h"
+
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "BKE_node.h"
#include "ED_node.h"
+static void rna_Material_update(bContext *C, PointerRNA *ptr)
+{
+ Material *ma= ptr->id.data;
+
+ DAG_id_flush_update(&ma->id, 0);
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, ma);
+}
+
+static void rna_Material_draw_update(bContext *C, PointerRNA *ptr)
+{
+ Material *ma= ptr->id.data;
+
+ DAG_id_flush_update(&ma->id, 0);
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING_DRAW, ma);
+}
+
static PointerRNA rna_Material_mirror_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_MaterialRaytraceMirror, ptr->id.data);
@@ -108,29 +130,40 @@ static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr)
Material *ma= (Material*)ptr->data;
Tex *tex;
- tex= (ma->mtex[(int)ma->texact])? ma->mtex[(int)ma->texact]->tex: NULL;
+ tex= give_current_material_texture(ma);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_Material_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
Material *ma= (Material*)ptr->data;
- int act= ma->texact;
- if(ma->mtex[act] && ma->mtex[act]->tex)
- id_us_min(&ma->mtex[act]->tex->id);
+ set_current_material_texture(ma, value.data);
+}
- if(value.data) {
- if(!ma->mtex[act])
- ma->mtex[act]= add_mtex();
-
- ma->mtex[act]->tex= value.data;
- id_us_plus(&ma->mtex[act]->tex->id);
- }
- else if(ma->mtex[act]) {
- MEM_freeN(ma->mtex[act]);
- ma->mtex[act]= NULL;
+static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr)
+{
+ Material *ma= (Material*)ptr->data;
+ Material *ma_node= NULL;
+
+ /* used in buttons to check context, also checks for edited groups */
+
+ if(ma && ma->use_nodes && ma->nodetree) {
+ bNode *node= nodeGetActiveID(ma->nodetree, ID_MA);
+
+ if(node)
+ ma_node= (Material *)node->id;
}
+
+ return rna_pointer_inherit_refine(ptr, &RNA_Material, ma_node);
+}
+
+static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA value)
+{
+ Material *ma= (Material*)ptr->data;
+ Material *ma_act= value.data;
+
+ nodeSetActiveID(ma->nodetree, ID_MA, &ma_act->id);
}
static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max)
@@ -227,10 +260,6 @@ static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *C, Poi
EnumPropertyItem *item= NULL;
int totitem= 0;
- if(C==NULL) {
- return prop_texture_coordinates_items;
- }
-
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_GLOB);
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_OBJECT);
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO);
@@ -250,7 +279,6 @@ static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *C, Poi
}
RNA_enum_item_end(&item, &totitem);
-
*free= 1;
return item;
@@ -308,291 +336,302 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf");
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Layer", "UV layer to use for mapping with UV texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "from_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO);
RNA_def_property_ui_text(prop, "From Dupli", "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "from_original", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG);
RNA_def_property_ui_text(prop, "From Original", "Dupli's derive their object coordinates from the original objects transformation.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colordiff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL);
RNA_def_property_ui_text(prop, "Diffuse Color", "Causes the texture to affect basic color of the material");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM);
RNA_def_property_ui_text(prop, "Normal", "Causes the texture to affect the rendered normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_colorspec", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC);
RNA_def_property_ui_text(prop, "Specular Color", "Causes the texture to affect the specularity color");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_mirror", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR);
RNA_def_property_ui_text(prop, "Mirror", "Causes the texture to affect the mirror color");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF);
RNA_def_property_ui_text(prop, "Diffuse", "Causes the texture to affect the value of the materials diffuse reflectivity");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Causes the texture to affect the value of specular reflectivity");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_ambient", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB);
RNA_def_property_ui_text(prop, "Ambient", "Causes the texture to affect the value of ambient");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_hardness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR);
RNA_def_property_ui_text(prop, "Hardness", "Causes the texture to affect the hardness value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_raymir", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR);
RNA_def_property_ui_text(prop, "Ray-Mirror", "Causes the texture to affect the ray-mirror value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA);
RNA_def_property_ui_text(prop, "Alpha", "Causes the texture to affect the alpha value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_emit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT);
RNA_def_property_ui_text(prop, "Emit", "Causes the texture to affect the emit value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_translucency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU);
RNA_def_property_ui_text(prop, "Translucency", "Causes the texture to affect the translucency value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_displacement", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DISPLACE);
RNA_def_property_ui_text(prop, "Displacement", "Let the texture displace the surface");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_warp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_WARP);
RNA_def_property_ui_text(prop, "Warp", "Let the texture warp texture coordinates of next channels");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "x_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projx");
RNA_def_property_enum_items(prop, prop_x_mapping_items);
RNA_def_property_ui_text(prop, "X Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "y_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projy");
RNA_def_property_enum_items(prop, prop_y_mapping_items);
RNA_def_property_ui_text(prop, "Y Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "z_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "projz");
RNA_def_property_enum_items(prop, prop_z_mapping_items);
RNA_def_property_ui_text(prop, "Z Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- /* XXX: pmapto, pmaptoneg */
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "normal_map_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "normapspace");
RNA_def_property_enum_items(prop, prop_normal_map_space_items);
RNA_def_property_ui_text(prop, "Normal Map Space", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- /* XXX: MTex.which_output */
-
- /* XXX: MTex.k */
+ prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "norfac");
+ RNA_def_property_ui_range(prop, 0, 5, 10, 3);
+ RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "displacement_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dispfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Displacement Factor", "Amount texture displaces the surface.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "warp_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "warpfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Warp Factor", "Amount texture affects texture coordinates of next channels.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colorspec_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "colspecfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Color Factor", "Amount texture affects specular color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "mirror_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "mirrfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Mirror Factor", "Amount texture affects mirror color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "alphafac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "difffac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Diffuse Factor", "Amount texture affects diffuse reflectivity.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "specfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Specular Factor", "Amount texture affects specular reflectivity.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emit_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "emitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emit Factor", "Amount texture affects emission.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "hardfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Hardness Factor", "Amount texture affects hardness.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "raymir_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "raymirrfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ray Mirror Factor", "Amount texture affects ray mirror.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "translucency_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "translfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Translucency Factor", "Amount texture affects translucency.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ambient_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "ambfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* volume material */
prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL);
- RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the colour of emission");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the color of emission");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "map_colorabsorption", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION_COL);
- RNA_def_property_ui_text(prop, "Absorption Color", "Causes the texture to affect the result colour after absorption");
+ prop= RNA_def_property(srna, "map_colorreflection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION_COL);
+ RNA_def_property_ui_text(prop, "Reflection Color", "Causes the texture to affect the color of scattered light");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "map_colortransmission", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL);
+ RNA_def_property_ui_text(prop, "Transmission Color", "Causes the texture to affect the result color after other light has been scattered/absorbed");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "map_density", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY);
RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION);
RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "map_absorption", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION);
- RNA_def_property_ui_text(prop, "Absorption", "Causes the texture to affect the volume's absorption");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING);
RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "map_reflection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION);
+ RNA_def_property_ui_text(prop, "Reflection", "Causes the texture to affect the reflected light's brightness");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "coloremission_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "colemitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "colorabsorption_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ prop= RNA_def_property(srna, "colorreflection_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "colreflfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Reflection Color Factor", "Amount texture affects color of out-scattered light");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "colortransmission_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "coltransfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Absorpion Color Factor", "Amount texture affects diffuse color.");
+ RNA_def_property_ui_text(prop, "Transmission Color Factor", "Amount texture affects result color after light has been scattered/absorbed.");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "densfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "emitfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "absorption_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
- RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Absorption Factor", "Amount texture affects absorption.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "scatterfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "reflection_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "reflfac");
+ RNA_def_property_ui_range(prop, 0, 1, 10, 3);
+ RNA_def_property_ui_text(prop, "Reflection Factor", "Amount texture affects brightness of out-scattered light.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* end volume material */
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_enabled_get", "rna_MaterialTextureSlot_enabled_set");
RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "new_bump", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEW_BUMP);
RNA_def_property_ui_text(prop, "New Bump", "Use new, corrected bump mapping code (backwards compatibility option).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_colors(StructRNA *srna)
@@ -631,78 +670,91 @@ static void rna_def_material_colors(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Diffuse Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "specr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Specular Color", "Specular color of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "mirr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
- prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spectra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* Color bands */
prop= RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_COL);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_diffuse_ramp_set");
RNA_def_property_ui_text(prop, "Use Diffuse Ramp", "Toggle diffuse ramp operations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_col");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Diffuse Ramp", "Color ramp used to affect diffuse shading.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_specular_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_SPEC);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_specular_ramp_set");
RNA_def_property_ui_text(prop, "Use Specular Ramp", "Toggle specular ramp operations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ramp_spec");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_col");
RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec");
RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_col");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampin_spec");
RNA_def_property_enum_items(prop, prop_ramp_input_items);
RNA_def_property_ui_text(prop, "Specular Ramp Input", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+ prop= RNA_def_property(srna, "diffuse_ramp_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "rampfac_col");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Diffuse Ramp Factor", "Blending factor (also uses alpha in Colorband).");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "specular_ramp_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "rampfac_spec");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Specular Ramp Factor", "Blending factor (also uses alpha in Colorband).");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_diffuse(StructRNA *srna)
@@ -721,47 +773,47 @@ static void rna_def_material_diffuse(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "diff_shader");
RNA_def_property_enum_items(prop, prop_diff_shader_items);
RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ref");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 3.14f);
RNA_def_property_ui_text(prop, "Diffuse Toon Size", "Size of diffuse toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Diffuse Toon Smooth", "Smoothness of diffuse toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[1]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel", "Power of Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_fresnel_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[0]");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Frensel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_raymirror(BlenderRNA *brna)
@@ -782,67 +834,67 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */
RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_depth");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist_mir");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir");
RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
RNA_def_property_ui_text(prop, "Fade-out Color", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_raytra(BlenderRNA *brna)
@@ -859,61 +911,61 @@ static void rna_def_material_raytra(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "ang");
RNA_def_property_range(prop, 1.0f, 3.0f);
RNA_def_property_ui_text(prop, "IOR", "Sets angular index of refraction for raytraced refraction.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra");
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i");
RNA_def_property_range(prop, 1.0f, 5.0f);
RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp_gloss_tra");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_depth_tra");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "filter");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tx_limit");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "tx_falloff");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_volume(BlenderRNA *brna)
@@ -921,11 +973,12 @@ static void rna_def_material_volume(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_scattering_items[] = {
- {MA_VOL_SHADE_NONE, "NONE", 0, "None", ""},
- {MA_VOL_SHADE_SINGLE, "SINGLE_SCATTERING", 0, "Single Scattering", ""},
+ static EnumPropertyItem prop_lighting_items[] = {
+ {MA_VOL_SHADE_SHADELESS, "SHADELESS", 0, "Shadeless", ""},
+ {MA_VOL_SHADE_SHADOWED, "SHADOWED", 0, "Shadowed", ""},
+ {MA_VOL_SHADE_SHADED, "SHADED", 0, "Shaded", ""},
{MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""},
- {MA_VOL_SHADE_SINGLEPLUSMULTIPLE, "SINGLE_PLUS_MULTIPLE_SCATTERING", 0, "Single + Multiple Scattering", ""},
+ {MA_VOL_SHADE_SHADEDPLUSMULTIPLE, "SHADED_PLUS_MULTIPLE_SCATTERING", 0, "Shaded + Multiple Scattering", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_stepsize_items[] = {
@@ -934,15 +987,6 @@ static void rna_def_material_volume(BlenderRNA *brna)
//{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_phasefunction_items[] = {
- {MA_VOL_PH_ISOTROPIC, "ISOTROPIC", 0, "Isotropic", ""},
- {MA_VOL_PH_MIEHAZY, "MIE_HAZY", 0, "Mie Hazy", ""},
- {MA_VOL_PH_MIEMURKY, "MIE_MURKY", 0, "Mie Murky", ""},
- {MA_VOL_PH_RAYLEIGH, "RAYLEIGH", 0, "Rayleigh", ""},
- {MA_VOL_PH_HG, "HENYEY-GREENSTEIN", 0, "Henyey-Greenstein", ""},
- {MA_VOL_PH_SCHLICK, "SCHLICK", 0, "Schlick", ""},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "MaterialVolume", NULL);
RNA_def_struct_sdna(srna, "VolumeSettings");
RNA_def_struct_nested(brna, srna, "Material");
@@ -952,120 +996,118 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stepsize_type");
RNA_def_property_enum_items(prop, prop_stepsize_items);
RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stepsize");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "shade_stepsize");
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
- RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "scattering_mode", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "lighting_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shade_type");
- RNA_def_property_enum_items(prop, prop_scattering_items);
- RNA_def_property_ui_text(prop, "Scattering Mode", "Method of shading, attenuating, and scattering light through the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_enum_items(prop, prop_lighting_items);
+ RNA_def_property_ui_text(prop, "Lighting Mode", "Method of shading, attenuating, and scattering light through the volume");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "external_shadows", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_RECV_EXT_SHADOW); /* use bitflags */
+ RNA_def_property_ui_text(prop, "External Shadows", "Receive shadows from sources outside the volume (temporary)");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_diff");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_spread", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ms_steps");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_ui_text(prop, "Spread", "Simulation steps, the effective distance over which the light is diffused");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ms_intensity");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Density", "The base density of the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "density_scale");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "absorption");
- RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
-
- prop= RNA_def_property(srna, "absorption_color", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_float_sdna(prop, NULL, "absorption_col");
- RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Absorption Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scattering");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
- RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered out by the volume - the more out-scattering, the shallower the light will penetrate ");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "emission");
+ prop= RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "transmission_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Transmission Color", "Result color of the volume, after other light has been scattered/absorbed");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "reflection_col");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Reflection Color", "Colour of light scattered out of the volume (does not affect transmission)");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "reflection");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
- RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1 ,3);
+ RNA_def_property_ui_text(prop, "Reflection", "Multiplier to make out-scattered light brighter or darker (non-physically correct)");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "emission_col");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Emission Color", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
-
- prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type");
- RNA_def_property_enum_items(prop, prop_phasefunction_items);
- RNA_def_property_ui_text(prop, "Phase Function", "Isotropic/Anisotropic scattering");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+ prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "emission");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
+ RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "phasefunc_g");
+ RNA_def_property_float_sdna(prop, NULL, "asymmetry");
RNA_def_property_range(prop, -1.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_text(prop, "Asymmetry", "Back scattering (-1.0) to Forward scattering (1.0) and the range in between.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -1083,118 +1125,118 @@ static void rna_def_material_halo(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "hasize");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Size", "Sets the dimension of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 0, 127);
RNA_def_property_ui_text(prop, "Hardness", "Sets the hardness of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "add");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "rings", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ringc");
RNA_def_property_range(prop, 0, 24);
RNA_def_property_ui_text(prop, "Rings", "Sets the number of rings rendered over the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "line_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "linec");
RNA_def_property_range(prop, 0, 250);
RNA_def_property_ui_text(prop, "Line Number", "Sets the number of star shaped lines rendered over the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star_tips", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "starc");
RNA_def_property_range(prop, 3, 50);
RNA_def_property_ui_text(prop, "Star Tips", "Sets the number of points on the star shaped halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed1");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Seed", "Randomizes ring dimension and line location.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */
RNA_def_property_ui_text(prop, "Flare", "Renders halo as a lensflare.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flaresize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Size", "Sets the factor by which the flare is larger than the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_subsize", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "subsize");
RNA_def_property_range(prop, 0.1f, 25.0f);
RNA_def_property_ui_text(prop, "Flare Subsize", "Sets the dimension of the subflares, dots and circles.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flareboost");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Flare Boost", "Gives the flare extra strength.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed2");
RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Flare Seed", "Specifies an offset in the flare seed table.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flares_sub", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "flarec");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Flares Sub", "Sets the number of subflares.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ring", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS);
RNA_def_property_ui_text(prop, "Rings", "Renders rings over halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES);
RNA_def_property_ui_text(prop, "Lines", "Renders star shaped lines over halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR);
RNA_def_property_ui_text(prop, "Star", "Renders halo as a star.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA);
RNA_def_property_ui_text(prop, "Extreme Alpha", "Uses extreme alpha.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE);
RNA_def_property_ui_text(prop, "Shaded", "Lets halo receive light and shadows from external objects.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "soft", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT);
RNA_def_property_ui_text(prop, "Soft", "Softens the edges of halos at intersections with other geometry.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_sss(BlenderRNA *brna)
@@ -1212,59 +1254,59 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
RNA_def_property_ui_text(prop, "Radius", "Mean red/green/blue scattering path length.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "sss_col");
RNA_def_property_ui_text(prop, "Color", "Scattering color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_error");
RNA_def_property_ui_range(prop, 0.0001, 10, 1, 3);
RNA_def_property_ui_text(prop, "Error Tolerance", "Error tolerance (low values are slower and higher quality).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_scale");
RNA_def_property_ui_range(prop, 0.001, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Scale", "Object scale factor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_ior");
RNA_def_property_ui_range(prop, 0.1, 2, 1, 3);
RNA_def_property_ui_text(prop, "IOR", "Index of refraction (higher values are denser).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Blend factor for SSS colors.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_texfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Texture Factor", "Texture scatting blend factor.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_front");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Front", "Front scattering weight.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sss_back");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Back", "Back scattering weight.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sss_flag", MA_DIFF_SSS);
RNA_def_property_ui_text(prop, "Enabled", "Enable diffuse subsurface scatting effects in a material.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_specularity(StructRNA *srna)
@@ -1283,13 +1325,13 @@ static void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "spec_shader");
RNA_def_property_enum_items(prop, prop_specular_shader_items);
RNA_def_property_ui_text(prop, "Specular Shader Model", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "spec");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Specular Intensity", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* NOTE: "har", "param", etc are used for multiple purposes depending on
* settings. This should be fixed in DNA once, for RNA we just expose them
@@ -1300,31 +1342,31 @@ static void rna_def_material_specularity(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 1, 511);
RNA_def_property_ui_text(prop, "Specular Hardness", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "refrac");
RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Specular IOR", "");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "param[2]");
RNA_def_property_range(prop, 0.0f, 1.53f);
RNA_def_property_ui_text(prop, "Specular Toon Size", "Size of specular toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "param[3]");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Specular Toon Smooth", "Ssmoothness of specular toon area.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rms");
RNA_def_property_range(prop, 0, 0.4);
RNA_def_property_ui_text(prop, "Specular Slope", "The standard deviation of surface slope.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_strand(BlenderRNA *brna)
@@ -1340,58 +1382,58 @@ static void rna_def_material_strand(BlenderRNA *brna)
prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR);
RNA_def_property_ui_text(prop, "Tangent Shading", "Uses direction of strands as normal for tangent-shading.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "surface_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF);
RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "strand_surfnor");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_B_UNITS);
RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_sta");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range");
RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_end");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range");
RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "strand_min");
RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Minimum Size", "Minimum size of strands in pixels.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_ease");
RNA_def_property_range(prop, -0.9, 0.9);
RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative makes strands spiky.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_widthfade");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Width Fade", "Transparency along the width of the strand.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "strand_uvname");
RNA_def_property_ui_text(prop, "UV Layer", "Name of UV layer to override.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
}
static void rna_def_material_physics(BlenderRNA *brna)
@@ -1459,45 +1501,45 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered.");
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "transparency", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP);
RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, transparency_items);
RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "amb");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Ambient", "Amount of global ambient color the material receives.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 2.0f, 10, 2);
RNA_def_property_ui_text(prop, "Emit", "Amount of light to emit.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
- prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cubic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC);
RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_OBCOLOR);
RNA_def_property_ui_text(prop, "Object Color", "Modulate the result with a per-object color.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sbias");
@@ -1509,143 +1551,150 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Factor to multiply shadow buffer bias with (0 is ignore.)");
- prop= RNA_def_property(srna, "shadow_casting_alpha", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "shadow_casting_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "shad_alpha");
RNA_def_property_range(prop, 0.001, 1);
- RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, only in use for Irregular Shadowbuffer.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, in use for Irregular and Deep shadow buffer.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* flags */
prop= RNA_def_property(srna, "light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY);
RNA_def_property_ui_text(prop, "Light Group Exclusive", "Material uses the light group exclusively - these lamps are excluded from other scene lighting.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "traceable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE);
RNA_def_property_ui_text(prop, "Traceable", "Include this material and geometry that uses it in ray tracing calculations.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW);
RNA_def_property_ui_text(prop, "Shadows", "Allows this material to receive shadows.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadeless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS);
RNA_def_property_ui_text(prop, "Shadeless", "Makes this material insensitive to light or shadow.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL);
RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP);
RNA_def_property_ui_text(prop, "Vertex Color Paint", "Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV);
RNA_def_property_ui_text(prop, "Invert Z Depth", "Renders material's faces with an inverted Z buffer (scanline only).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV);
RNA_def_property_ui_text(prop, "Sky", "Renders this material with zero alpha, with sky background in place (scanline only).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Renders shadows as the material's alpha value, making materials transparent except for shadowed areas.");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "face_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE);
RNA_def_property_ui_text(prop, "Face Textures", "Replaces the object's base color with color from face assigned image textures");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA);
RNA_def_property_ui_text(prop, "Face Textures Alpha", "Replaces the object's base alpha value with alpha from face assigned image textures");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST);
RNA_def_property_ui_text(prop, "Cast Shadows Only", "Makes objects with this material appear invisible, only casting shadows (not rendered).");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "exclude_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_NOMIST);
RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA);
RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS);
RNA_def_property_ui_text(prop, "Ray Shadow Bias", "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "full_oversampling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA);
RNA_def_property_ui_text(prop, "Full Oversampling", "Force this material to render full shading/textures for all anti-aliasing samples");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF);
RNA_def_property_ui_text(prop, "Cast Buffer Shadows", "Allow this material to cast shadows from shadow buffer lamps");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V);
RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects");
- RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
+ RNA_def_property_update(prop, 0, "rna_Material_update");
/* nested structs */
- prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialRaytraceMirror");
RNA_def_property_pointer_funcs(prop, "rna_Material_mirror_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Mirror", "Raytraced reflection settings for the material.");
- prop= RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialRaytraceTransparency");
RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced reflection settings for the material.");
- prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "vol");
RNA_def_property_struct_type(prop, "MaterialVolume");
RNA_def_property_ui_text(prop, "Volume", "Volume settings for the material.");
- prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialHalo");
RNA_def_property_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Halo", "Halo settings for the material.");
- prop= RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialSubsurfaceScattering");
RNA_def_property_pointer_funcs(prop, "rna_Material_sss_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Subsurface Scattering", "Subsurface scattering settings for the material.");
- prop= RNA_def_property(srna, "strand", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "strand", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialStrand");
RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material.");
- prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "MaterialPhysics");
RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Physics", "Game physics settings.");
@@ -1659,13 +1708,27 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_nodes_set");
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the material.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
+ prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Material");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL);
+ RNA_def_property_ui_text(prop, "Material", "Active node material.");
RNA_def_property_update(prop, NC_MATERIAL, NULL);
/* common */
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
- "rna_Material_active_texture_set", "MaterialTextureSlot");
+ "rna_Material_active_texture_set", "MaterialTextureSlot", "rna_Material_update");
+ /* only material has this one */
+ prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "septex", 1);
+ RNA_def_property_array(prop, 18);
+ RNA_def_property_ui_text(prop, "Use Textures", "Enable/Disable each texture.");
+ RNA_def_property_update(prop, 0, "rna_Material_update");
+
rna_def_material_colors(srna);
rna_def_material_diffuse(srna);
rna_def_material_specularity(srna);
@@ -1679,9 +1742,11 @@ void RNA_def_material(BlenderRNA *brna)
rna_def_material_mtex(brna);
rna_def_material_strand(brna);
rna_def_material_physics(brna);
+
+ RNA_api_material(srna);
}
-void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname)
+void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update)
{
PropertyRNA *prop;
@@ -1696,13 +1761,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed.");
- RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, update);
prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "texact");
RNA_def_property_range(prop, 0, MAX_MTEX-1);
RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot.");
- RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL);
+ RNA_def_property_update(prop, 0, update);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 53c34a8de32..ff995538d1e 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -700,6 +700,27 @@ static void rna_MeshFace_verts_set(PointerRNA *ptr, const int *values)
memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int));
}
+static int rna_MeshVertex_index_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ MVert *vert= (MVert*)ptr->data;
+ return (int)(vert - me->mvert);
+}
+
+static int rna_MeshEdge_index_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ MEdge *edge= (MEdge*)ptr->data;
+ return (int)(edge - me->medge);
+}
+
+static int rna_MeshFace_index_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ MFace *face= (MFace*)ptr->data;
+ return (int)(face - me->mface);
+}
+
/* path construction */
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
@@ -873,6 +894,11 @@ static void rna_def_mvert(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0);
RNA_def_property_struct_type(prop, "VertexGroupElement");
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of.");
+
+ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_MeshVertex_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Index", "Index number of the vertex.");
}
static void rna_def_medge(BlenderRNA *brna)
@@ -921,6 +947,21 @@ static void rna_def_medge(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP);
RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+
+ prop= RNA_def_property(srna, "loose", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Loose", "Loose edge");
+
+ prop= RNA_def_property(srna, "fgon", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FGON);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Fgon", "Fgon edge");
+
+ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_MeshEdge_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Index", "Index number of the vertex.");
}
static void rna_def_mface(BlenderRNA *brna)
@@ -942,6 +983,12 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL);
RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
+ /* leaving this fixed size array for foreach_set used in import scripts */
+ prop= RNA_def_property(srna, "verts_raw", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "v1");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "Vertices", "Fixed size vertex indices array");
+
prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "mat_nr");
RNA_def_property_ui_text(prop, "Material Index", "");
@@ -969,6 +1016,11 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshFace_normal_get", NULL, NULL);
RNA_def_property_ui_text(prop, "face normal", "local space unit length normal vector for this face");
+
+ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_MeshFace_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Index", "Index number of the vertex.");
}
static void rna_def_mtexpoly(BlenderRNA *brna)
@@ -1316,8 +1368,13 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "MeshSticky");
RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates.");
- /* UV textures */
+ /* TODO, should this be allowed to be its self? */
+ prop= RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
+ RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indicies (vertex indicies must be aligned).");
+ /* UV textures */
prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0, 0, 0);
@@ -1408,6 +1465,10 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using hilights in the 3d view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+ prop= RNA_def_property(srna, "all_edges", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
+ RNA_def_property_ui_text(prop, "All Edges", "Displays all edges for wireframe in all view modes in the 3d view");
+
prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3d view and UV editor");
@@ -1443,7 +1504,6 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
-
prop= RNA_def_property(srna, "draw_edge_lenght", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGELEN);
RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths");
@@ -1463,6 +1523,20 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_PINS);
RNA_def_property_ui_text(prop, "Draw Pins", "Displays pinned mesh elements");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
+ /* editflag */
+ prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
+ RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
+
+ /*
+ prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
+ RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
+
+ prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
+ RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
+ */
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index f5cf50da26f..32bcf5c1bc8 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -32,183 +32,15 @@
#include "RNA_define.h"
#include "RNA_types.h"
-#ifdef RNA_RUNTIME
-
-#include "DNA_mesh_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-
-#include "BLI_edgehash.h"
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-static void rna_Mesh_calc_edges(Mesh *mesh)
-{
- CustomData edata;
- EdgeHashIterator *ehi;
- MFace *mf = mesh->mface;
- MEdge *med;
- EdgeHash *eh = BLI_edgehash_new();
- int i, *index, totedge, totface = mesh->totface;
-
- for (i = 0; i < totface; i++, mf++) {
- if (!BLI_edgehash_haskey(eh, mf->v1, mf->v2))
- BLI_edgehash_insert(eh, mf->v1, mf->v2, NULL);
- if (!BLI_edgehash_haskey(eh, mf->v2, mf->v3))
- BLI_edgehash_insert(eh, mf->v2, mf->v3, NULL);
-
- if (mf->v4) {
- if (!BLI_edgehash_haskey(eh, mf->v3, mf->v4))
- BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL);
- if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1))
- BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL);
- } else {
- if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1))
- BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL);
- }
- }
-
- totedge = BLI_edgehash_size(eh);
-
- /* write new edges into a temporary CustomData */
- memset(&edata, 0, sizeof(edata));
- CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
-
- ehi = BLI_edgehashIterator_new(eh);
- med = CustomData_get_layer(&edata, CD_MEDGE);
- for(i = 0; !BLI_edgehashIterator_isDone(ehi);
- BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) {
- BLI_edgehashIterator_getKey(ehi, (int*)&med->v1, (int*)&med->v2);
-
- med->flag = ME_EDGEDRAW|ME_EDGERENDER;
- }
- BLI_edgehashIterator_free(ehi);
-
- /* free old CustomData and assign new one */
- CustomData_free(&mesh->edata, mesh->totedge);
- mesh->edata = edata;
- mesh->totedge = totedge;
-
- mesh->medge = CustomData_get_layer(&mesh->edata, CD_MEDGE);
-
- BLI_edgehash_free(eh, NULL);
-}
-
-static void rna_Mesh_update(Mesh *mesh, bContext *C)
-{
- if(mesh->totface && mesh->totedge == 0)
- rna_Mesh_calc_edges(mesh);
-
- mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL);
-
- DAG_id_flush_update(&mesh->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, mesh);
-}
-
-static void rna_Mesh_add_verts(Mesh *mesh, int len)
-{
- CustomData vdata;
- MVert *mvert;
- int i, totvert;
-
- if(len == 0)
- return;
-
- totvert= mesh->totvert + len;
- CustomData_copy(&mesh->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert);
- CustomData_copy_data(&mesh->vdata, &vdata, 0, 0, mesh->totvert);
-
- if(!CustomData_has_layer(&vdata, CD_MVERT))
- CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
-
- CustomData_free(&mesh->vdata, mesh->totvert);
- mesh->vdata= vdata;
- mesh_update_customdata_pointers(mesh);
-
- /* scan the input list and insert the new vertices */
-
- mvert= &mesh->mvert[mesh->totvert];
- for(i=0; i<len; i++, mvert++)
- mvert->flag |= SELECT;
-
- /* set final vertex list size */
- mesh->totvert= totvert;
-}
-
-static void rna_Mesh_add_edges(Mesh *mesh, int len)
-{
- CustomData edata;
- MEdge *medge;
- int i, totedge;
+#include "BLO_sys_types.h"
- if(len == 0)
- return;
+#include "ED_mesh.h"
- totedge= mesh->totedge+len;
-
- /* update customdata */
- CustomData_copy(&mesh->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge);
- CustomData_copy_data(&mesh->edata, &edata, 0, 0, mesh->totedge);
-
- if(!CustomData_has_layer(&edata, CD_MEDGE))
- CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
-
- CustomData_free(&mesh->edata, mesh->totedge);
- mesh->edata= edata;
- mesh_update_customdata_pointers(mesh);
-
- /* set default flags */
- medge= &mesh->medge[mesh->totedge];
- for(i=0; i<len; i++, medge++)
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|SELECT;
-
- mesh->totedge= totedge;
-}
-
-static void rna_Mesh_add_faces(Mesh *mesh, int len)
-{
- CustomData fdata;
- MFace *mface;
- int i, totface;
-
- if(len == 0)
- return;
-
- totface= mesh->totface + len; /* new face count */
-
- /* update customdata */
- CustomData_copy(&mesh->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface);
- CustomData_copy_data(&mesh->fdata, &fdata, 0, 0, mesh->totface);
-
- if(!CustomData_has_layer(&fdata, CD_MFACE))
- CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface);
-
- CustomData_free(&mesh->fdata, mesh->totface);
- mesh->fdata= fdata;
- mesh_update_customdata_pointers(mesh);
-
- /* set default flags */
- mface= &mesh->mface[mesh->totface];
- for(i=0; i<len; i++, mface++)
- mface->flag= SELECT;
-
- mesh->totface= totface;
-}
+#ifdef RNA_RUNTIME
-static void rna_Mesh_add_geometry(Mesh *mesh, int verts, int edges, int faces)
+static void rna_Mesh_uv_texture_add(struct Mesh *me, struct bContext *C)
{
- if(verts)
- rna_Mesh_add_verts(mesh, verts);
- if(edges)
- rna_Mesh_add_edges(mesh, edges);
- if(faces)
- rna_Mesh_add_faces(mesh, faces);
+ ED_mesh_uv_texture_add(C, NULL, NULL, me);
}
#else
@@ -218,7 +50,13 @@ void RNA_api_mesh(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *parm;
- func= RNA_def_function(srna, "add_geometry", "rna_Mesh_add_geometry");
+ func= RNA_def_function(srna, "transform", "ED_mesh_transform");
+ RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix.");
+ parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix.", 0.0f, 0.0f);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "add_geometry", "ED_mesh_geometry_add");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_int(func, "verts", 0, 0, INT_MAX, "Number", "Number of vertices to add.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "edges", 0, 0, INT_MAX, "Number", "Number of edges to add.", 0, INT_MAX);
@@ -226,8 +64,21 @@ void RNA_api_mesh(StructRNA *srna)
parm= RNA_def_int(func, "faces", 0, 0, INT_MAX, "Number", "Number of faces to add.", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "update", "rna_Mesh_update");
+ func= RNA_def_function(srna, "add_uv_texture", "rna_Mesh_uv_texture_add");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh.");
+
+ func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
+ RNA_def_function_ui_description(func, "Calculate vertex normals.");
+
+ func= RNA_def_function(srna, "update", "ED_mesh_update");
+ RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges.");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+
+ func= RNA_def_function(srna, "add_material", "ED_mesh_material_add");
+ RNA_def_function_ui_description(func, "Add a new material to Mesh.");
+ parm= RNA_def_pointer(func, "material", "Material", "", "Material to add.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 32e34559f1f..09d80e75a49 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -85,6 +85,7 @@ EnumPropertyItem modifier_type_items[] ={
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_library.h"
+#include "BKE_modifier.h"
static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
@@ -164,9 +165,23 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
}
}
+void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
+{
+ ModifierData *md= ptr->data;
+
+ /* copy the new name into the name slot */
+ BLI_strncpy(md->name, value, sizeof(md->name));
+
+ /* make sure the name is truly unique */
+ if (ptr->id.data) {
+ Object *ob= ptr->id.data;
+ modifier_unique_name(&ob->modifiers, md);
+ }
+}
+
static char *rna_Modifier_path(PointerRNA *ptr)
{
- return BLI_sprintfN("modifiers[%s]", ((ModifierData*)ptr->data)->name); // XXX not unique
+ return BLI_sprintfN("modifiers[\"%s\"]", ((ModifierData*)ptr->data)->name);
}
static void rna_Modifier_update(bContext *C, PointerRNA *ptr)
@@ -930,12 +945,14 @@ static void rna_def_modifier_softbody(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SoftbodyModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "SoftBodySettings");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Settings", "");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
@@ -1551,15 +1568,18 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ClothModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sim_parms");
RNA_def_property_ui_text(prop, "Cloth Settings", "");
- prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coll_parms");
RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Point Cache", "");
}
@@ -1609,16 +1629,11 @@ static void rna_def_modifier_collision(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "CollisionModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "CollisionSettings");
RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Settings", "");
-
- prop= RNA_def_property(srna, "absorption", PROP_INT, PROP_PERCENTAGE);
- RNA_def_property_int_sdna(prop, NULL, "absorption");
- RNA_def_property_ui_range(prop, 0, 100, 1, 2);
- RNA_def_property_ui_text(prop, "Absorption %", "How much of effector force gets lost during collision with this object (in percent).");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_bevel(BlenderRNA *brna)
@@ -1679,7 +1694,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_mode_items[] = {
+ static EnumPropertyItem shrink_type_items[] = {
{MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACEPOINT", 0, "Nearest Surface Point", ""},
{MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""},
{MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""},
@@ -1692,7 +1707,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "shrinkType");
- RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_enum_items(prop, shrink_type_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1780,7 +1795,8 @@ static void rna_def_modifier_fluidsim(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "FluidsimModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "fss");
RNA_def_property_ui_text(prop, "Settings", "Settings for how this object is used in the fluid simulation.");
}
@@ -1790,7 +1806,7 @@ static void rna_def_modifier_mask(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_mode_items[] = {
+ static EnumPropertyItem modifier_mask_mode_items[] = {
{MOD_MASK_MODE_VGROUP, "VERTEX_GROUP", 0, "Vertex Group", ""},
{MOD_MASK_MODE_ARM, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
@@ -1801,7 +1817,7 @@ static void rna_def_modifier_mask(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_enum_items(prop, modifier_mask_mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1829,7 +1845,7 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_mode_items[] = {
+ static EnumPropertyItem simple_deform_mode_items[] = {
{MOD_SIMPLEDEFORM_MODE_TWIST, "TWIST", 0, "Twist", ""},
{MOD_SIMPLEDEFORM_MODE_BEND, "BEND", 0, "Bend", ""},
{MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", ""},
@@ -1842,7 +1858,7 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM);
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_enum_items(prop, simple_deform_mode_items);
RNA_def_property_ui_text(prop, "Mode", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1910,6 +1926,7 @@ void RNA_def_modifier(BlenderRNA *brna)
/* strings */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set");
RNA_def_property_ui_text(prop, "Name", "Modifier name.");
RNA_def_struct_name_property(srna, prop);
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 99f61c7a724..bd018973f5a 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -25,20 +25,96 @@
#include <stdlib.h>
#include <string.h>
+#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
+#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
+#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_image.h"
+static EnumPropertyItem node_blend_type_items[] = {
+ { 0, "MIX", 0, "Mix", ""},
+ { 1, "ADD", 0, "Add", ""},
+ { 3, "SUBTRACT", 0, "Subtract", ""},
+ { 2, "MULTIPLY", 0, "Multiply", ""},
+ { 4, "SCREEN", 0, "Screen", ""},
+ { 9, "OVERLAY", 0, "Overlay", ""},
+ { 5, "DIVIDE", 0, "Divide", ""},
+ { 6, "DIFFERENCE", 0, "Difference", ""},
+ { 7, "DARKEN", 0, "Darken", ""},
+ { 8, "LIGHTEN", 0, "Lighten", ""},
+ {10, "DODGE", 0, "Dodge", ""},
+ {11, "BURN", 0, "Burn", ""},
+ {15, "COLOR", 0, "Color", ""},
+ {14, "VALUE", 0, "Value", ""},
+ {13, "SATURATION", 0, "Saturation", ""},
+ {12, "HUE", 0, "Hue", ""},
+ {16, "SOFT_LIGHT", 0, "Soft Light", ""},
+ {17, "LINEAR_LIGHT", 0, "Linear Light",""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_flip_items[] = {
+ {0, "X", 0, "Flip X", ""},
+ {1, "Y", 0, "Flip Y", ""},
+ {2, "XY", 0, "Flip X & Y", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_math_items[] = {
+ { 0, "ADD", 0, "Add", ""},
+ { 1, "SUBTRACT", 0, "Subtract", ""},
+ { 2, "MULTIPLY", 0, "Multiply", ""},
+ { 3, "DIVIDE", 0, "Divide", ""},
+ { 4, "SINE", 0, "Sine", ""},
+ { 5, "COSINE", 0, "Cosine", ""},
+ { 6, "TANGENT", 0, "Tangent", ""},
+ { 7, "ARCSINE", 0, "Arcsine", ""},
+ { 8, "ARCCOSINE", 0, "Arccosine", ""},
+ { 9, "ARCTANGENT", 0, "Arctangent", ""},
+ {10, "POWER", 0, "Power", ""},
+ {11, "LOGARITHM", 0, "Logarithm", ""},
+ {12, "MINIMUM", 0, "Minimum", ""},
+ {13, "MAXIMUM", 0, "Maximum", ""},
+ {14, "ROUND", 0, "Round", ""},
+ {15, "LESS_THAN", 0, "Less Than", ""},
+ {16, "GREATER_THAN", 0, "Greater Than", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_vec_math_items[] = {
+ {0, "ADD", 0, "Add", ""},
+ {1, "SUBTRACT", 0, "Subtract", ""},
+ {2, "AVERAGE", 0, "Average", ""},
+ {3, "DOT_PRODUCT", 0, "Dot Product", ""},
+ {4, "CROSS_PRODUCT", 0, "Cross Product", ""},
+ {5, "NORMALIZE", 0, "Normalize", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static EnumPropertyItem node_filter_items[] = {
+ {0, "SOFTEN", 0, "Soften", ""},
+ {1, "SHARPEN", 0, "Sharpen", ""},
+ {2, "LAPLACE", 0, "Laplace", ""},
+ {3, "SOBEL", 0, "Sobel", ""},
+ {4, "PREWITT", 0, "Prewitt", ""},
+ {5, "KIRSCH", 0, "Kirsch", ""},
+ {6, "SHADOW", 0, "Shadow", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
+#include "ED_node.h"
+
static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{
bNode *node = (bNode*)ptr->data;
@@ -66,6 +142,84 @@ static char *rna_Node_path(PointerRNA *ptr)
return BLI_sprintfN("nodes[%d]", index);
}
+static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup)
+{
+ bNode *node;
+
+ if(ntree == lookup)
+ return 1;
+
+ for(node=ntree->nodes.first; node; node=node->next)
+ if(node->type == NODE_GROUP && node->id)
+ if(has_nodetree((bNodeTree*)node->id, lookup))
+ return 1;
+
+ return 0;
+}
+
+static void rna_Node_update(bContext *C, PointerRNA *ptr)
+{
+ Main *bmain= CTX_data_main(C);
+ bNodeTree *ntree= (bNodeTree*)ptr->id.data;
+ bNode *node= (bNode*)ptr->data;
+ Material *ma;
+ Tex *tex;
+ Scene *sce;
+
+ /* look through all datablocks, to support groups */
+ for(ma=bmain->mat.first; ma; ma=ma->id.next)
+ if(ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree))
+ ED_node_changed_update(&ma->id, node);
+
+ for(tex=bmain->tex.first; tex; tex=tex->id.next)
+ if(tex->nodetree && tex->use_nodes && has_nodetree(tex->nodetree, ntree))
+ ED_node_changed_update(&tex->id, node);
+
+ for(sce=bmain->scene.first; sce; sce=sce->id.next)
+ if(sce->nodetree && sce->use_nodes && has_nodetree(sce->nodetree, ntree))
+ ED_node_changed_update(&sce->id, node);
+}
+
+static void rna_Node_update_name(bContext *C, PointerRNA *ptr)
+{
+ bNode *node= (bNode*)ptr->data;
+ const char *name;
+
+ if(node->id) {
+ BLI_strncpy(node->name, node->id->name+2, NODE_MAXSTR);
+ }
+ else {
+ switch(node->typeinfo->type) {
+ case SH_NODE_MIX_RGB:
+ case CMP_NODE_MIX_RGB:
+ case TEX_NODE_MIX_RGB:
+ if(RNA_enum_name(node_blend_type_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case CMP_NODE_FILTER:
+ if(RNA_enum_name(node_filter_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case CMP_NODE_FLIP:
+ if(RNA_enum_name(node_flip_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case SH_NODE_MATH:
+ case CMP_NODE_MATH:
+ case TEX_NODE_MATH:
+ if(RNA_enum_name(node_math_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ case SH_NODE_VECT_MATH:
+ if(RNA_enum_name(node_vec_math_items, node->custom1, &name))
+ BLI_strncpy(node->name, name, NODE_MAXSTR);
+ break;
+ }
+ }
+
+ rna_Node_update(C, ptr);
+}
+
#else
#define MaxNodes 1000
@@ -183,53 +337,22 @@ static void def_math(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem items[] = {
- { 0, "ADD", 0, "Add", ""},
- { 1, "SUBTRACT", 0, "Subtract", ""},
- { 2, "MULTIPLY", 0, "Multiply", ""},
- { 3, "DIVIDE", 0, "Divide", ""},
- { 4, "SINE", 0, "Sine", ""},
- { 5, "COSINE", 0, "Cosine", ""},
- { 6, "TANGENT", 0, "Tangent", ""},
- { 7, "ARCSINE", 0, "Arcsine", ""},
- { 8, "ARCCOSINE", 0, "Arccosine", ""},
- { 9, "ARCTANGENT", 0, "Arctangent", ""},
- {10, "POWER", 0, "Power", ""},
- {11, "LOGARITHM", 0, "Logarithm", ""},
- {12, "MINIMUM", 0, "Minimum", ""},
- {13, "MAXIMUM", 0, "Maximum", ""},
- {14, "ROUND", 0, "Round", ""},
- {15, "LESS_THAN", 0, "Less Than", ""},
- {16, "GREATER_THAN", 0, "Greater Than", ""},
-
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, items);
+ RNA_def_property_enum_items(prop, node_math_items);
RNA_def_property_ui_text(prop, "Operation", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_vector_math(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem items[] = {
- {0, "ADD", 0, "Add", ""},
- {1, "SUBTRACT", 0, "Subtract", ""},
- {2, "AVERAGE", 0, "Average", ""},
- {3, "DOT_PRODUCT", 0, "Dot Product", ""},
- {4, "CROSS_PRODUCT", 0, "Cross Product", ""},
- {5, "NORMALIZE", 0, "Normalize", ""},
-
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, items);
+ RNA_def_property_enum_items(prop, node_vec_math_items);
RNA_def_property_ui_text(prop, "Operation", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_rgb_curve(StructRNA *srna)
@@ -240,6 +363,7 @@ static void def_rgb_curve(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_vector_curve(StructRNA *srna)
@@ -250,6 +374,7 @@ static void def_vector_curve(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_time(StructRNA *srna)
@@ -260,59 +385,44 @@ static void def_time(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
RNA_def_property_ui_text(prop, "End Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_val_to_rgb(StructRNA *srna)
{
- /*PropertyRNA *prop;*/
+ PropertyRNA *prop;
- /* TODO: uncomment when ColorBand is wrapped *//*
- prop = RNA_def_property(srna, "color_band", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "storage");
- RNA_def_property_struct_type(prop, "ColorBand");
- RNA_def_property_ui_text(prop, "Color Band", "");*/
+ RNA_def_property_struct_type(prop, "ColorRamp");
+ RNA_def_property_ui_text(prop, "Color Ramp", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_mix_rgb(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem blend_type_items[] = {
- { 0, "MIX", 0, "Mix", ""},
- { 1, "ADD", 0, "Add", ""},
- { 3, "SUBTRACT", 0, "Subtract", ""},
- { 2, "MULTIPLY", 0, "Multiply", ""},
- { 4, "SCREEN", 0, "Screen", ""},
- { 9, "OVERLAY", 0, "Overlay", ""},
- { 5, "DIVIDE", 0, "Divide", ""},
- { 6, "DIFFERENCE", 0, "Difference", ""},
- { 7, "DARKEN", 0, "Darken", ""},
- { 8, "LIGHTEN", 0, "Lighten", ""},
- {10, "DODGE", 0, "Dodge", ""},
- {11, "BURN", 0, "Burn", ""},
- {15, "COLOR", 0, "Color", ""},
- {14, "VALUE", 0, "Value", ""},
- {13, "SATURATION", 0, "Saturation", ""},
- {12, "HUE", 0, "Hue", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, blend_type_items);
+ RNA_def_property_enum_items(prop, node_blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
- RNA_def_property_ui_text(prop, "Diffuse", "Include alpha of second input in this operation");
+ RNA_def_property_ui_text(prop, "Alpha", "Include alpha of second input in this operation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_texture(StructRNA *srna)
@@ -324,10 +434,12 @@ static void def_texture(StructRNA *srna)
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
prop = RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -342,18 +454,22 @@ static void def_sh_material(StructRNA *srna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
prop = RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Material Node outputs Diffuse");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Material Node outputs Specular");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_NEG);
RNA_def_property_ui_text(prop, "Invert Normal", "Material Node uses inverted normal");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_sh_mapping(StructRNA *srna)
@@ -364,6 +480,7 @@ static void def_sh_mapping(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "TexMapping");
RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_sh_geometry(StructRNA *srna)
@@ -375,10 +492,12 @@ static void def_sh_geometry(StructRNA *srna)
prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
RNA_def_property_ui_text(prop, "UV Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "colname");
RNA_def_property_ui_text(prop, "Vertex Color Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -387,10 +506,12 @@ static void def_sh_geometry(StructRNA *srna)
static void def_cmp_alpha_over(StructRNA *srna)
{
PropertyRNA *prop;
-
+
+ // XXX: Tooltip
prop = RNA_def_property(srna, "convert_premul", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
- RNA_def_property_ui_text(prop, "convert_premul", "TODO: don't know what this is");
+ RNA_def_property_ui_text(prop, "Convert Premul", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeTwoFloats", "storage");
@@ -398,6 +519,32 @@ static void def_cmp_alpha_over(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Premul", "Mix Factor");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+}
+
+static void def_cmp_hue_saturation(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeHueSat", "storage");
+
+ prop = RNA_def_property(srna, "hue", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "hue");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Hue", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "sat", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "sat");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Saturation", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "val", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "val");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Value", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_blur(StructRNA *srna)
@@ -422,58 +569,70 @@ static void def_cmp_blur(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "sizex");
RNA_def_property_range(prop, 0, 256);
RNA_def_property_ui_text(prop, "Size X", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "sizey", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sizey");
- RNA_def_property_range(prop, 1, 256);
+ RNA_def_property_range(prop, 0, 256);
RNA_def_property_ui_text(prop, "Size Y", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samples");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Samples", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxspeed");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Max Speed", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minspeed");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Min Speed", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
RNA_def_property_ui_text(prop, "Relative", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Factor", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "percentx");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Relative Size X", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "percenty");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Relative Size Y", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, filter_type_items);
RNA_def_property_ui_text(prop, "Filter Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "bokeh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1);
RNA_def_property_ui_text(prop, "Bokeh", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gamma", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1);
RNA_def_property_ui_text(prop, "Gamma", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/*
TODO:
@@ -490,21 +649,11 @@ static void def_cmp_filter(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem type_items[] = {
- {0, "SOFTEN", 0, "Soften", ""},
- {1, "SHARPEN", 0, "Sharpen", ""},
- {2, "LAPLACE", 0, "Laplace", ""},
- {3, "SOBEL", 0, "Sobel", ""},
- {4, "PREWITT", 0, "Prewitt", ""},
- {5, "KIRSCH", 0, "Kirsch", ""},
- {6, "SHADOW", 0, "Shadow", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_enum_items(prop, node_filter_items);
RNA_def_property_ui_text(prop, "Filter Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_cmp_map_value(StructRNA *srna)
@@ -515,31 +664,41 @@ static void def_cmp_map_value(StructRNA *srna)
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "loc");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Offset", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Size", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Use Minimum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Use Maximum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Minimum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
+ RNA_def_property_array(prop, 1);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Maximum", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_vector_blur(StructRNA *srna)
@@ -551,22 +710,47 @@ static void def_cmp_vector_blur(StructRNA *srna)
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samples");
RNA_def_property_ui_text(prop, "Samples", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "min_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "minspeed");
RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred; used to separate background from foreground");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxspeed");
- RNA_def_property_ui_text(prop, "Min Speed", "Maximum speed, or zero for none");
+ RNA_def_property_ui_text(prop, "Max Speed", "Maximum speed, or zero for none");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fac");
RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors; actually 'shutter speed' in frames");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "curved", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "curved", 1);
RNA_def_property_ui_text(prop, "Curved", "Interpolate between frames in a bezier curve, rather than linearly");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+}
+
+static void def_cmp_levels(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem space_items[] = {
+ {1, "COMNINED_RGB", 0, "C", "Combined RGB"},
+ {2, "RED", 0, "R", "Red Channel"},
+ {3, "GREEN", 0, "G", "Green Channel"},
+ {4, "BLUE", 0, "B", "Blue Channel"},
+ {5, "LUMINANCE", 0, "L", "Luminance Channel"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, space_items);
+ RNA_def_property_ui_text(prop, "Color Space", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_image(StructRNA *srna)
@@ -586,6 +770,7 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
RNA_def_struct_sdna_from(srna, "ImageUser", "storage");
@@ -595,24 +780,29 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Number of images used in animation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, 1, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
- RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
+ RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 1);
RNA_def_property_ui_text(prop, "Cyclic", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
RNA_def_property_ui_text(prop, "Auto-Refresh", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* } */
@@ -622,6 +812,7 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "layer");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* } */
@@ -638,16 +829,19 @@ static void def_cmp_render_layers(StructRNA *srna)
RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
/* TODO: layers in menu */
prop = RNA_def_property(srna, "layer", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_ui_text(prop, "Layer", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: comments indicate this might be a hack */
prop = RNA_def_property(srna, "re_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
RNA_def_property_ui_text(prop, "Re-render", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_output_file(StructRNA *srna)
@@ -709,13 +903,15 @@ static void def_cmp_output_file(StructRNA *srna)
prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sfra");
- RNA_def_property_range(prop, 1, MAXFRAMEF);
+ RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "efra");
- RNA_def_property_range(prop, 1, MAXFRAMEF);
+ RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "End Frame", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_dilate_erode(StructRNA *srna)
@@ -724,7 +920,9 @@ static void def_cmp_dilate_erode(StructRNA *srna)
prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
+ RNA_def_property_range(prop, -100, 100);
RNA_def_property_ui_text(prop, "Distance", "Distance to grow/shrink (number of iterations)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_scale(StructRNA *srna)
@@ -742,6 +940,7 @@ static void def_cmp_scale(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, space_items);
RNA_def_property_ui_text(prop, "Space", "Coordinate space to scale relative to");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_diff_matte(StructRNA *srna)
@@ -756,11 +955,13 @@ static void def_cmp_diff_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Falloff", "Color distances below this additional threshold are partially keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_color_matte(StructRNA *srna)
@@ -775,16 +976,19 @@ static void def_cmp_color_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "H", "Hue tolerance for colors to be considered a keying color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "s", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "S", "Saturation Tolerance for the color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "v", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "V", "Value Tolerance for the color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_distance_matte(StructRNA *srna)
@@ -799,11 +1003,13 @@ static void def_cmp_distance_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Falloff", "Color distances below this additional threshold are partially keyed.");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_color_spill(StructRNA *srna)
@@ -811,9 +1017,9 @@ static void def_cmp_color_spill(StructRNA *srna)
PropertyRNA *prop;
static EnumPropertyItem channel_items[] = {
- {1, "R", 0, "Red", ""},
- {2, "G", 0, "Green", ""},
- {3, "B", 0, "Blue", ""},
+ {1, "R", 0, "R", "Red Spill Suppression"},
+ {2, "G", 0, "G", "Green Spill Suppression"},
+ {3, "B", 0, "B", "Blue Spill Suppression"},
{0, NULL, 0, NULL, NULL}
};
@@ -821,6 +1027,7 @@ static void def_cmp_color_spill(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, channel_items);
RNA_def_property_ui_text(prop, "Channel", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
@@ -828,6 +1035,7 @@ static void def_cmp_color_spill(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 0.5f);
RNA_def_property_ui_text(prop, "Amount", "How much the selected channel is affected by");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_chroma_matte(StructRNA *srna)
@@ -840,26 +1048,31 @@ static void def_cmp_chroma_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 1.0f, 80.0f);
RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "cutoff", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 30.0f);
RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fsize");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Lift", "Alpha lift");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fstrength");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Gain", "Alpha gain");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "shadow_adjust", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adjust", "Adjusts the brightness of any shadows captured");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO:
if(c->t2 > c->t1)
@@ -883,10 +1096,12 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, color_space_items);
RNA_def_property_ui_text(prop, "Color Space", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: channel must be 1, 2 or 3 */
prop = RNA_def_property(srna, "channel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_property_ui_text(prop, "Channel", "");
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
@@ -895,11 +1110,13 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO:
if(c->t2 > c->t1)
@@ -911,17 +1128,11 @@ static void def_cmp_flip(StructRNA *srna)
{
PropertyRNA *prop;
- static EnumPropertyItem axis_items[] = {
- {0, "X", 0, "X", ""},
- {1, "Y", 0, "Y", ""},
- {2, "XY", 0, "X & Y", ""},
- {0, NULL, 0, NULL, NULL}
- };
-
prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
- RNA_def_property_enum_items(prop, axis_items);
+ RNA_def_property_enum_items(prop, node_flip_items);
RNA_def_property_ui_text(prop, "Axis", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update_name");
}
static void def_cmp_splitviewer(StructRNA *srna)
@@ -938,12 +1149,13 @@ static void def_cmp_splitviewer(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom2");
RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "");
-
- /* TODO: percentage */
- prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_PERCENTAGE);
- RNA_def_property_float_sdna(prop, NULL, "custom1");
- RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "factor", PROP_INT, PROP_FACTOR);
+ RNA_def_property_int_sdna(prop, NULL, "custom1");
+ RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Factor", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_id_mask(StructRNA *srna)
@@ -954,17 +1166,18 @@ static void def_cmp_id_mask(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_map_uv(StructRNA *srna)
{
PropertyRNA *prop;
-
- /* TODO: percentage */
- prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_PERCENTAGE);
+
+ prop = RNA_def_property(srna, "alpha", PROP_INT, PROP_FACTOR);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Alpha", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_defocus(StructRNA *srna)
@@ -988,50 +1201,60 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "bktype");
RNA_def_property_enum_items(prop, bokeh_items);
RNA_def_property_ui_text(prop, "Bokeh Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: angle in degrees */
prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rotation");
RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gamma_correction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gamco", 1);
RNA_def_property_ui_text(prop, "Gamma Correction", "Enable gamma correction before and after main process");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO */
prop = RNA_def_property(srna, "f_stop", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fstop");
RNA_def_property_range(prop, 0.0f, 128.0f);
RNA_def_property_ui_text(prop, "fStop", "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "max_blur", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxblur");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Max Blur", "blur limit, maximum CoC radius, 0=no limit");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bthresh");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "preview", 1);
RNA_def_property_ui_text(prop, "Preview", "Enable sampling mode, useful for preview when using low samplecounts");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samples");
RNA_def_property_range(prop, 16, 256);
RNA_def_property_ui_text(prop, "Samples", "Number of samples (16=grainy, higher=less noise)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "no_zbuf", 1);
RNA_def_property_ui_text(prop, "Use Z-Buffer", "Disable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Z-Scale", "Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_luma_matte(StructRNA *srna)
@@ -1044,11 +1267,13 @@ static void def_cmp_luma_matte(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "low", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Low", "Values lower than this setting are 100% keyed");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO: keep low less than high */
@@ -1061,10 +1286,12 @@ static void def_cmp_invert(StructRNA *srna)
prop = RNA_def_property(srna, "rgb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_CHAN_RGB);
RNA_def_property_ui_text(prop, "RGB", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_CHAN_A);
RNA_def_property_ui_text(prop, "Alpha", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_crop(StructRNA *srna)
@@ -1074,6 +1301,7 @@ static void def_cmp_crop(StructRNA *srna)
prop = RNA_def_property(srna, "crop_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
RNA_def_property_ui_text(prop, "Crop Image Size", "Whether to crop the size of the input image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeTwoXYs", "storage");
@@ -1081,21 +1309,25 @@ static void def_cmp_crop(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "x1");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "X1", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "x2", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "x2");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "X2", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "y1", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "y1");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Y1", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "y2", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "y2");
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Y2", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_dblur(StructRNA *srna)
@@ -1106,42 +1338,50 @@ static void def_cmp_dblur(StructRNA *srna)
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "iter");
- RNA_def_property_range(prop, 1, 128);
+ RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Iterations", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "wrap", 1);
RNA_def_property_ui_text(prop, "Wrap", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "center_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "center_x");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Center X", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "center_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "center_y");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Center Y", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Distance", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Angle", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spin");
RNA_def_property_range(prop, -360.0f, 360.0f);
RNA_def_property_ui_text(prop, "Spin", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zoom");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Zoom", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_bilateral_blur(StructRNA *srna)
@@ -1154,16 +1394,19 @@ static void def_cmp_bilateral_blur(StructRNA *srna)
RNA_def_property_int_sdna(prop, NULL, "iter");
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Iterations", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "sigma_color", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sigma_color");
RNA_def_property_range(prop, 0.01f, 3.0f);
RNA_def_property_ui_text(prop, "Color Sigma", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "sigma_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sigma_space");
RNA_def_property_range(prop, 0.01f, 30.0f);
RNA_def_property_ui_text(prop, "Space Sigma", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_premul_key(StructRNA *srna)
@@ -1180,6 +1423,7 @@ static void def_cmp_premul_key(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Mapping", "Conversion between premultiplied alpha and key alpha");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -1195,12 +1439,12 @@ static void def_cmp_glare(StructRNA *srna)
{0, NULL, 0, NULL, NULL}
};
- /*static EnumPropertyItem quality_items[] = {
+ static EnumPropertyItem quality_items[] = {
{0, "HIGH", 0, "High", ""},
{1, "MEDIUM", 0, "Medium", ""},
{2, "LOW", 0, "Low", ""},
{0, NULL, 0, NULL, NULL}
- };*/
+ };
RNA_def_struct_sdna_from(srna, "NodeGlare", "storage");
@@ -1208,55 +1452,66 @@ static void def_cmp_glare(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Glare Type", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "quality", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "quality");
- RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Quality", "If not set to high quality, the effect will be applied to a low-res copy of the source image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "iter");
RNA_def_property_range(prop, 2, 5);
RNA_def_property_ui_text(prop, "Iterations", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "color_modulation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colmod");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Color Modulation", "");
+ RNA_def_property_ui_text(prop, "Color Modulation", "Amount of Color Modulation, modulates colors of streaks and ghosts for a spectral dispersion effect");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "mix", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mix");
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Mix", "-1 is original image only, 0 is exact 50/50 mix, 1 is processed image only");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "threshold");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Threshold", "The glare filter will only be applied to pixels brighter than this value");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "streaks", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 2, 16);
RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "angle_ofs");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset in degrees");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fade");
RNA_def_property_range(prop, 0.75f, 1.0f);
RNA_def_property_ui_text(prop, "Fade", "Streak fade-out factor");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "rotate_45", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "angle", 1);
RNA_def_property_ui_text(prop, "Rotate 45", "Simple star filter: add 45 degree rotation offset");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_range(prop, 6, 9);
RNA_def_property_ui_text(prop, "Size", "Glow/glare size (not actual size; relative to initial size of bright area of pixels)");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
/* TODO */
}
@@ -1277,45 +1532,49 @@ static void def_cmp_tonemap(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, type_items);
RNA_def_property_ui_text(prop, "Tonemap Type", "");
-
- /* TODO: if type==0 { */
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "key", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "key");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Key", "The value the average luminance is mapped to");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(prop, "Offset", "Normally always 1, but can be used as an extra control to alter the brightness curve");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gamma");
RNA_def_property_range(prop, 0.001f, 3.0f);
RNA_def_property_ui_text(prop, "Gamma", "If not used, set to 1");
-
- /* TODO: } else { */
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f");
RNA_def_property_range(prop, -8.0f, 8.0f);
RNA_def_property_ui_text(prop, "Intensity", "If less than zero, darkens image; otherwise, makes it brighter");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "m");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Contrast", "Set to 0 to use estimate from input image");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "adaptation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "a");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Adaptation", "If 0, global; if 1, based on pixel intensity");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "c");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color Correction", "If 0, same for all channels; if 1, each independent");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_cmp_lensdist(StructRNA *srna)
@@ -1327,16 +1586,17 @@ static void def_cmp_lensdist(StructRNA *srna)
prop = RNA_def_property(srna, "projector", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "proj", 1);
RNA_def_property_ui_text(prop, "Projector", "Enable/disable projector mode. Effect is applied in horizontal direction only.");
-
- /* TODO: if proj mode is off { */
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "jit", 1);
RNA_def_property_ui_text(prop, "Jitter", "Enable/disable jittering; faster, but also noisier");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "fit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "fit", 1);
RNA_def_property_ui_text(prop, "Fit", "For positive distortion factor only: scale image such that black areas are not visible");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
@@ -1352,6 +1612,7 @@ static void def_tex_output(StructRNA *srna)
prop = RNA_def_property(srna, "output_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Output Name", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_tex_image(StructRNA *srna)
@@ -1362,6 +1623,7 @@ static void def_tex_image(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "storage");
RNA_def_property_struct_type(prop, "ImageUser");
RNA_def_property_ui_text(prop, "Settings", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_tex_bricks(StructRNA *srna)
@@ -1372,21 +1634,25 @@ static void def_tex_bricks(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "custom3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Offset Amount", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom1");
RNA_def_property_range(prop, 2, 99);
RNA_def_property_ui_text(prop, "Offset Frequency", "Offset every N rows");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "custom4");
RNA_def_property_range(prop, 0.0f, 99.0f);
RNA_def_property_ui_text(prop, "Squash Amount", "");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "custom2");
RNA_def_property_range(prop, 2, 99);
RNA_def_property_ui_text(prop, "Squash Frequency", "Squash every N rows");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
}
/* -------------------------------------------------------------------------- */
@@ -1478,6 +1744,8 @@ static void rna_def_nodetree(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Node Tree", "Node tree consisting of linked nodes used for materials, textures and compositing.");
RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_icon(srna, ICON_NODE);
+
+ rna_def_animdata_common(srna);
prop = RNA_def_property(srna, "nodes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL);
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index be4f131a6d6..69424649b3b 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -64,7 +64,7 @@ DefNode( CompositorNode, CMP_NODE_VECBLUR, def_cmp_vector_blur, "VECBL
DefNode( CompositorNode, CMP_NODE_SEPRGBA, 0, "SEPRGBA", SepRGBA, "Separate RGBA", "" )
DefNode( CompositorNode, CMP_NODE_SEPHSVA, 0, "SEPHSVA", SepHSVA, "Separate HSVA", "" )
DefNode( CompositorNode, CMP_NODE_SETALPHA, 0, "SETALPHA", SetAlpha, "Set Alpha", "" )
-DefNode( CompositorNode, CMP_NODE_HUE_SAT, 0, "HUE_SAT", HueSat, "Hue/Saturation", "" )
+DefNode( CompositorNode, CMP_NODE_HUE_SAT, def_cmp_hue_saturation, "HUE_SAT", HueSat, "Hue/Saturation", "" )
DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE", Image, "Image", "" )
DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" )
DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" )
@@ -104,7 +104,7 @@ DefNode( CompositorNode, CMP_NODE_PREMULKEY, def_cmp_premul_key, "PREMU
DefNode( CompositorNode, CMP_NODE_GLARE, def_cmp_glare, "GLARE", Glare, "Glare", "" )
DefNode( CompositorNode, CMP_NODE_TONEMAP, def_cmp_tonemap, "TONEMAP", Tonemap, "Tonemap", "" )
DefNode( CompositorNode, CMP_NODE_LENSDIST, def_cmp_lensdist, "LENSDIST", Lensdist, "Lensdist", "" )
-DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, 0, "LEVELS", Levels, "Levels", "" )
+DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, def_cmp_levels, "LEVELS", Levels, "Levels", "" )
DefNode( CompositorNode, CMP_NODE_COLOR_MATTE, def_cmp_color_matte, "COLOR_MATTE", ColorMatte, "Color Matte", "" )
DefNode( CompositorNode, CMP_NODE_DIST_MATTE, def_cmp_distance_matte, "DISTANCE_MATTE", DistanceMatte, "Distance Matte", "" )
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 3d43dfdfc2c..8dd8d591088 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -31,6 +31,7 @@
#include "rna_internal.h"
+#include "DNA_action_types.h"
#include "DNA_customdata_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -39,6 +40,8 @@
#include "DNA_property_types.h"
#include "DNA_scene_types.h"
+#include "BKE_tessmesh.h"
+
#include "WM_api.h"
#include "WM_types.h"
@@ -82,6 +85,8 @@ EnumPropertyItem object_type_items[] = {
#ifdef RNA_RUNTIME
+#include "BLI_arithb.h"
+
#include "DNA_key_types.h"
#include "BKE_armature.h"
@@ -96,13 +101,22 @@ EnumPropertyItem object_type_items[] = {
#include "BKE_particle.h"
#include "BKE_scene.h"
+#include "BLI_editVert.h" /* for EditMesh->mat_nr */
+
#include "ED_object.h"
+#include "ED_particle.h"
void rna_Object_update(bContext *C, PointerRNA *ptr)
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
}
+void rna_Object_matrix_update(bContext *C, PointerRNA *ptr)
+{
+ ED_object_apply_obmat(ptr->id.data);
+ rna_Object_update(C, ptr);
+}
+
void rna_Object_update_data(bContext *C, PointerRNA *ptr)
{
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
@@ -115,6 +129,14 @@ static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr)
DAG_scene_sort(CTX_data_scene(C));
}
+/* when changing the selection flag the scene needs updating */
+static void rna_Object_select_update(bContext *C, PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
+ ED_base_object_select(object_in_scene(ob, CTX_data_scene(C)), mode);
+}
+
static void rna_Object_layer_update(bContext *C, PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -203,24 +225,12 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
ED_object_parent(ob, ob->parent, value, ob->parsubstr);
}
-static void rna_Object_track_set(PointerRNA *ptr, PointerRNA value)
-{
- Object *ob= (Object*)ptr->data;
-
- if(ob != value.data)
- ob->track= value.data;
-}
-
static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Object *ob= (Object*)ptr->data;
EnumPropertyItem *item= NULL;
int totitem= 0;
- if(C==NULL) {
- return parent_type_items;
- }
-
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PAROBJECT);
if(ob->parent) {
@@ -241,7 +251,6 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *C, PointerRNA *p
}
RNA_enum_item_end(&item, &totitem);
-
*free= 1;
return item;
@@ -395,6 +404,13 @@ static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
{
Object *ob= (Object*)ptr->id.data;
ob->actcol= value+1;
+
+ if((ob->mode & OB_MODE_EDIT) && ob->type==OB_MESH) {
+ Mesh *me= ob->data;
+
+ if(me->edit_btmesh)
+ me->edit_btmesh->mat_nr= value;
+ }
}
static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max)
@@ -434,12 +450,79 @@ static int rna_Object_active_particle_system_index_get(PointerRNA *ptr)
return psys_get_current_num(ob);
}
-static void rna_Object_active_particle_system_index_set(struct PointerRNA *ptr, int value)
+static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int value)
{
Object *ob= (Object*)ptr->id.data;
psys_set_current_num(ob, value);
}
+static void rna_Object_particle_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= CTX_data_scene(C);
+ Object *ob= (Object*)ptr->id.data;
+
+ PE_current_changed(scene, ob);
+}
+
+/* rotation - axis-angle */
+static void rna_Object_rotation_axis_angle_get(PointerRNA *ptr, float *value)
+{
+ Object *ob= ptr->data;
+
+ /* for now, assume that rotation mode is axis-angle */
+ value[0]= ob->rotAngle;
+ VecCopyf(&value[1], ob->rotAxis);
+}
+
+/* rotation - axis-angle */
+static void rna_Object_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
+{
+ Object *ob= ptr->data;
+
+ /* for now, assume that rotation mode is axis-angle */
+ ob->rotAngle= value[0];
+ VecCopyf(ob->rotAxis, (float *)&value[1]);
+
+ // TODO: validate axis?
+}
+
+static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value)
+{
+ Object *ob= ptr->data;
+
+ /* use API Method for conversions... */
+ BKE_rotMode_change_values(ob->quat, ob->rot, ob->rotAxis, &ob->rotAngle, ob->rotmode, (short)value);
+
+ /* finally, set the new rotation type */
+ ob->rotmode= value;
+}
+
+/* not called directly */
+static void rna_Object_scale_linked_set(Object *ob, float value, int axis)
+{
+ if(ob->size[axis]==0.0f || value==0.0f) {
+ ob->size[0]= ob->size[1]= ob->size[2]= value;
+ }
+ else {
+ VecMulf(ob->size, value / ob->size[axis]);
+ }
+}
+
+static void rna_Object_scale_x_linked_set(PointerRNA *ptr, float value)
+{
+ rna_Object_scale_linked_set(ptr->data, value, 0);
+}
+static void rna_Object_scale_y_linked_set(PointerRNA *ptr, float value)
+{
+ rna_Object_scale_linked_set(ptr->data, value, 1);
+}
+static void rna_Object_scale_z_linked_set(PointerRNA *ptr, float value)
+{
+ rna_Object_scale_linked_set(ptr->data, value, 2);
+}
+
+
+
static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -661,7 +744,6 @@ static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value)
Object *ob= (Object*)ptr->id.data;
ob->shapenr= value+1;
- ob->shapeflag |= OB_SHAPE_TEMPLOCK;
}
static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr)
@@ -685,8 +767,6 @@ static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value)
if(value) ob->shapeflag |= OB_SHAPE_LOCK;
else ob->shapeflag &= ~OB_SHAPE_LOCK;
-
- ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
}
static PointerRNA rna_Object_field_get(PointerRNA *ptr)
@@ -695,7 +775,7 @@ static PointerRNA rna_Object_field_get(PointerRNA *ptr)
/* weak */
if(!ob->pd)
- ob->pd= object_add_collision_fields();
+ ob->pd= object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd);
}
@@ -706,7 +786,7 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
/* weak */
if(!ob->pd)
- ob->pd= object_add_collision_fields();
+ ob->pd= object_add_collision_fields(0);
return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
}
@@ -1045,6 +1125,18 @@ static void rna_def_object(BlenderRNA *brna)
{OB_DUPLIFACES, "FACES", 0, "Faces", "Duplicate child objects on all faces."},
{OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing."},
{0, NULL, 0, NULL, NULL}};
+
+ // XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
+ static EnumPropertyItem prop_rotmode_items[] = {
+ {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock."},
+ {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock. (Default)"},
+ {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
+ {0, NULL, 0, NULL, NULL}};
int matrix_dimsize[]= {4, 4};
@@ -1082,12 +1174,10 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Selected", "Object selection state.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_select_update");
/* parent and track */
-
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -1115,8 +1205,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_track_set", NULL);
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update");
@@ -1133,7 +1222,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
/* proxy */
-
prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls.");
@@ -1161,57 +1249,124 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, NULL);
/* transform */
-
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "Location of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
- prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_float_sdna(prop, NULL, "dloc");
- RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
+
+ prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ RNA_def_property_float_sdna(prop, NULL, "quat");
+ RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
+ * having a single one is better for Keyframing and other property-management situations...
+ */
+ prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ RNA_def_property_array(prop, 4); // TODO: maybe we'll need to define the 'default value' getter too...
+ RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get", "rna_Object_rotation_axis_angle_set", NULL);
+ RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
+ prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
- RNA_def_property_ui_text(prop, "Rotation", "Rotation of the object.");
+ RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
- prop= RNA_def_property(srna, "delta_rotation", PROP_FLOAT, PROP_EULER);
- RNA_def_property_float_sdna(prop, NULL, "drot");
- RNA_def_property_ui_text(prop, "Delta Rotation", "Extra added rotation to the rotation of the object.");
+
+ prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "rotmode");
+ RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL);
+ RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "Scaling of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ /* linked scale for the transform panel */
+ prop= RNA_def_property(srna, "scale_linked_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "size[0]");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Object_scale_x_linked_set", NULL);
+ RNA_def_property_ui_text(prop, "Scale X", "Scaling of the objects X axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "scale_linked_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "size[1]");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Object_scale_y_linked_set", NULL);
+ RNA_def_property_ui_text(prop, "Scale Y", "Scaling of the objects X axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "scale_linked_z", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "size[2]");
+ RNA_def_property_float_funcs(prop, NULL, "rna_Object_scale_z_linked_set", NULL);
+ RNA_def_property_ui_text(prop, "Scale Z", "Scaling of the objects Z axis.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ /* delta transforms */
+ prop= RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION);
+ RNA_def_property_float_sdna(prop, NULL, "dloc");
+ RNA_def_property_ui_text(prop, "Delta Location", "Extra added translation to object location.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER);
+ RNA_def_property_float_sdna(prop, NULL, "drot");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Euler)", "Extra added rotation to the rotation of the object (when using Euler rotations).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
+ RNA_def_property_float_sdna(prop, NULL, "dquat");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra added rotation to the rotation of the object (when using Quaternion rotations).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+#if 0 // XXX not supported well yet...
+ prop= RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "dquat"); // FIXME: this is not a single field any more! (drotAxis and drotAngle)
+ RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra added rotation to the rotation of the object (when using Axis-Angle rotations).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+#endif
+
prop= RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "dsize");
RNA_def_property_ui_text(prop, "Delta Scale", "Extra added scaling to the scale of the object.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
-
+
+ /* transform locks */
prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
+
+ // XXX this is sub-optimal - it really should be included above, but due to technical reasons we can't do this!
+ prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
+ RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface.");
+ // XXX this needs a better name
+ prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
+ RNA_def_property_ui_text(prop, "Lock Rotations (4D)", "Lock editing of four component rotations by components (instead of as Eulers).");
prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
/* matrix */
prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "obmat");
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_update");
/* collections */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
@@ -1223,14 +1378,13 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the geometric data of the Object.");
/* game engine */
-
- prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "GameObjectSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object.");
/* vertex groups */
-
prop= RNA_def_property(srna, "vertex_groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL);
RNA_def_property_struct_type(prop, "VertexGroup");
@@ -1249,7 +1403,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Object_update_data");
/* empty */
-
prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype");
RNA_def_property_enum_items(prop, empty_drawtype_items);
@@ -1263,7 +1416,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* render */
-
prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "index");
RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexOB render pass.");
@@ -1274,7 +1426,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* physics */
-
prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "FieldSettings");
@@ -1305,10 +1456,9 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_particle_system_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range");
RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update");
/* restrict */
-
prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW);
RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport.");
@@ -1325,20 +1475,9 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* anim */
-
rna_def_animdata_common(srna);
- prop= RNA_def_property(srna, "draw_keys", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEY);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE); // update ipo flag indirect
- RNA_def_property_ui_text(prop, "Draw Keys", "Draw object as key positions.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
-
- prop= RNA_def_property(srna, "draw_keys_selected", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_DRAWKEYSEL);
- RNA_def_property_ui_text(prop, "Draw Keys Selected", "Limit the drawing of object keys to selected.");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
-
+ /* duplicates */
prop= RNA_def_property(srna, "track_override_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_POWERTRACK);
RNA_def_property_ui_text(prop, "Track Override Parent", "Override rotation from parenting.");
@@ -1384,30 +1523,36 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupsta");
- RNA_def_property_range(prop, 1, 32767);
+ RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupend");
- RNA_def_property_range(prop, 1, 32767);
+ RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupon");
- RNA_def_property_range(prop, 1, 1500);
+ RNA_def_property_range(prop, MINFRAME, MAXFRAME);
+ RNA_def_property_ui_range(prop, 1, 1500, 1, 0);
RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_int_sdna(prop, NULL, "dupoff");
- RNA_def_property_range(prop, 0, 1500);
+ RNA_def_property_range(prop, 0, MAXFRAME);
+ RNA_def_property_ui_range(prop, 0, 1500, 1, 0);
RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update");
- /* time offset */
+ prop= RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "duplilist", NULL);
+ RNA_def_property_struct_type(prop, "DupliObject");
+ RNA_def_property_ui_text(prop, "Dupli list", "Object duplis.");
+ /* time offset */
prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME);
RNA_def_property_float_sdna(prop, NULL, "sf");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
@@ -1434,7 +1579,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
/* drawing */
-
prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dt");
RNA_def_property_enum_items(prop, drawtype_items);
@@ -1501,7 +1645,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures.");
/* shape keys */
-
prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set");
@@ -1523,12 +1666,43 @@ static void rna_def_object(BlenderRNA *brna)
RNA_api_object(srna);
}
+static void rna_def_dupli_object(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "DupliObject", NULL);
+ RNA_def_struct_sdna(srna, "DupliObject");
+ RNA_def_struct_ui_text(srna, "Dupli Object", "Dupli Object data.");
+ /* RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA); */
+
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ /* RNA_def_property_struct_type(prop, "Object"); */
+ RNA_def_property_pointer_sdna(prop, NULL, "ob");
+ /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL); */
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Object", "Object this DupliObject represents.");
+
+ prop= RNA_def_property(srna, "ob_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "omat");
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Object Matrix", "Object transformation matrix.");
+
+ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "mat");
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "DupliObject Matrix", "DupliObject transformation matrix.");
+
+ /* TODO: DupliObject has more properties that can be wrapped */
+}
+
void RNA_def_object(BlenderRNA *brna)
{
rna_def_object(brna);
rna_def_object_game_settings(brna);
rna_def_vertex_group(brna);
rna_def_material_slot(brna);
+ rna_def_dupli_object(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 88b6e6919e0..098604c1eab 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -1,5 +1,5 @@
/**
- * $Id: rna_object_api.c 21094 2009-06-23 00:09:26Z gsrb3d $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -28,42 +28,64 @@
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
+#include <time.h>
#include "RNA_define.h"
#include "RNA_types.h"
+#include "DNA_object_types.h"
+
+#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
+
+#include "ED_mesh.h"
+
#ifdef RNA_RUNTIME
-#include "MEM_guardedalloc.h"
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_context.h"
+#include "BKE_report.h"
+#include "BKE_object.h"
+#include "BKE_mesh.h"
+#include "BKE_DerivedMesh.h"
#include "BKE_customdata.h"
-#include "BKE_DerivedMesh.h"
+#include "BKE_anim.h"
+#include "BKE_depsgraph.h"
#include "BKE_displist.h"
-#include "BKE_object.h"
-#include "BKE_main.h"
+#include "BKE_font.h"
+#include "BKE_mball.h"
+
+#include "BLI_arithb.h"
#include "DNA_mesh_types.h"
-#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_modifier_types.h"
+
+#include "MEM_guardedalloc.h"
-/* copied from init_render_mesh (render code) */
-static Mesh *rna_Object_create_render_mesh(Object *ob, bContext *C, Scene *scene)
+/* copied from Mesh_getFromObject and adapted to RNA interface */
+/* settings: 0 - preview, 1 - render */
+static Mesh *rna_Object_create_mesh(Object *ob, bContext *C, ReportList *reports, int apply_modifiers, int settings)
{
- CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL;
+ Mesh *tmpmesh;
+ Curve *tmpcu = NULL;
Object *tmpobj = NULL;
- DerivedMesh *dm;
- Mesh *me;
-
- switch(ob->type) {
+ int render = settings, i;
+ int cage = !apply_modifiers;
+ Scene *sce = CTX_data_scene(C);
+
+ /* perform the mesh extraction based on type */
+ switch (ob->type) {
case OB_FONT:
case OB_CURVE:
case OB_SURF:
- {
- int cage = 0; //XXX -todo
- Curve *tmpcu = NULL;
/* copies object and modifiers (but not the data) */
- tmpobj= copy_object( ob );
+ tmpobj= copy_object(ob);
tmpcu = (Curve *)tmpobj->data;
tmpcu->id.us--;
@@ -87,80 +109,321 @@ static Mesh *rna_Object_create_render_mesh(Object *ob, bContext *C, Scene *scene
#endif
/* get updated display list, and convert to a mesh */
- makeDispListCurveTypes( scene, tmpobj, 0 );
+ makeDispListCurveTypes( sce, tmpobj, 0 );
nurbs_to_mesh( tmpobj );
-
- /* nurbs_to_mesh changes the type tp a mesh, check it worked */
+
+ /* nurbs_to_mesh changes the type to a mesh, check it worked */
if (tmpobj->type != OB_MESH) {
free_libblock_us( &(CTX_data_main(C)->object), tmpobj );
- printf("cant convert curve to mesh. Does the curve have any segments?" ); // XXX use report api
+ BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?");
+ return NULL;
}
- me = tmpobj->data;
- free_libblock_us( &(CTX_data_main(C)->object), tmpobj );
- break;
- }
+ tmpmesh = tmpobj->data;
+ free_libblock_us( &G.main->object, tmpobj );
+ break;
+
case OB_MBALL:
/* metaballs don't have modifiers, so just convert to mesh */
- ob = find_basis_mball( ob );
+ ob = find_basis_mball( sce, ob );
/* todo, re-generatre for render-res */
- // metaball_polygonize(scene, ob)
- me = add_mesh("Mesh");
- mball_to_mesh( &ob->disp, me );
+ /* metaball_polygonize(scene, ob) */
+
+ tmpmesh = add_mesh("Mesh");
+ mball_to_mesh( &ob->disp, tmpmesh );
+ break;
+
+ case OB_MESH:
+ /* copies object and modifiers (but not the data) */
+ if (cage) {
+ /* copies the data */
+ tmpmesh = copy_mesh( ob->data );
+ /* if not getting the original caged mesh, get final derived mesh */
+ } else {
+ /* Make a dummy mesh, saves copying */
+ DerivedMesh *dm;
+ /* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
+ CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
+ for example, needs CD_MASK_MDEFORMVERT */
+
+ /* Write the display mesh into the dummy mesh */
+ if (render)
+ dm = mesh_create_derived_render( sce, ob, mask );
+ else
+ dm = mesh_create_derived_view( sce, ob, mask );
+
+ tmpmesh = add_mesh( "Mesh" );
+ DM_to_mesh( dm, tmpmesh );
+ dm->release( dm );
+ }
+
break;
- case OB_MESH:
- {
- dm= mesh_create_derived_render(scene, ob, mask);
- // dm= mesh_create_derived_view(scene, ob, mask);
+ default:
+ BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
+ return NULL;
+ }
- if(!dm)
- return NULL;
+ /* Copy materials to new mesh */
+ switch (ob->type) {
+ case OB_SURF:
+ tmpmesh->totcol = tmpcu->totcol;
+
+ /* free old material list (if it exists) and adjust user counts */
+ if( tmpcu->mat ) {
+ for( i = tmpcu->totcol; i-- > 0; ) {
+ /* are we an object material or data based? */
+ if (ob->colbits & 1<<i)
+ tmpmesh->mat[i] = ob->mat[i];
+ else
+ tmpmesh->mat[i] = tmpcu->mat[i];
+
+ if (tmpmesh->mat[i])
+ tmpmesh->mat[i]->id.us++;
+ }
+ }
+ break;
+
+#if 0
+ /* Crashes when assigning the new material, not sure why */
+ case OB_MBALL:
+ tmpmb = (MetaBall *)ob->data;
+ tmpmesh->totcol = tmpmb->totcol;
+
+ /* free old material list (if it exists) and adjust user counts */
+ if( tmpmb->mat ) {
+ for( i = tmpmb->totcol; i-- > 0; ) {
+ tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
+ if (tmpmesh->mat[i]) {
+ tmpmb->mat[i]->id.us++;
+ }
+ }
+ }
+ break;
+#endif
- me= add_mesh("tmp_render_mesh");
- me->id.us--; /* we don't assign it to anything */
- DM_to_mesh(dm, me);
- dm->release(dm);
+ case OB_MESH:
+ if (!cage) {
+ Mesh *origmesh= ob->data;
+ tmpmesh->flag= origmesh->flag;
+ tmpmesh->mat = MEM_dupallocN(origmesh->mat);
+ tmpmesh->totcol = origmesh->totcol;
+ tmpmesh->smoothresh= origmesh->smoothresh;
+ if( origmesh->mat ) {
+ for( i = origmesh->totcol; i-- > 0; ) {
+ /* are we an object material or data based? */
+ if (ob->colbits & 1<<i)
+ tmpmesh->mat[i] = ob->mat[i];
+ else
+ tmpmesh->mat[i] = origmesh->mat[i];
+ if (tmpmesh->mat[i])
+ tmpmesh->mat[i]->id.us++;
+ }
+ }
+ }
break;
+ } /* end copy materials */
+
+ /* we don't assign it to anything */
+ tmpmesh->id.us--;
+
+ /* make sure materials get updated in objects */
+ test_object_materials( ( ID * ) tmpmesh );
+
+ return tmpmesh;
+}
+
+/* When no longer needed, duplilist should be freed with Object.free_duplilist */
+static void rna_Object_create_duplilist(Object *ob, bContext *C, ReportList *reports)
+{
+ if (!(ob->transflag & OB_DUPLI)) {
+ BKE_report(reports, RPT_ERROR, "Object does not have duplis.");
+ return;
}
- default:
- return NULL;
+
+ /* free duplilist if a user forgets to */
+ if (ob->duplilist) {
+ BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed.");
+
+ free_object_duplilist(ob->duplilist);
+ ob->duplilist= NULL;
+ }
+
+ ob->duplilist= object_duplilist(CTX_data_scene(C), ob);
+
+ /* ob->duplilist should now be freed with Object.free_duplilist */
+}
+
+static void rna_Object_free_duplilist(Object *ob, ReportList *reports)
+{
+ if (ob->duplilist) {
+ free_object_duplilist(ob->duplilist);
+ ob->duplilist= NULL;
}
+}
+
+static bDeformGroup *rna_Object_add_vertex_group(Object *ob, char *group_name)
+{
+ return ED_vgroup_add_name(ob, group_name);
+}
+static void rna_Object_add_vertex_to_group(Object *ob, int vertex_index, bDeformGroup *def, float weight, int assignmode)
+{
+ /* creates dverts if needed */
+ ED_vgroup_vert_add(ob, def, vertex_index, weight, assignmode);
+}
+
+/* copied from old API Object.makeDisplayList (Object.c) */
+static void rna_Object_make_display_list(Object *ob, bContext *C)
+{
+ Scene *sce= CTX_data_scene(C);
+
+ if (ob->type == OB_FONT) {
+ Curve *cu = ob->data;
+ freedisplist(&cu->disp);
+ BKE_text_to_curve(sce, ob, CU_LEFT);
+ }
- { /* update the material */
- short i, *totcol =give_totcolp(ob);
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+}
- /* free the current material list */
- if(me->mat)
- MEM_freeN((void *)me->mat);
+static Object *rna_Object_find_armature(Object *ob)
+{
+ Object *ob_arm = NULL;
- me->mat= (Material **)MEM_callocN(sizeof(void *)*(*totcol), "matarray");
+ if (ob->type != OB_MESH) return NULL;
- for(i=0; i<*totcol; i++) {
- Material *mat= give_current_material(ob, i+1);
- if(mat) {
- me->mat[i]= mat;
- mat->id.us++;
+ if (ob->parent && ob->partype == PARSKEL && ob->parent->type == OB_ARMATURE) {
+ ob_arm = ob->parent;
+ }
+ else {
+ ModifierData *mod = (ModifierData*)ob->modifiers.first;
+ while (mod) {
+ if (mod->type == eModifierType_Armature) {
+ ob_arm = ((ArmatureModifierData*)mod)->object;
}
+
+ mod = mod->next;
}
}
- return me;
+ return ob_arm;
+}
+
+int rna_Object_is_visible(Object *ob, bContext *C)
+{
+ return ob->lay & CTX_data_scene(C)->lay;
+}
+
+/*
+static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
+{
+ if (ob->type != OB_MESH) {
+ BKE_report(reports, RPT_ERROR, "Object should be of MESH type.");
+ return;
+ }
+
+ Mesh *me = (Mesh*)ob->data;
+ int group_index = get_defgroup_num(ob, group);
+ if (group_index == -1) {
+ BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh.");
+ return;
+ }
+
+ if (assignmode != WEIGHT_REPLACE && assignmode != WEIGHT_ADD && assignmode != WEIGHT_SUBTRACT) {
+ BKE_report(reports, RPT_ERROR, "Bad assignment mode." );
+ return;
+ }
+
+ // makes a set of dVerts corresponding to the mVerts
+ if (!me->dvert)
+ create_dverts(&me->id);
+
+ // loop list adding verts to group
+ for (i= 0; i < totindex; i++) {
+ if(i < 0 || i >= me->totvert) {
+ BKE_report(reports, RPT_ERROR, "Bad vertex index in list.");
+ return;
+ }
+
+ add_vert_defnr(ob, group_index, i, weight, assignmode);
+ }
}
+*/
#else
void RNA_api_object(StructRNA *srna)
{
FunctionRNA *func;
- PropertyRNA *prop;
+ PropertyRNA *parm;
+
+ static EnumPropertyItem mesh_type_items[] = {
+ {0, "PREVIEW", 0, "Preview", "Apply modifier preview settings."},
+ {1, "RENDER", 0, "Render", "Apply modifier render settings."},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static EnumPropertyItem assign_mode_items[] = {
+ {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace."}, /* TODO: more meaningful descriptions */
+ {WEIGHT_ADD, "ADD", 0, "Add", "Add."},
+ {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract."},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ /* mesh */
+ func= RNA_def_function(srna, "create_mesh", "rna_Object_create_mesh");
+ RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
+ parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export.");
+ RNA_def_function_return(func, parm);
+
+ /* duplis */
+ func= RNA_def_function(srna, "create_dupli_list", "rna_Object_create_duplilist");
+ RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to be freed manually with free_dupli_list.");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
+
+ func= RNA_def_function(srna, "free_dupli_list", "rna_Object_free_duplilist");
+ RNA_def_function_ui_description(func, "Free the list of dupli objects.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+
+ /* vertex groups */
+ func= RNA_def_function(srna, "add_vertex_group", "rna_Object_add_vertex_group");
+ RNA_def_function_ui_description(func, "Add vertex group to object.");
+ parm= RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */
+ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "add_vertex_to_group", "rna_Object_add_vertex_to_group");
+ RNA_def_function_ui_description(func, "Add vertex to a vertex group.");
+ parm= RNA_def_int(func, "vertex_index", 0, 0, 0, "", "Vertex index.", 0, 0);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to add vertex to.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ /* Armature */
+ func= RNA_def_function(srna, "find_armature", "rna_Object_find_armature");
+ RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier.");
+ parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL.");
+ RNA_def_function_return(func, parm);
+
+ /* DAG */
+ func= RNA_def_function(srna, "make_display_list", "rna_Object_make_display_list");
+ RNA_def_function_ui_description(func, "Update object's display data."); /* XXX describe better */
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- func= RNA_def_function(srna, "create_render_mesh", "rna_Object_create_render_mesh");
- RNA_def_function_ui_description(func, "Create a Mesh datablock with all modifiers applied.");
+ /* View */
+ func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
+ RNA_def_function_ui_description(func, "Determine if object is visible in active scene.");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- prop= RNA_def_pointer(func, "scene", "Scene", "", "");
- RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export.");
- RNA_def_function_return(func, prop);
+ parm= RNA_def_boolean(func, "is_visible", 0, "", "Object visibility.");
+ RNA_def_function_return(func, parm);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 3dfbfcccacf..2247e5499fb 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -31,11 +31,54 @@
#include "DNA_object_types.h"
#include "DNA_object_force.h"
+#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "WM_api.h"
#include "WM_types.h"
+EnumPropertyItem effector_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
+ {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Surface", ""},
+ {PFIELD_SHAPE_POINTS, "POINTS", 0, "Every Point", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem curve_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
+ {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Curve", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem empty_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem vortex_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Old", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "New", ""},
+ {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Surface falloff (New)", ""},
+ {PFIELD_SHAPE_POINTS, "POINTS", 0, "Every Point (New)", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem curve_vortex_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Old", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "New", ""},
+ {PFIELD_SHAPE_SURFACE, "SURFACE", 0, "Curve (New)", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem empty_vortex_shape_items[] = {
+ {PFIELD_SHAPE_POINT, "POINT", 0, "Old", ""},
+ {PFIELD_SHAPE_PLANE, "PLANE", 0, "New", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -358,65 +401,115 @@ static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *va
rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup);
}
+static int particle_field_check(PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ return (GS(id->name) == ID_PA);
+}
static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
+ if(particle_field_check(ptr)) {
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
+
+ if(part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) {
+ part->pd->tex->id.us--;
+ part->pd->tex= 0;
+ }
+
+ if(part->pd2->forcefield != PFIELD_TEXTURE && part->pd2->tex) {
+ part->pd2->tex->id.us--;
+ part->pd2->tex= 0;
+ }
+
+ DAG_id_flush_update(&part->id, OB_RECALC|PSYS_RECALC_RESET);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
- if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
- ob->pd->tex->id.us--;
- ob->pd->tex= 0;
}
+ else {
+ Object *ob = (Object*)ptr->id.data;
- DAG_id_flush_update(&ob->id, OB_RECALC_OB);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
+ ob->pd->tex->id.us--;
+ ob->pd->tex= 0;
+ }
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
}
-static void rna_FieldSettings_surface_update(bContext *C, PointerRNA *ptr)
+static void rna_FieldSettings_shape_update(bContext *C, PointerRNA *ptr)
{
Scene *scene= CTX_data_scene(C);
- Object *ob= (Object*)ptr->id.data;
- PartDeflect *pd= ob->pd;
- ModifierData *md= modifiers_findByType(ob, eModifierType_Surface);
- /* add/remove modifier as needed */
- if(!md) {
- if(pd && (pd->flag & PFIELD_SURFACE))
- if(ELEM6(pd->forcefield,PFIELD_HARMONIC,PFIELD_FORCE,PFIELD_HARMONIC,PFIELD_CHARGE,PFIELD_LENNARDJ,PFIELD_BOID))
+ if(!particle_field_check(ptr)) {
+ Object *ob= (Object*)ptr->id.data;
+ PartDeflect *pd= ob->pd;
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Surface);
+
+ /* add/remove modifier as needed */
+ if(!md) {
+ if(pd && (pd->shape == PFIELD_SHAPE_SURFACE) && ELEM(pd->forcefield,PFIELD_GUIDE,PFIELD_TEXTURE)==0)
if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE))
ED_object_modifier_add(NULL, scene, ob, eModifierType_Surface);
- }
- else {
- if(!pd || !(pd->flag & PFIELD_SURFACE))
- ED_object_modifier_remove(NULL, scene, ob, md);
- }
+ }
+ else {
+ if(!pd || pd->shape != PFIELD_SHAPE_SURFACE)
+ ED_object_modifier_remove(NULL, scene, ob, md);
+ }
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
}
static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr)
{
Scene *scene= CTX_data_scene(C);
- Object *ob= (Object*)ptr->id.data;
- /* do this before scene sort, that one checks for CU_PATH */
- /* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
- Curve *cu= ob->data;
- cu->flag |= (CU_PATH|CU_3D);
- do_curvebuts(B_CU3D); // all curves too
- }*/
+ if(particle_field_check(ptr)) {
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC|PSYS_RECALC_RESET);
+ }
+ else {
+ Object *ob= (Object*)ptr->id.data;
- rna_FieldSettings_surface_update(C, ptr);
+ /* do this before scene sort, that one checks for CU_PATH */
+ /* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
+ Curve *cu= ob->data;
+ cu->flag |= (CU_PATH|CU_3D);
+ do_curvebuts(B_CU3D); // all curves too
+ }*/
- DAG_scene_sort(scene);
+ rna_FieldSettings_shape_update(C, ptr);
- if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
- DAG_id_flush_update(&ob->id, OB_RECALC);
- else
- DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+ DAG_scene_sort(scene);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
+ DAG_id_flush_update(&ob->id, OB_RECALC);
+ else
+ DAG_id_flush_update(&ob->id, OB_RECALC_OB);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ }
+}
+
+static void rna_EffectorWeight_update(bContext *C, PointerRNA *ptr)
+{
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
}
+static void rna_EffectorWeight_dependency_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= CTX_data_scene(C);
+
+ DAG_scene_sort(scene);
+
+ DAG_id_flush_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
+
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL);
+}
static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr)
{
Scene *scene= CTX_data_scene(C);
@@ -448,6 +541,37 @@ static void rna_softbody_update(bContext *C, PointerRNA *ptr)
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
}
+
+static EnumPropertyItem *rna_Effector_shape_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Object *ob= NULL;
+
+ if(particle_field_check(ptr))
+ return empty_shape_items;
+
+ ob= (Object*)ptr->id.data;
+
+ if(ob->type == OB_CURVE) {
+ if(ob->pd->forcefield == PFIELD_VORTEX)
+ return curve_vortex_shape_items;
+
+ return curve_shape_items;
+ }
+ else if(ELEM3(ob->type, OB_MESH, OB_SURF, OB_FONT)) {
+ if(ob->pd->forcefield == PFIELD_VORTEX)
+ return vortex_shape_items;
+
+ return effector_shape_items;
+ }
+ else {
+ if(ob->pd->forcefield == PFIELD_VORTEX)
+ return empty_vortex_shape_items;
+
+ return empty_shape_items;
+ }
+}
+
+
#else
static void rna_def_pointcache(BlenderRNA *brna)
@@ -617,6 +741,135 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Collision from Stack", "Pick collision object from modifier stack (softbody only)");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
*/
+
+ prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
+ RNA_def_property_ui_text(prop, "Absorption", "How much of effector force gets lost during collision with this object (in percent).");
+ RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
+}
+
+static void rna_def_effector_weight(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "EffectorWeights", NULL);
+ RNA_def_struct_ui_text(srna, "Effector Weights", "Effector weights for physics simulation.");
+ RNA_def_struct_ui_icon(srna, ICON_PHYSICS);
+
+ /* Flags */
+ prop= RNA_def_property(srna, "do_growing_hair", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", EFF_WEIGHT_DO_HAIR);
+ RNA_def_property_ui_text(prop, "Use For Growing Hair", "Use force fields when growing hair.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ /* General */
+ prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "group");
+ RNA_def_property_struct_type(prop, "Group");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_dependency_update");
+
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "global_gravity");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Gravity", "Global gravity weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ /* Effector weights */
+ prop= RNA_def_property(srna, "all", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[0]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "All", "All effector's weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[1]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Force", "Force effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "vortex", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[2]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Vortex", "Vortex effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "magnetic", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[3]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Magnetic", "Magnetic effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "wind", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[4]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Wind", "Wind effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "curveguide", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[5]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Curve Guide", "Curve guide effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "texture", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[6]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Texture", "Texture effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "harmonic", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[7]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Harmonic", "Harmonic effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "charge", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[8]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Charge", "Charge effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "lennardjones", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[9]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Lennard-Jones", "Lennard-Jones effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "boid", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[10]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Boid", "Boid effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[11]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Turbulence", "Turbulence effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
+
+ prop= RNA_def_property(srna, "drag", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "weight[12]");
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
+ RNA_def_property_ui_text(prop, "Drag", "Drag effector weight.");
+ RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
}
static void rna_def_field(BlenderRNA *brna)
@@ -626,18 +879,20 @@ static void rna_def_field(BlenderRNA *brna)
static EnumPropertyItem field_type_items[] = {
{0, "NONE", 0, "None", ""},
- {PFIELD_FORCE, "SPHERICAL", 0, "Spherical", ""},
+ {PFIELD_FORCE, "FORCE", 0, "Force", ""},
+ {PFIELD_WIND, "WIND", 0, "Wind", ""},
{PFIELD_VORTEX, "VORTEX", 0, "Vortex", ""},
{PFIELD_MAGNET, "MAGNET", 0, "Magnetic", ""},
- {PFIELD_WIND, "WIND", 0, "Wind", ""},
- {PFIELD_GUIDE, "GUIDE", 0, "Curve Guide", ""},
- {PFIELD_TEXTURE, "TEXTURE", 0, "Texture", ""},
{PFIELD_HARMONIC, "HARMONIC", 0, "Harmonic", ""},
{PFIELD_CHARGE, "CHARGE", 0, "Charge", ""},
{PFIELD_LENNARDJ, "LENNARDJ", 0, "Lennard-Jones", ""},
+ {PFIELD_TEXTURE, "TEXTURE", 0, "Texture", ""},
+ {PFIELD_GUIDE, "GUIDE", 0, "Curve Guide", ""},
{PFIELD_BOID, "BOID", 0, "Boid", ""},
+ {PFIELD_TURBULENCE, "TURBULENCE", 0, "Turbulence", ""},
+ {PFIELD_DRAG, "DRAG", 0, "Drag", ""},
{0, NULL, 0, NULL, NULL}};
-
+
static EnumPropertyItem falloff_items[] = {
{PFIELD_FALL_SPHERE, "SPHERE", 0, "Sphere", ""},
{PFIELD_FALL_TUBE, "TUBE", 0, "Tube", ""},
@@ -650,6 +905,28 @@ static void rna_def_field(BlenderRNA *brna)
{PFIELD_TEX_CURL, "CURL", 0, "Curl", ""},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem zdirection_items[] = {
+ {PFIELD_Z_BOTH, "BOTH", 0, "Both Z", ""},
+ {PFIELD_Z_POS, "POSITIVE", 0, "+Z", ""},
+ {PFIELD_Z_NEG, "NEGATIVE", 0, "-Z", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem guide_kink_items[] = {
+ {0, "NONE", 0, "Nothing", ""},
+ {1, "CURL", 0, "Curl", ""},
+ {2, "RADIAL", 0, "Radial", ""},
+ {3, "WAVE", 0, "Wave", ""},
+ {4, "BRAID", 0, "Braid", ""},
+ {5, "ROTATION", 0, "Rotation", ""},
+ {6, "ROLL", 0, "Roll", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem guide_kink_axis_items[] = {
+ {0, "X", 0, "X", ""},
+ {1, "Y", 0, "Y", ""},
+ {2, "Z", 0, "Z", ""},
+ {0, NULL, 0, NULL, NULL}};
+
srna= RNA_def_struct(brna, "FieldSettings", NULL);
RNA_def_struct_sdna(srna, "PartDeflect");
RNA_def_struct_ui_text(srna, "Field Settings", "Field settings for an object in physics simulation.");
@@ -662,6 +939,12 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_enum_items(prop, field_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of field.");
RNA_def_property_update(prop, 0, "rna_FieldSettings_dependency_update");
+
+ prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, effector_shape_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Effector_shape_itemf");
+ RNA_def_property_ui_text(prop, "Shape", "Which direction is used to calculate the effector force.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_shape_update");
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff");
@@ -674,6 +957,12 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_enum_items(prop, texture_items);
RNA_def_property_ui_text(prop, "Texture Mode", "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "zdir");
+ RNA_def_property_enum_items(prop, zdirection_items);
+ RNA_def_property_ui_text(prop, "Z Direction", "Effect in full or only positive/negative Z direction.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Float */
@@ -682,18 +971,51 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Strength", "Strength of force field");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "f_power");
- RNA_def_property_range(prop, 0.0f, 10.0f);
- RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)");
+
+ /* different ui range to above */
+ prop= RNA_def_property(srna, "linear_drag", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_strength");
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Linear Drag", "Drag component proportional to velocity.");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
+
prop= RNA_def_property(srna, "harmonic_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "f_damp");
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Harmonic Damping", "Damping of the harmonic force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* different ui range to above */
+ prop= RNA_def_property(srna, "quadratic_drag", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_damp");
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Quadratic Drag", "Drag component proportional to the square of velocity.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "flow", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_flow");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Flow", "Convert effector force into air flow velocity");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* different ui range to above */
+ prop= RNA_def_property(srna, "inflow", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_flow");
+ RNA_def_property_range(prop, -10.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Inflow", "Inwards component of the vortex force");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_size");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Size", "Size of the noise");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_power");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mindist");
@@ -765,31 +1087,16 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Max", "Use a maximum radial distance for the field to work");
// "Use a maximum angle for the field to work"
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "guide_path_add", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD);
- RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "planar", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_PLANAR);
- RNA_def_property_ui_text(prop, "Planar", "Create planar field");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
- prop= RNA_def_property(srna, "surface", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_SURFACE);
- RNA_def_property_ui_text(prop, "Surface", "Use closest point on surface");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_surface_update");
-
- prop= RNA_def_property(srna, "positive_z", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_POSZ);
- RNA_def_property_ui_text(prop, "Positive", "Effect only in direction of positive Z axis");
- RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-
+
prop= RNA_def_property(srna, "use_coordinates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_OBJECT);
RNA_def_property_ui_text(prop, "Use Coordinates", "Use object/global coordinates for texture");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "global_coordinates", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GLOBAL_CO);
+ RNA_def_property_ui_text(prop, "Use Global Coordinates", "Use effector/global coordinates for turbulence");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "force_2d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D);
@@ -800,6 +1107,21 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_ROOTCO);
RNA_def_property_ui_text(prop, "Root Texture Coordinates", "Texture coordinates from root particle locations");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "do_location", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_DO_LOCATION);
+ RNA_def_property_ui_text(prop, "Location", "Effect particles' location");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "do_rotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_DO_ROTATION);
+ RNA_def_property_ui_text(prop, "Rotation", "Effect particles' dynamic rotation");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "do_absorption", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_VISIBILITY);
+ RNA_def_property_ui_text(prop, "Absorption", "Force gets absorbed by collision objects");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
/* Pointer */
@@ -808,6 +1130,74 @@ static void rna_def_field(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture to use as force");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /********** Curve Guide Field Settings **********/
+
+ prop= RNA_def_property(srna, "guide_minimum", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f_strength");
+ RNA_def_property_range(prop, 0.0f, 1000.0f);
+ RNA_def_property_ui_text(prop, "Minimum Distance", "The distance from which particles are affected fully.");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_free", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "free_end");
+ RNA_def_property_range(prop, 0.0f, 0.99f);
+ RNA_def_property_ui_text(prop, "Free", "Guide-free time from particle life's end");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_path_add", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD);
+ RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* Clump Settings */
+
+ prop= RNA_def_property(srna, "guide_clump_amount", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clump_fac");
+ RNA_def_property_range(prop, -1.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Amount", "Amount of clumpimg");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_clump_shape", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clump_pow");
+ RNA_def_property_range(prop, -0.999f, 0.999f);
+ RNA_def_property_ui_text(prop, "Shape", "Shape of clumpimg");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* Kink Settings */
+
+ prop= RNA_def_property(srna, "guide_kink_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "kink");
+ RNA_def_property_enum_items(prop, guide_kink_items);
+ RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the curve");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_kink_axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "kink_axis");
+ RNA_def_property_enum_items(prop, guide_kink_axis_items);
+ RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_kink_frequency", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "kink_freq");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_kink_shape", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "kink_shape");
+ RNA_def_property_range(prop, -0.999f, 0.999f);
+ RNA_def_property_ui_text(prop, "Shape", "djust the offset to the beginning/end");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ prop= RNA_def_property(srna, "guide_kink_amplitude", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "kink_amp");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset");
+ RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+ /* Variables used for Curve Guide, allready wrapped, used for other fields too */
+ // falloff_power, use_max_distance, maximum_distance
}
static void rna_def_game_softbody(BlenderRNA *brna)
@@ -1109,12 +1499,18 @@ static void rna_def_softbody(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set");
RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision.");
RNA_def_property_update(prop, 0, "rna_softbody_update");
+
+ prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "EffectorWeights");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Weights", "");
}
void RNA_def_object_force(BlenderRNA *brna)
{
rna_def_pointcache(brna);
rna_def_collision(brna);
+ rna_def_effector_weight(brna);
rna_def_field(brna);
rna_def_game_softbody(brna);
rna_def_softbody(brna);
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index bbbb13c6e97..d261bda739e 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -99,55 +99,52 @@ EnumPropertyItem part_hair_ren_as_items[] = {
#include "BKE_context.h"
#include "BKE_cloth.h"
#include "BKE_depsgraph.h"
+#include "BKE_effect.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BLI_arithb.h"
+#include "BLI_listbase.h"
/* property update functions */
-static void rna_Particle_redo(bContext *C, PointerRNA *ptr)
+static void particle_recalc(bContext *C, PointerRNA *ptr, short flag)
{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
- psys->recalc = PSYS_RECALC_REDO;
+ psys->recalc = flag;
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_REDO);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+ else
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|flag);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
}
+static void rna_Particle_redo(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_REDO);
+}
static void rna_Particle_reset(bContext *C, PointerRNA *ptr)
{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
+ particle_recalc(C, ptr, PSYS_RECALC_RESET);
+}
- if(ptr->type==&RNA_ParticleSystem) {
- ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
-
- psys->recalc = PSYS_RECALC_RESET;
+static void rna_Particle_change_type(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
+}
- if(ob) {
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
- }
+static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
+}
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
+static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr)
+{
+ particle_recalc(C, ptr, PSYS_RECALC_CHILD);
}
static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr)
@@ -199,59 +196,6 @@ static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr)
}
}
-static void rna_Particle_change_type(bContext *C, PointerRNA *ptr)
-{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
-
- if(ptr->type==&RNA_ParticleSystem) {
- ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
-
- psys->recalc = PSYS_RECALC_RESET|PSYS_RECALC_TYPE;
-
- if(ob) {
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- }
- else {
- part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
-}
-
-static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr)
-{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part = ptr->id.data;
- psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
-}
-
-static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr)
-{
- Scene *scene = CTX_data_scene(C);
- ParticleSettings *part;
-
- if(ptr->type==&RNA_ParticleSystem) {
- ParticleSystem *psys = (ParticleSystem*)ptr->data;
- Object *ob = psys_find_object(scene, psys);
-
- psys->recalc = PSYS_RECALC_CHILD;
-
- if(ob)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- }
- else {
- part = ptr->id.data;
-
- psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD);
- }
-
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL);
-}
static void rna_Particle_hair_dynamics(bContext *C, PointerRNA *ptr)
{
/* Scene *scene = CTX_data_scene(C); */
@@ -312,9 +256,10 @@ static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
if(value > settings->end)
value = settings->end;
- if(settings->type==PART_REACTOR && value < 1.0)
- value = 1.0;
- else if (value < MINAFRAMEF)
+ //if(settings->type==PART_REACTOR && value < 1.0)
+ // value = 1.0;
+ //else
+ if (value < MINAFRAMEF)
value = MINAFRAMEF;
settings->sta = value;
@@ -475,10 +420,7 @@ static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
{
ParticleSystem *psys= (ParticleSystem*)ptr->data;
- if(psys->part && psys->part->type==PART_HAIR)
- return (psys->flag & PSYS_HAIR_DONE);
- else
- return (psys->pointcache->flag & PTCACHE_BAKED);
+ return psys_check_edited(psys);
}
static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
{
@@ -489,42 +431,77 @@ static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
else
return (psys->pointcache->edit && psys->pointcache->edit->edited);
}
-EnumPropertyItem from_items[] = {
- {PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
- {PART_FROM_FACE, "FACE", 0, "Faces", ""},
- {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
- {0, NULL, 0, NULL, NULL}
-};
+static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleDupliWeight *dw = part->dupliweights.first;
-EnumPropertyItem reactor_from_items[] = {
- {PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
- {PART_FROM_FACE, "FACE", 0, "Faces", ""},
- {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
- {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""},
- {0, NULL, 0, NULL, NULL}
-};
+ for(; dw; dw=dw->next) {
+ if(dw->flag & PART_DUPLIW_CURRENT)
+ return rna_pointer_inherit_refine(ptr, &RNA_ParticleDupliWeight, dw);
+ }
+ return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
+}
+static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ *min= 0;
+ *max= BLI_countlist(&part->dupliweights)-1;
+ *max= MAX2(0, *max);
+}
-static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free)
+static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
{
- ParticleSettings *part = ptr->id.data;
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleDupliWeight *dw = part->dupliweights.first;
+ int i=0;
- if(C==NULL) {
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- /* needed for doc generation */
- RNA_enum_items_add(&item, &totitem, part_reactor_from_items);
- RNA_enum_items_add(&item, &totitem, part_from_items);
- RNA_enum_item_end(&item, &totitem);
-
- *free= 1;
-
- return item;
+ for(; dw; dw=dw->next, i++)
+ if(dw->flag & PART_DUPLIW_CURRENT)
+ return i;
+
+ return 0;
+}
+
+static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+ ParticleDupliWeight *dw = part->dupliweights.first;
+ int i=0;
+
+ for(; dw; dw=dw->next, i++) {
+ if(i==value)
+ dw->flag |= PART_DUPLIW_CURRENT;
+ else
+ dw->flag &= ~PART_DUPLIW_CURRENT;
}
-
- if(part->type==PART_REACTOR)
- return part_reactor_from_items;
+}
+
+static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
+{
+ ParticleDupliWeight *dw= ptr->data;
+
+ if(dw->ob)
+ return strlen(dw->ob->id.name+2) + 7;
else
+ return 9 + 7;
+}
+
+static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
+{
+ ParticleDupliWeight *dw= ptr->data;
+
+ if(dw->ob)
+ sprintf(str, "%s: %i", dw->ob->id.name+2, dw->count);
+ else
+ strcpy(str, "No object");
+}
+
+static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ //if(part->type==PART_REACTOR)
+ // return part_reactor_from_items;
+ //else
return part_from_items;
}
@@ -532,20 +509,6 @@ static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *C, PointerRNA *ptr
{
ParticleSettings *part = ptr->id.data;
- if(C==NULL) {
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- /* needed for doc generation */
- RNA_enum_items_add(&item, &totitem, part_hair_draw_as_items);
- RNA_enum_items_add(&item, &totitem, part_draw_as_items);
- RNA_enum_item_end(&item, &totitem);
-
- *free= 1;
-
- return item;
- }
-
if(part->type==PART_HAIR)
return part_hair_draw_as_items;
else
@@ -556,26 +519,34 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *C, PointerRNA *ptr,
{
ParticleSettings *part = ptr->id.data;
- if(C==NULL) {
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- /* needed for doc generation */
- RNA_enum_items_add(&item, &totitem, part_hair_ren_as_items);
- RNA_enum_items_add(&item, &totitem, part_ren_as_items);
- RNA_enum_item_end(&item, &totitem);
-
- *free= 1;
-
- return item;
- }
-
if(part->type==PART_HAIR)
return part_hair_ren_as_items;
else
return part_ren_as_items;
}
+static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+
+ /* weak */
+ if(!part->pd)
+ part->pd= object_add_collision_fields(0);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd);
+}
+
+static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
+{
+ ParticleSettings *part= (ParticleSettings*)ptr->id.data;
+
+ /* weak */
+ if(!part->pd2)
+ part->pd2= object_add_collision_fields(0);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2);
+}
+
#else
@@ -649,7 +620,7 @@ static void rna_def_particle(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem alive_items[] = {
- {PARS_KILLED, "KILLED", 0, "Killed", ""},
+ //{PARS_KILLED, "KILLED", 0, "Killed", ""},
{PARS_DEAD, "DEAD", 0, "Dead", ""},
{PARS_UNBORN, "UNBORN", 0, "Unborn", ""},
{PARS_ALIVE, "ALIVE", 0, "Alive", ""},
@@ -760,6 +731,27 @@ static void rna_def_particle(BlenderRNA *brna)
// short rt2;
}
+static void rna_def_particle_dupliweight(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "ParticleDupliWeight", NULL);
+ RNA_def_struct_ui_text(srna, "Particle Dupliobject Weight", "Weight of a particle dupliobject in a group.");
+ RNA_def_struct_sdna(srna, "ParticleDupliWeight");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, "rna_ParticleDupliWeight_name_get", "rna_ParticleDupliWeight_name_length", NULL);
+ RNA_def_property_ui_text(prop, "Name", "Particle dupliobject name.");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_text(prop, "Count", "The number of times this object is repeated with respect to other objects.");
+ RNA_def_property_update(prop, 0, "rna_Particle_redo");
+}
+
static void rna_def_particle_settings(BlenderRNA *brna)
{
StructRNA *srna;
@@ -767,7 +759,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
static EnumPropertyItem type_items[] = {
{PART_EMITTER, "EMITTER", 0, "Emitter", ""},
- {PART_REACTOR, "REACTOR", 0, "Reactor", ""},
+ //{PART_REACTOR, "REACTOR", 0, "Reactor", ""},
{PART_HAIR, "HAIR", 0, "Hair", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -986,10 +978,10 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Children", "Apply effectors to children.");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
- RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
- RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
+ //prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
+ //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
+ //RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
+ //RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
/* TODO: used somewhere? */
prop= RNA_def_property(srna, "child_render", PROP_BOOLEAN, PROP_NONE);
@@ -1103,6 +1095,16 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
+ prop= RNA_def_property(srna, "use_group_count", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_COUNT_GR);
+ RNA_def_property_ui_text(prop, "Use Count", "Use object multiple times in the same group");
+ RNA_def_property_update(prop, 0, "rna_Particle_redo");
+
+ prop= RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB);
+ RNA_def_property_ui_text(prop, "Use Global", "Use object's global coordinates for duplication.");
+ RNA_def_property_update(prop, 0, "rna_Particle_redo");
+
prop= RNA_def_property(srna, "render_adaptive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
@@ -1408,6 +1410,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed.");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
+ prop= RNA_def_property(srna, "object_aligned_factor", PROP_FLOAT, PROP_VELOCITY);
+ RNA_def_property_float_sdna(prop, NULL, "ob_vel");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_text(prop, "Object Aligned", "Let the emitter object orientation give the particle a starting speed");
+ RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "avefac");
RNA_def_property_range(prop, -200.0f, 200.0f);
@@ -1460,19 +1469,6 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* global physical properties */
- prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_ACCELERATION);
- RNA_def_property_float_sdna(prop, NULL, "acc");
- RNA_def_property_array(prop, 3);
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
- RNA_def_property_float_sdna(prop, NULL, "acc[2]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in global Z axis direction");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dragfac");
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -1699,6 +1695,19 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
+ prop= RNA_def_property(srna, "dupliweights", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ParticleDupliWeight");
+ RNA_def_property_ui_text(prop, "Dupli Group Weights", "Weights for all of the objects in the dupli group.");
+
+ prop= RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ParticleDupliWeight");
+ RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Dupli Object", "");
+
+ prop= RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_ParticleDupliWeight_active_index_get", "rna_ParticleDupliWeight_active_index_set", "rna_ParticleDupliWeight_active_index_range");
+ RNA_def_property_ui_text(prop, "Active Dupli Object Index", "");
+
prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
RNA_def_property_struct_type(prop, "Object");
@@ -1713,89 +1722,25 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- /* effectors */
- prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
- RNA_def_property_struct_type(prop, "Group");
- RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_all", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[0]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "All", "All effector's weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_spherical", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[1]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Spherical", "Spherical effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_vortex", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[2]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Vortex", "Vortex effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_magnetic", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[3]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Magnetic", "Magnetic effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_wind", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[4]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Wind", "Wind effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_curveguide", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[5]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Curve Guide", "Curve guide effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_texture", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[6]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Texture", "Texture effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_harmonic", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[7]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Harmonic", "Harmonic effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_charge", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[8]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Charge", "Charge effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
- prop= RNA_def_property(srna, "eweight_lennardjones", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "effector_weight[9]");
- RNA_def_property_range(prop, -200.0f, 200.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Lennard-Jones", "Lennard-Jones effector weight.");
- RNA_def_property_update(prop, 0, "rna_Particle_reset");
+ prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "EffectorWeights");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Weights", "");
/* animation here? */
rna_def_animdata_common(srna);
-// struct PartDeflect *pd;
-// struct PartDeflect *pd2;
+ prop= RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "pd");
+ RNA_def_property_struct_type(prop, "FieldSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Force Field 1", "");
+
+ prop= RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "pd2");
+ RNA_def_property_struct_type(prop, "FieldSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Force Field 2", "");
}
static void rna_def_particle_target(BlenderRNA *brna)
@@ -1871,10 +1816,10 @@ static void rna_def_particle_system(BlenderRNA *brna)
/* access to particle settings is redirected through functions */
/* to allow proper id-buttons functionality */
- prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
//RNA_def_property_pointer_sdna(prop, NULL, "part");
RNA_def_property_struct_type(prop, "ParticleSettings");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL);
RNA_def_property_ui_text(prop, "Settings", "Particle system settings.");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -1904,9 +1849,10 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation.");
RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics");
- prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clmd");
RNA_def_property_struct_type(prop, "ClothModifier");
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cloth", "Cloth dynamics for hair");
@@ -2082,7 +2028,8 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
/* pointcache */
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
@@ -2120,6 +2067,7 @@ void RNA_def_particle(BlenderRNA *brna)
rna_def_child_particle(brna);
rna_def_particle(brna);
+ rna_def_particle_dupliweight(brna);
rna_def_particle_system(brna);
rna_def_particle_settings(brna);
}
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index b568fb38dfb..584c971951a 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "RNA_define.h"
#include "RNA_types.h"
@@ -39,8 +40,9 @@
#ifdef RNA_RUNTIME
-#include <string.h>
-
+#include "BIK_api.h"
+#include "BKE_action.h"
+#include "BKE_armature.h"
#include "BLI_arithb.h"
#include "DNA_userdef_types.h"
@@ -49,8 +51,11 @@
#include "BKE_depsgraph.h"
#include "BKE_idprop.h"
+#include "ED_object.h"
#include "ED_armature.h"
+#include "MEM_guardedalloc.h"
+
static void rna_Pose_update(bContext *C, PointerRNA *ptr)
{
// XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
@@ -58,6 +63,15 @@ static void rna_Pose_update(bContext *C, PointerRNA *ptr)
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
+static void rna_Pose_IK_update(bContext *C, PointerRNA *ptr)
+{
+ // XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ Object *ob= ptr->id.data;
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ BIK_clear_data(ob->pose);
+}
+
static char *rna_PoseChannel_path(PointerRNA *ptr)
{
return BLI_sprintfN("pose.pose_channels[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
@@ -110,106 +124,66 @@ static IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create)
return pchan->prop;
}
-/* rotation - euler angles */
-static void rna_PoseChannel_euler_rotation_get(PointerRNA *ptr, float *value)
+static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
{
- bPoseChannel *pchan= ptr->data;
-
- if(pchan->rotmode == PCHAN_ROT_AXISANGLE) /* default XYZ eulers */
- AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], value, EULER_ORDER_DEFAULT);
- else if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers */
- QuatToEul(pchan->quat, value);
- else
- VECCOPY(value, pchan->eul);
+ bPose *pose= (bPose*)ptr->data;
+
+ if (pose->iksolver != value) {
+ // the solver has changed, must clean any temporary structures
+ BIK_clear_data(pose);
+ if (pose->ikparam) {
+ MEM_freeN(pose->ikparam);
+ pose->ikparam = NULL;
+ }
+ pose->iksolver = value;
+ init_pose_ikparam(pose);
+ }
}
-/* rotation - euler angles */
-static void rna_PoseChannel_euler_rotation_set(PointerRNA *ptr, const float *value)
+static void rna_Pose_ik_solver_update(bContext *C, PointerRNA *ptr)
{
- bPoseChannel *pchan= ptr->data;
+ Object *ob= ptr->id.data;
+ bPose *pose = ptr->data;
+ Scene *scene = CTX_data_scene(C);
+
+ pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ DAG_scene_sort(scene);
- if(pchan->rotmode == PCHAN_ROT_AXISANGLE) /* default XYZ eulers */
- EulOToAxisAngle((float *)value, EULER_ORDER_DEFAULT, &pchan->quat[1], &pchan->quat[0]);
- else if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers */
- EulToQuat((float*)value, pchan->quat);
- else
- VECCOPY(pchan->eul, value);
+ update_pose_constraint_flags(pose);
+
+ object_test_constraints(ob);
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
}
-/* rotation - axis angle only */
-static void rna_PoseChannel_rotation_axis_get(PointerRNA *ptr, float *value)
+/* rotation - axis-angle */
+static void rna_PoseChannel_rotation_axis_angle_get(PointerRNA *ptr, float *value)
{
bPoseChannel *pchan= ptr->data;
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis is stord in quat for now */
- VecCopyf(value, &pchan->quat[1]);
- }
+ /* for now, assume that rotation mode is axis-angle */
+ value[0]= pchan->rotAngle;
+ VecCopyf(&value[1], pchan->rotAxis);
}
-/* rotation - axis angle only */
-static void rna_PoseChannel_rotation_axis_set(PointerRNA *ptr, const float *value)
+/* rotation - axis-angle */
+static void rna_PoseChannel_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
{
bPoseChannel *pchan= ptr->data;
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis is stored in quat for now */
- VecCopyf(&pchan->quat[1], (float *)value);
- }
+ /* for now, assume that rotation mode is axis-angle */
+ pchan->rotAngle= value[0];
+ VecCopyf(pchan->rotAxis, (float *)&value[1]);
+
+ // TODO: validate axis?
}
static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value)
{
bPoseChannel *pchan= ptr->data;
- /* check if any change - if so, need to convert data */
- // TODO: this needs to be generalised at some point to work for objects too...
- if (value > 0) { /* to euler */
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis-angle to euler */
- AxisAngleToEulO(&pchan->quat[1], pchan->quat[0], pchan->eul, value);
- }
- else if (pchan->rotmode == PCHAN_ROT_QUAT) {
- /* quat to euler */
- QuatToEulO(pchan->quat, pchan->eul, value);
- }
- /* else { no conversion needed } */
- }
- else if (value == PCHAN_ROT_QUAT) { /* to quat */
- if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
- /* axis angle to quat */
- float q[4];
-
- /* copy to temp var first, since quats and axis-angle are stored in same place */
- QuatCopy(q, pchan->quat);
- AxisAngleToQuat(q, &pchan->quat[1], pchan->quat[0]);
- }
- else if (pchan->rotmode > 0) {
- /* euler to quat */
- EulOToQuat(pchan->eul, pchan->rotmode, pchan->quat);
- }
- /* else { no conversion needed } */
- }
- else { /* to axis-angle */
- if (pchan->rotmode > 0) {
- /* euler to axis angle */
- EulOToAxisAngle(pchan->eul, pchan->rotmode, &pchan->quat[1], &pchan->quat[0]);
- }
- else if (pchan->rotmode == PCHAN_ROT_QUAT) {
- /* quat to axis angle */
- float q[4];
-
- /* copy to temp var first, since quats and axis-angle are stored in same place */
- QuatCopy(q, pchan->quat);
- QuatToAxisAngle(q, &pchan->quat[1], &pchan->quat[0]);
- }
-
- /* when converting to axis-angle, we need a special exception for the case when there is no axis */
- if (IS_EQ(pchan->quat[1], pchan->quat[2]) && IS_EQ(pchan->quat[2], pchan->quat[3])) {
- /* for now, rotate around y-axis then (so that it simply becomes the roll) */
- pchan->quat[2]= 1.0f;
- }
- }
+ /* use API Method for conversions... */
+ BKE_rotMode_change_values(pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)value);
/* finally, set the new rotation type */
pchan->rotmode= value;
@@ -236,6 +210,70 @@ static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
return ED_pose_channel_in_IK_chain(ob, pchan);
}
+StructRNA *rna_IKParam_refine(PointerRNA *ptr)
+{
+ bIKParam *param = (bIKParam *)ptr->data;
+
+ switch (param->iksolver) {
+ case IKSOLVER_ITASC:
+ return &RNA_Itasc;
+ default:
+ return &RNA_IKParam;
+ }
+}
+
+PointerRNA rna_Pose_ikparam_get(struct PointerRNA *ptr)
+{
+ bPose *pose= (bPose*)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_IKParam, pose->ikparam);
+}
+
+static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
+{
+ bPose *pose= (bPose*)ptr->data;
+
+ switch (pose->iksolver) {
+ case IKSOLVER_ITASC:
+ return &RNA_Itasc;
+ default:
+ return &RNA_IKParam;
+ }
+}
+
+static void rna_Itasc_update(bContext *C, PointerRNA *ptr)
+{
+ Object *ob = ptr->id.data;
+ bItasc *itasc = ptr->data;
+
+ /* verify values */
+ if (itasc->precision < 0.0001f)
+ itasc->precision = 0.0001f;
+ if (itasc->minstep < 0.001f)
+ itasc->minstep = 0.001f;
+ if (itasc->maxstep < itasc->minstep)
+ itasc->maxstep = itasc->minstep;
+ if (itasc->feedback < 0.01f)
+ itasc->feedback = 0.01f;
+ if (itasc->feedback > 100.f)
+ itasc->feedback = 100.f;
+ if (itasc->maxvel < 0.01f)
+ itasc->maxvel = 0.01f;
+ if (itasc->maxvel > 100.f)
+ itasc->maxvel = 100.f;
+ BIK_update_param(ob->pose);
+
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+}
+
+static void rna_Itasc_update_rebuild(bContext *C, PointerRNA *ptr)
+{
+ Object *ob= ptr->id.data;
+ bPose *pose = ob->pose;
+
+ pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ rna_Itasc_update(C, ptr);
+}
+
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@@ -323,6 +361,7 @@ static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, in
*max= MAX2(0, *max);
}
+#if 0
static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index)
{
bPose *pose= (bPose*)ptr->data;
@@ -373,6 +412,7 @@ static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *r
BLI_strncpy(result, "", maxlen);
}
+#endif
#else
@@ -428,24 +468,36 @@ static void rna_def_bone_group(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
// TODO: editing the colors for this should result in changes to the color type...
- prop= RNA_def_property(srna, "colors", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
RNA_def_property_pointer_sdna(prop, NULL, "cs"); /* NOTE: the DNA data is not really a pointer, but this code works :) */
RNA_def_property_ui_text(prop, "Colors", "Copy of the colors associated with the group's color set.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
}
+static EnumPropertyItem prop_iksolver_items[] = {
+ {IKSOLVER_LEGACY, "LEGACY", 0, "Legacy", "Original IK solver."},
+ {IKSOLVER_ITASC, "ITASC", 0, "iTaSC", "Multi constraint, stateful IK solver."},
+ {0, NULL, 0, NULL, NULL}};
+
+static EnumPropertyItem prop_solver_items[] = {
+ {ITASC_SOLVER_SDLS, "SDLS", 0, "SDLS", "Selective Damped Least Square"},
+ {ITASC_SOLVER_DLS, "DLS", 0, "DLS", "Damped Least Square with Numerical Filtering"},
+ {0, NULL, 0, NULL, NULL}};
+
static void rna_def_pose_channel(BlenderRNA *brna)
{
+ // XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
static EnumPropertyItem prop_rotmode_items[] = {
- {PCHAN_ROT_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
- {PCHAN_ROT_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
- {PCHAN_ROT_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
+ {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
+ {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
+ {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector."},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@@ -467,7 +519,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
-
+
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "");
@@ -477,16 +529,17 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "pathsf");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "pathef");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* Relationships to other bones */
- prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone", "Bone associated with this Pose Channel.");
@@ -512,52 +565,51 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
+ prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
- RNA_def_property_ui_text(prop, "Rotation", "Rotation in Quaternions.");
+ RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "rotation_angle", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "quat[0]");
- RNA_def_property_ui_text(prop, "Rotation Angle", "Angle of Rotation for Axis-Angle rotation representation.");
- RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
-
- prop= RNA_def_property(srna, "rotation_axis", PROP_FLOAT, PROP_XYZ);
- RNA_def_property_float_sdna(prop, NULL, "quat");
- RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_get", "rna_PoseChannel_rotation_axis_set", NULL);
- RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Rotation Axis", "Axis for Axis-Angle rotation representation.");
+ /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
+ * having a single one is better for Keyframing and other property-management situations...
+ */
+ prop= RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
+ RNA_def_property_array(prop, 4); // TODO: maybe we'll need to define the 'default value' getter too...
+ RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", "rna_PoseChannel_rotation_axis_angle_set", NULL);
+ RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
- prop= RNA_def_property(srna, "euler_rotation", PROP_FLOAT, PROP_EULER);
+ prop= RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "eul");
- RNA_def_property_float_funcs(prop, "rna_PoseChannel_euler_rotation_get", "rna_PoseChannel_euler_rotation_set", NULL);
- RNA_def_property_ui_text(prop, "Rotation (Euler)", "Rotation in Eulers.");
+ RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers.");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Pose_update");
prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
- RNA_def_property_enum_items(prop, prop_rotmode_items);
+ RNA_def_property_enum_items(prop, prop_rotmode_items); // XXX move to using a single define of this someday
RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL);
RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
-
- /* These three matrix properties await an implementation of the PROP_MATRIX subtype, which currently doesn't exist. */
-/* prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "chan_mat");
+
+ /* transform matrices - should be read-only since these are set directly by AnimSys evaluation */
+ prop= RNA_def_property(srna, "channel_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "chan_mat");
+ RNA_def_property_array(prop, 16);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints.");*/
-
- /* kaito says this should be not user-editable; I disagree; power users should be able to force this in python; he's the boss. */
-/* prop= RNA_def_property(srna, "pose_matrix", PROP_FLOAT, PROP_MATRIX);
- RNA_def_property_struct_type(prop, "pose_mat");
+ RNA_def_property_ui_text(prop, "Channel Matrix", "4x4 matrix, before constraints.");
+
+ prop= RNA_def_property(srna, "pose_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "pose_mat");
+ RNA_def_property_array(prop, 16);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Pose Matrix", "Final 4x4 matrix for this channel.");
+ /*
prop= RNA_def_property(srna, "constraint_inverse_matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_struct_type(prop, "constinv");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position."); */
+ RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position.");
+ */
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_TRANSLATION);
@@ -573,96 +625,118 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
+
+ prop= RNA_def_property(srna, "ik_rot_control", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ROTCTL);
+ RNA_def_property_ui_text(prop, "IK rot control", "Apply channel rotation as IK constraint");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
+
+ prop= RNA_def_property(srna, "ik_lin_control", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_LINCTL);
+ RNA_def_property_ui_text(prop, "IK rot control", "Apply channel size as IK constraint if stretching is enabled");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[0]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[1]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[1]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[2]");
RNA_def_property_range(prop, -180.0f, 0.0f);
RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[2]");
RNA_def_property_range(prop, 0.0f, 180.0f);
RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[0]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[1]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[2]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis.");
- RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
prop= RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikstretch");
RNA_def_property_range(prop, 0.0f,1.0f);
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
+
+ prop= RNA_def_property(srna, "ik_rot_weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ikrotweight");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_lin_weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "iklinweight");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
/* custom bone shapes */
@@ -719,6 +793,120 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
}
+static void rna_def_pose_itasc(BlenderRNA *brna)
+{
+ static const EnumPropertyItem prop_itasc_mode_items[]= {
+ {0, "ANIMATION", 0, "Animation", "Stateless solver computing pose starting from current action and non-IK constraints."},
+ {ITASC_SIMULATION, "SIMULATION", 0, "Simulation", "Statefull solver running in real-time context and ignoring actions and non-IK constraints."},
+ {0, NULL, 0, NULL, NULL}};
+ static const EnumPropertyItem prop_itasc_reiteration_items[]= {
+ {0, "NEVER", 0, "Never", "The solver does not reiterate, not even on first frame (starts from rest pose)."},
+ {ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial", "The solver reiterates (converges) on the first frame but not on subsequent frame."},
+ {ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always", "The solver reiterates (converges) on all frames."},
+ {0, NULL, 0, NULL, NULL}};
+
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Itasc", "IKParam");
+ RNA_def_struct_sdna(srna, "bItasc");
+ RNA_def_struct_ui_text(srna, "bItasc", "Parameters for the iTaSC IK solver.");
+
+ prop= RNA_def_property(srna, "precision", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "precision");
+ RNA_def_property_range(prop, 0.0f,0.1f);
+ RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "num_iter", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "numiter");
+ RNA_def_property_range(prop, 1.f,1000.f);
+ RNA_def_property_ui_text(prop, "Iterations", "Maximum number of iterations for convergence in case of reiteration.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "num_step", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "numstep");
+ RNA_def_property_range(prop, 1.f, 50.f);
+ RNA_def_property_ui_text(prop, "Num steps", "Divides the frame interval into this many steps.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_itasc_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
+
+ prop= RNA_def_property(srna, "reiteration", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_itasc_reiteration_items);
+ RNA_def_property_ui_text(prop, "Reiteration", "Defines if the solver is allowed to reiterate (converges until precision is met) on none, first or all frames");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_AUTO_STEP);
+ RNA_def_property_ui_text(prop, "Auto step", "Automatically determine the optimal number of steps for best performance/accurary trade off.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "min_step", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "minstep");
+ RNA_def_property_range(prop, 0.0f,0.1f);
+ RNA_def_property_ui_text(prop, "Min step", "Lower bound for timestep in second in case of automatic substeps.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "max_step", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "maxstep");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "Max step", "Higher bound for timestep in second in case of automatic substeps.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "feedback");
+ RNA_def_property_range(prop, 0.0f,100.0f);
+ RNA_def_property_ui_text(prop, "Feedback", "Feedback coefficient for error correction. Average response time=1/feedback. Default=20.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "maxvel");
+ RNA_def_property_range(prop, 0.0f,100.0f);
+ RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s. Default=50.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "solver");
+ RNA_def_property_enum_items(prop, prop_solver_items);
+ RNA_def_property_ui_text(prop, "Solver", "Solving method selection: Automatic damping or manual damping");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
+
+ prop= RNA_def_property(srna, "dampmax", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dampmax");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "Damp", "Maximum damping coefficient when singular value is nearly 0. Higher values=more stability, less reactivity. Default=0.5");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+
+ prop= RNA_def_property(srna, "dampeps", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dampeps");
+ RNA_def_property_range(prop, 0.0f,1.0f);
+ RNA_def_property_ui_text(prop, "Epsilon", "Singular value under which damping is progressively applied. Higher values=more stability, less reactivity. Default=0.1");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
+}
+
+static void rna_def_pose_ikparam(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "IKParam", NULL);
+ RNA_def_struct_sdna(srna, "bIKParam");
+ RNA_def_struct_ui_text(srna, "IKParam", "Base type for IK solver parameters.");
+ RNA_def_struct_refine_func(srna, "rna_IKParam_refine");
+
+ prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "iksolver");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_enum_items(prop, prop_iksolver_items);
+ RNA_def_property_ui_text(prop, "IK Solver", "IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC.");
+}
+
static void rna_def_pose(BlenderRNA *brna)
{
StructRNA *srna;
@@ -753,13 +941,29 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", "rna_Pose_active_bone_group_index_range");
RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array.");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
+
+ prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "iksolver");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Pose_ik_solver_set", NULL);
+ RNA_def_property_enum_items(prop, prop_iksolver_items);
+ RNA_def_property_ui_text(prop, "IK Solver", "Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_ik_solver_update");
+
+ prop= RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "IKParam");
+ RNA_def_property_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver.");
+
+ /* RNA_api_pose(srna); */
}
void RNA_def_pose(BlenderRNA *brna)
{
rna_def_pose(brna);
rna_def_pose_channel(brna);
-
+ rna_def_pose_ikparam(brna);
+ rna_def_pose_itasc(brna);
rna_def_bone_group(brna);
}
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 196d25ada86..31aecbb8a76 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -383,14 +383,13 @@ static void rna_Property_description_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop= (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
- strcpy(value, prop->description);
+ strcpy(value, prop->description ? prop->description:"");
}
-
static int rna_Property_description_length(PointerRNA *ptr)
{
PropertyRNA *prop= (PropertyRNA*)ptr->data;
rna_idproperty_check(&prop, ptr);
- return strlen(prop->description);
+ return prop->description ? strlen(prop->description) : 0;
}
static int rna_Property_type_get(PointerRNA *ptr)
@@ -625,7 +624,7 @@ static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA
rna_idproperty_check(&prop, ptr);
eprop= (EnumPropertyRNA*)prop;
- if(eprop->itemf==NULL || eprop->itemf==rna_EnumProperty_default_itemf)
+ if(eprop->itemf==NULL || eprop->itemf==rna_EnumProperty_default_itemf || !C)
return eprop->item;
return eprop->itemf(C, ptr, free);
@@ -842,6 +841,7 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_DIRPATH, "DIRECTORY_PATH", 0, "Directory Path", ""},
{PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned Number", ""},
{PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""},
+ {PROP_FACTOR, "FACTOR", 0, "Factor", ""},
{PROP_ANGLE, "ANGLE", 0, "Angle", ""},
{PROP_TIME, "TIME", 0, "Time", ""},
{PROP_DISTANCE, "DISTANCE", 0, "Distance", ""},
@@ -853,7 +853,6 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""},
{PROP_XYZ, "XYZ", 0, "XYZ", ""},
{PROP_RGB, "RGB", 0, "RGB", ""},
- {PROP_NEVER_NULL, "NEVER_NULL", 0, "Never Null", ""},
{PROP_LAYER, "LAYER", 0, "Layer", ""},
{PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""},
{0, NULL, 0, NULL, NULL}};
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 15329b126d3..b9fd2926ca3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -43,8 +43,15 @@
#include "WM_types.h"
-/* prop_mode needs to be accessible from transform operator */
-EnumPropertyItem prop_mode_items[] ={
+
+EnumPropertyItem snap_mode_items[] = {
+ {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."},
+ {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."},
+ {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
+ {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem proportional_falloff_items[] ={
{PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""},
{PROP_SPHERE, "SPHERE", 0, "Sphere", ""},
{PROP_ROOT, "ROOT", 0, "Root", ""},
@@ -54,14 +61,24 @@ EnumPropertyItem prop_mode_items[] ={
{PROP_RANDOM, "RANDOM", 0, "Random", ""},
{0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem proportional_editing_items[] = {
+ {PROP_EDIT_OFF, "DISABLED", 0, "Disable", ""},
+ {PROP_EDIT_ON, "ENABLED", 0, "Enable", ""},
+ {PROP_EDIT_CONNECTED, "CONNECTED", 0, "Connected", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "DNA_anim_types.h"
#include "DNA_node_types.h"
+#include "DNA_object_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_scene.h"
#include "BKE_node.h"
+#include "BKE_pointcache.h"
#include "BLI_threads.h"
@@ -78,6 +95,35 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
}
+static PointerRNA rna_Scene_active_object_get(PointerRNA *ptr)
+{
+ Scene *scene= (Scene*)ptr->data;
+ return rna_pointer_inherit_refine(ptr, &RNA_Object, scene->basact ? scene->basact->object : NULL);
+}
+
+static void rna_Scene_active_object_set(PointerRNA *ptr, PointerRNA value)
+{
+ Scene *scene= (Scene*)ptr->data;
+ if(value.data)
+ scene->basact= object_in_scene((Object*)value.data, scene);
+ else
+ scene->basact= NULL;
+}
+
+static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
+{
+ Scene *scene= (Scene*)ptr->data;
+ Scene *set= (Scene*)value.data;
+ Scene *nested_set;
+
+ for(nested_set= set; nested_set; nested_set= nested_set->set) {
+ if(nested_set==scene)
+ return;
+ }
+
+ scene->set= set;
+}
+
static int layer_set(int lay, const int *values)
{
int i, tot= 0;
@@ -257,6 +303,43 @@ static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
#endif
}
+void rna_SceneRenderData_jpeg2k_preset_update(RenderData *rd)
+{
+ rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
+
+ switch(rd->jp2_depth) {
+ case 8: break;
+ case 12: rd->subimtype |= R_JPEG2K_12BIT; break;
+ case 16: rd->subimtype |= R_JPEG2K_16BIT; break;
+ }
+
+ switch(rd->jp2_preset) {
+ case 1: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 2: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
+ case 3: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 4: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 5: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
+ case 6: rd->subimtype |= R_JPEG2K_CINE_PRESET; break;
+ case 7: rd->subimtype |= R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS; break;
+ }
+}
+
+#ifdef WITH_OPENJPEG
+static void rna_SceneRenderData_jpeg2k_preset_set(PointerRNA *ptr, int value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ rd->jp2_preset= value;
+ rna_SceneRenderData_jpeg2k_preset_update(rd);
+}
+
+static void rna_SceneRenderData_jpeg2k_depth_set(PointerRNA *ptr, int value)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ rd->jp2_depth= value;
+ rna_SceneRenderData_jpeg2k_preset_update(rd);
+}
+#endif
+
static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr)
{
RenderData *rd= (RenderData*)ptr->data;
@@ -380,8 +463,36 @@ static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value)
ED_node_composit_default(scene);
}
+static void rna_Physics_update(bContext *C, PointerRNA *ptr)
+{
+ Scene *scene= (Scene*)ptr->id.data;
+ Base *base;
+
+ for(base = scene->base.first; base; base=base->next)
+ BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH);
+}
#else
+static void rna_def_transform_orientation(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ int matrix_dimsize[]= {3, 3};
+
+ srna= RNA_def_struct(brna, "TransformOrientation", NULL);
+
+ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "mat");
+ RNA_def_property_multi_array(prop, 2, matrix_dimsize);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+}
+
static void rna_def_tool_settings(BlenderRNA *brna)
{
StructRNA *srna;
@@ -407,13 +518,6 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem snap_mode_items[] = {
- {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."},
- {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."},
- {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
- {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem auto_key_items[] = {
{AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
@@ -443,14 +547,17 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Particle Edit", "");
/* Transform */
- prop= RNA_def_property(srna, "proportional_editing", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "proportional", 0);
+ prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "proportional");
+ RNA_def_property_enum_items(prop, proportional_editing_items);
RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode.");
+ RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
- RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_enum_items(prop, proportional_falloff_items);
RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
+ RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */
prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "normalsize");
@@ -488,6 +595,11 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center.");
RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
+ prop= RNA_def_property(srna, "snap_project", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
+ RNA_def_property_ui_text(prop, "Project Individual Elements", "DOC_BROKEN");
+ RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
+
/* Auto Keying */
prop= RNA_def_property(srna, "enable_auto_key", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
@@ -523,7 +635,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, mesh_select_mode_items);
RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode.");
- prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
}
@@ -561,7 +673,6 @@ static void rna_def_unit_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_WINDOW, NULL);
}
-
void rna_def_render_layer_common(StructRNA *srna, int scene)
{
PropertyRNA *prop;
@@ -1142,7 +1253,17 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{256, "OCTREE_RES_256", 0, "256", ""},
{512, "OCTREE_RES_512", 0, "512", ""},
{0, NULL, 0, NULL, NULL}};
-
+
+ static EnumPropertyItem raytrace_structure_items[] = {
+ {R_RAYSTRUCTURE_AUTO, "AUTO", 0, "Auto", ""},
+ {R_RAYSTRUCTURE_OCTREE, "OCTREE", 0, "Octree", "Use old Octree structure."},
+ {R_RAYSTRUCTURE_BLIBVH, "BLIBVH", 0, "BLI BVH", "Use BLI K-Dop BVH.c"},
+ {R_RAYSTRUCTURE_VBVH, "VBVH", 0, "vBVH", ""},
+ {R_RAYSTRUCTURE_SIMD_SVBVH, "SIMD_SVBVH", 0, "SIMD SVBVH", ""},
+ {R_RAYSTRUCTURE_SIMD_QBVH, "SIMD_QBVH", 0, "SIMD QBVH", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
static EnumPropertyItem fixed_oversample_items[] = {
{5, "OVERSAMPLE_5", 0, "5", ""},
{8, "OVERSAMPLE_8", 0, "8", ""},
@@ -1159,61 +1280,53 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{0, "THREADS_AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"},
{R_FIXED_THREADS, "THREADS_FIXED", 0, "Fixed", "Manually determine the number of threads"},
{0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem stamp_font_size_items[] = {
- {1, "STAMP_FONT_TINY", 0, "Tiny", ""},
- {2, "STAMP_FONT_SMALL", 0, "Small", ""},
- {3, "STAMP_FONT_MEDIUM", 0, "Medium", ""},
- {0, "STAMP_FONT_LARGE", 0, "Large", ""},
- {4, "STAMP_FONT_EXTRALARGE", 0, "Extra Large", ""},
- {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem image_type_items[] = {
{0, "", 0, "Image", NULL},
- {R_PNG, "PNG", 0, "PNG", ""},
- {R_JPEG90, "JPEG", 0, "JPEG", ""},
+ {R_PNG, "PNG", ICON_FILE_IMAGE, "PNG", ""},
+ {R_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", ""},
#ifdef WITH_OPENJPEG
- {R_JP2, "JPEG2000", 0, "JPEG 2000", ""},
+ {R_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", ""},
#endif
- {R_BMP, "BMP", 0, "BMP", ""},
- {R_TARGA, "TARGA", 0, "Targa", ""},
- {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""},
- //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented
- {R_HAMX, "HAMX", 0, "HamX", ""},
- {R_IRIS, "IRIS", 0, "Iris", ""},
+ {R_BMP, "BMP", ICON_FILE_IMAGE, "BMP", ""},
+ {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""},
+ {R_RAWTGA, "RAWTARGA", ICON_FILE_IMAGE, "Targa Raw", ""},
+ //{R_DDS, "DDS", ICON_FILE_IMAGE, "DDS", ""}, // XXX not yet implemented
+ {R_HAMX, "HAMX", ICON_FILE_IMAGE, "HamX", ""},
+ {R_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", ""},
{0, "", 0, " ", NULL},
#ifdef WITH_OPENEXR
- {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
- {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""},
+ {R_OPENEXR, "OPENEXR", ICON_FILE_IMAGE, "OpenEXR", ""},
+ {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""},
#endif
- {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff
- {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""},
- {R_CINEON, "CINEON", 0, "Cineon", ""},
- {R_DPX, "DPX", 0, "DPX", ""},
+ {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, // XXX only with G.have_libtiff
+ {R_RADHDR, "RADHDR", ICON_FILE_IMAGE, "Radiance HDR", ""},
+ {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""},
+ {R_DPX, "DPX", ICON_FILE_IMAGE, "DPX", ""},
{0, "", 0, "Movie", NULL},
- {R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""},
- {R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""},
+ {R_AVIRAW, "AVIRAW", ICON_FILE_MOVIE, "AVI Raw", ""},
+ {R_AVIJPEG, "AVIJPEG", ICON_FILE_MOVIE, "AVI JPEG", ""},
#ifdef _WIN32
- {R_AVICODEC, "AVICODEC", 0, "AVI Codec", ""},
+ {R_AVICODEC, "AVICODEC", ICON_FILE_MOVIE, "AVI Codec", ""},
#endif
#ifdef WITH_QUICKTIME
- {R_QUICKTIME, "QUICKTIME", 0, "QuickTime", ""},
+ {R_QUICKTIME, "QUICKTIME", ICON_FILE_MOVIE, "QuickTime", ""},
#endif
#ifdef __sgi
- {R_MOVIE, "MOVIE", 0, "Movie", ""},
+ {R_MOVIE, "MOVIE", ICON_FILE_MOVIE, "Movie", ""},
#endif
#ifdef WITH_FFMPEG
- {R_H264, "H264", 0, "H.264", ""},
- {R_XVID, "XVID", 0, "Xvid", ""},
+ {R_H264, "H264", ICON_FILE_MOVIE, "H.264", ""},
+ {R_XVID, "XVID", ICON_FILE_MOVIE, "Xvid", ""},
// XXX broken
#if 0
#ifdef WITH_OGG
- {R_THEORA, "THEORA", 0, "Ogg Theora", ""},
+ {R_THEORA, "THEORA", ICON_FILE_MOVIE, "Ogg Theora", ""},
#endif
#endif
- {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""},
+ {R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFMpeg", ""},
#endif
- {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""},
+ {R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", ""},
{0, NULL, 0, NULL, NULL}};
#ifdef WITH_OPENEXR
@@ -1229,19 +1342,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#ifdef WITH_OPENJPEG
static EnumPropertyItem jp2_preset_items[] = {
{0, "NO_PRESET", 0, "No Preset", ""},
- {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""},
- {2, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
- {3, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 4096x2160", ""},
- {4, "R_JPEG2K_CINE_PRESET", 0, "Cine-Scope 24fps 2048x858", ""},
- {5, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
- {6, "R_JPEG2K_CINE_PRESET", 0, "Cine-Flat 24fps 1998x1080", ""},
- {7, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
+ {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""},
+ {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""},
+ {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""},
+ {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""},
+ {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""},
+ {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""},
+ {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem jp2_depth_items[] = {
- {0, "8", 0, "8", ""},
- {R_JPEG2K_12BIT, "16", 0, "16", ""},
- {R_JPEG2K_16BIT, "32", 0, "32", ""},
+ {8, "8", 0, "8", "8 bit color channels"},
+ {12, "12", 0, "12", "12 bit color channels"},
+ {16, "16", 0, "16", "16 bit color channels"},
{0, NULL, 0, NULL, NULL}};
#endif
@@ -1302,23 +1415,25 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
RNA_def_property_enum_items(prop, color_mode_items);
RNA_def_property_ui_text(prop, "Color Mode", "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels");
-
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xsch");
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image.");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ysch");
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image.");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_ui_range(prop, 1, 100, 10, 1);
RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xparts");
@@ -1336,13 +1451,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "xasp");
RNA_def_property_range(prop, 1.0f, 200.0f);
RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yasp");
RNA_def_property_range(prop, 1.0f, 200.0f);
RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
- RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_OBJECT|ND_DRAW, NULL);
/* JPEG and AVI JPEG */
@@ -1412,19 +1527,21 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
#ifdef WITH_OPENJPEG
/* Jpeg 2000 */
- prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_preset");
+ prop= RNA_def_property(srna, "jpeg2k_preset", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "jp2_preset");
RNA_def_property_enum_items(prop, jp2_preset_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_preset_set", NULL);
RNA_def_property_ui_text(prop, "Preset", "Use a DCI Standard preset for saving jpeg2000");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "jpeg_depth", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "jpeg2k_depth", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth");
RNA_def_property_enum_items(prop, jp2_depth_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_jpeg2k_depth_set", NULL);
RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "jpeg_ycc", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC);
RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -1510,6 +1627,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_MULTIPLEX_AUDIO);
RNA_def_property_ui_text(prop, "Multiplex Audio", "Interleave audio with the output video");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "ffmpeg_audio_mixrate", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_mixrate");
+ RNA_def_property_range(prop, 8000, 192000);
+ RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ffcodecdata.audio_volume");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Volume", "Audio volume");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
#endif
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
@@ -1553,7 +1683,23 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_items(prop, octree_resolution_items);
RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-
+
+ prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure");
+ RNA_def_property_enum_items(prop, raytrace_structure_items);
+ RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
+ RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
+ RNA_def_property_ui_text(prop, "Use Local Coords", "Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA);
RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges.");
@@ -1574,17 +1720,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, field_order_items);
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines get rendered first, to create smooth motion for TV output");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL);
RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
- RNA_def_property_ui_text(prop, "Sync Audio", "Play back and sync with audio from Sequence Editor");
- RNA_def_property_update(prop, NC_SCENE, NULL);
-
prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW);
RNA_def_property_ui_text(prop, "Render Shadows", "Calculate shadows while rendering.");
@@ -1643,6 +1785,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, threads_mode_items);
RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
@@ -1653,6 +1796,30 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.xmin");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border.");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.ymin");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.xmax");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "border.ymax");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "crop_to_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
@@ -1726,6 +1893,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode");
RNA_def_property_enum_items(prop, display_mode_items);
RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "pic");
@@ -1829,23 +1997,28 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+
+ prop= RNA_def_property(srna, "stamp_render_time", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
+ RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
+ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-
+
prop= RNA_def_property(srna, "render_stamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DRAW);
RNA_def_property_ui_text(prop, "Render Stamp", "Render the stamp info text in the rendered image");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
- prop= RNA_def_property(srna, "stamp_font_size", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "stamp_font_id");
- RNA_def_property_enum_items(prop, stamp_font_size_items);
- RNA_def_property_ui_text(prop, "Stamp Font Size", "Size of the font used when rendering stamp text");
+ prop= RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
+ RNA_def_property_range(prop, 8, 64);
+ RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-
+
prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
RNA_def_property_array(prop, 4);
@@ -1902,6 +2075,16 @@ void RNA_def_scene(BlenderRNA *brna)
PropertyRNA *prop;
FunctionRNA *func;
+ static EnumPropertyItem audio_distance_model_items[] = {
+ {0, "NONE", 0, "None", "No distance attenuation."},
+ {1, "INVERSE", 0, "Inverse", "Inverse distance model."},
+ {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping."},
+ {3, "LINEAR", 0, "Linear", "Linear distance model."},
+ {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping."},
+ {5, "EXPONENT", 0, "Exponent", "Exponent distance model."},
+ {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping."},
+ {0, NULL, 0, NULL, NULL}};
+
/* Struct definition */
srna= RNA_def_struct(brna, "Scene", "ID");
RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
@@ -1913,6 +2096,21 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene.");
+ prop= RNA_def_property(srna, "set", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "set");
+ RNA_def_property_struct_type(prop, "Scene");
+ //RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL);
+ RNA_def_property_ui_text(prop, "Set Scene", "Background set scene.");
+
+ prop= RNA_def_property(srna, "active_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform.");
+
+
prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "World", "World used for rendering the scene.");
@@ -1951,6 +2149,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.sfra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
+ RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -1958,12 +2157,15 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "r.efra");
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
+ RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
RNA_def_property_int_sdna(prop, NULL, "frame_step");
+ RNA_def_property_range(prop, 0, MAXFRAME);
+ RNA_def_property_ui_range(prop, 0, 100, 1, 0);
RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -1994,6 +2196,9 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
+ /* Animation Data (for Scene) */
+ rna_def_animdata_common(srna);
+
/* Nodes (Compositing) */
prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
@@ -2032,19 +2237,35 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
/* Tool Settings */
- prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_ui_text(prop, "Tool Settings", "");
/* Unit Settings */
- prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "unit");
RNA_def_property_struct_type(prop, "UnitSettings");
RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
+
+ /* Physics Settings */
+ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
+ RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, -200.0f, 200.0f);
+ RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
+ RNA_def_property_update(prop, 0, "rna_Physics_update");
+
+ prop= RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
+ RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics.");
+ RNA_def_property_update(prop, 0, "rna_Physics_update");
/* Render Data */
- prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "render_data", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "r");
RNA_def_property_struct_type(prop, "SceneRenderData");
RNA_def_property_ui_text(prop, "Render Data", "");
@@ -2055,8 +2276,43 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Timeline Markers", "Markers used in all timelines for the current scene.");
+ /* Audio Settings */
+ prop= RNA_def_property(srna, "mute_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_MUTE);
+ RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "sync_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
+ RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio from Sequence Editor.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "scrub_audio", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
+ RNA_def_property_ui_text(prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "speed_of_sound", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
+ RNA_def_property_range(prop, 0.01f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Speed of Sound", "Speed of sound for doppler effect calculation.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "doppler_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
+ RNA_def_property_range(prop, 0.0, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for doppler effect calculation.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "distance_model", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
+ RNA_def_property_enum_items(prop, audio_distance_model_items);
+ RNA_def_property_ui_text(prop, "Distance Model", "Distance model for distance attenuation calculation.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
/* Game Settings */
- prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "game_data", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "gm");
RNA_def_property_struct_type(prop, "SceneGameData");
RNA_def_property_ui_text(prop, "Game Data", "");
@@ -2073,12 +2329,19 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "GreasePencil");
RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
+ /* Transform Orientations */
+ prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
+ RNA_def_property_struct_type(prop, "TransformOrientation");
+ RNA_def_property_ui_text(prop, "Transform Orientations", "");
+
/* Nestled Data */
rna_def_tool_settings(brna);
rna_def_unit_settings(brna);
rna_def_scene_render_data(brna);
rna_def_scene_game_data(brna);
rna_def_scene_render_layer(brna);
+ rna_def_transform_orientation(brna);
/* Scene API */
RNA_api_scene(srna);
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 26047ab5dc3..40f2db6d4a4 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -1,5 +1,5 @@
/**
- * $Id:
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -21,7 +21,7 @@
* All rights reserved.
*
*
- * Contributor(s): Joshua Leung
+ * Contributor(s): Joshua Leung, Arystanbek Dyussenov
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -40,9 +40,49 @@
#ifdef RNA_RUNTIME
#include "BKE_animsys.h"
+#include "BKE_scene.h"
+#include "BKE_depsgraph.h"
-// Scene API stuff from kazanbas branch here...
+#include "ED_object.h"
+#include "WM_api.h"
+
+static void rna_Scene_add_object(Scene *sce, ReportList *reports, Object *ob)
+{
+ Base *base= object_in_scene(ob, sce);
+ if (base) {
+ BKE_report(reports, RPT_ERROR, "Object is already in this scene.");
+ return;
+ }
+ base= scene_add_base(sce, ob);
+ ob->id.us++;
+
+ /* this is similar to what object_add_type and add_object do */
+ ob->lay= base->lay= sce->lay;
+ ob->recalc |= OB_RECALC;
+
+ DAG_scene_sort(sce);
+}
+
+static void rna_Scene_remove_object(Scene *sce, ReportList *reports, Object *ob)
+{
+ Base *base= object_in_scene(ob, sce);
+ if (!base) {
+ BKE_report(reports, RPT_ERROR, "Object is not in this scene.");
+ return;
+ }
+ /* as long as ED_base_object_free_and_unlink calls free_libblock_us, we don't have to decrement ob->id.us */
+ ED_base_object_free_and_unlink(sce, base);
+}
+
+static void rna_Scene_set_frame(Scene *sce, bContext *C, int frame)
+{
+ sce->r.cfra= frame;
+ CLAMP(sce->r.cfra, MINAFRAME, MAXFRAME);
+ scene_update_for_newframe(sce, (1<<20) - 1);
+
+ WM_event_add_notifier(C, NC_SCENE|ND_FRAME, sce);
+}
static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
char name[], int absolute, int insertkey_needed, int insertkey_visual)
@@ -77,21 +117,37 @@ void RNA_api_scene(StructRNA *srna)
{
FunctionRNA *func;
PropertyRNA *parm;
-
- // Scene API stuff from kazanbas branch here...
-
+
+ func= RNA_def_function(srna, "add_object", "rna_Scene_add_object");
+ RNA_def_function_ui_description(func, "Add object to scene.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "remove_object", "rna_Scene_remove_object");
+ RNA_def_function_ui_description(func, "Remove object from scene.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "set_frame", "rna_Scene_set_frame");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately.");
+ parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set.", MINAFRAME, MAXFRAME);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
/* Add Keying Set */
func= RNA_def_function(srna, "add_keying_set", "rna_Scene_add_keying_set");
RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- /* returns the new KeyingSet */
+ /* returns the new KeyingSet */
parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
- RNA_def_function_return(func, parm);
- /* name */
+ RNA_def_function_return(func, parm);
+ /* name */
RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
- /* flags */
+ /* flags */
RNA_def_boolean(func, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
- /* keying flags */
+ /* keying flags */
RNA_def_boolean(func, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
}
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 7a243327bd1..004c57eedfc 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -26,6 +26,7 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -77,6 +78,22 @@ static int rna_Screen_animation_playing_get(PointerRNA *ptr)
return (sc->animtimer != NULL);
}
+static void rna_Area_type_set(PointerRNA *ptr, int value)
+{
+ ScrArea *sa= (ScrArea*)ptr->data;
+ sa->butspacetype= value;
+}
+
+static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
+{
+ ScrArea *sa= (ScrArea*)ptr->data;
+
+ if(sa) {
+ ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */
+ ED_area_tag_redraw(sa);
+ }
+}
+
#else
static void rna_def_area(BlenderRNA *brna)
@@ -107,6 +124,14 @@ static void rna_def_area(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN);
RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header.");
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "spacetype");
+ RNA_def_property_enum_items(prop, space_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL);
+ RNA_def_property_ui_text(prop, "Type", "Space type.");
+ RNA_def_property_update(prop, 0, "rna_Area_type_update");
+
+
RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
}
@@ -135,10 +160,10 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window.");
RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
- prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen.");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL);
+ RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen.");
RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index ab4b27cea7b..7f8ded7d3ee 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -119,27 +119,13 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr)
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free)
{
- if(C==NULL) {
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- /* needed for doc generation */
- RNA_enum_items_add(&item, &totitem, particle_edit_hair_brush_items);
- RNA_enum_item_end(&item, &totitem);
-
- *free= 1;
-
- return item;
- }
- else {
- Scene *scene= CTX_data_scene(C);
- PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C));
-
- if(edit && edit->psys)
- return particle_edit_hair_brush_items;
+ Scene *scene= CTX_data_scene(C);
+ PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C));
+
+ if(edit && edit->psys)
+ return particle_edit_hair_brush_items;
- return particle_edit_cache_brush_items;
- }
+ return particle_edit_cache_brush_items;
}
static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
@@ -231,7 +217,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_mode_items[] = {
+ static EnumPropertyItem brush_mode_items[] = {
{0, "MIX", 0, "Mix", "Use mix blending mode while painting."},
{1, "ADD", 0, "Add", "Use add blending mode while painting."},
{2, "SUB", 0, "Subtract", "Use subtract blending mode while painting."},
@@ -246,7 +232,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode.");
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_enum_items(prop, brush_mode_items);
RNA_def_property_ui_text(prop, "Brush Mode", "Mode in which color is painted.");
prop= RNA_def_property(srna, "all_faces", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
index a5d76fdb039..1003af6d4d1 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -48,6 +48,8 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
return &RNA_KeyboardSensor;
case SENS_PROPERTY:
return &RNA_PropertySensor;
+ case SENS_ARMATURE:
+ return &RNA_ArmatureSensor;
case SENS_MOUSE:
return &RNA_MouseSensor;
case SENS_COLLISION:
@@ -92,6 +94,7 @@ static void rna_def_sensor(BlenderRNA *brna)
{SENS_JOYSTICK, "JOYSTICK", 0, "joystick", ""},
{SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
{SENS_DELAY, "DELAY", 0, "Delay", ""},
+ {SENS_ARMATURE, "ARMATURE", 0, "Armature", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Sensor", NULL);
@@ -278,6 +281,40 @@ static void rna_def_property_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type.");
}
+static void rna_def_armature_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] ={
+ {SENS_ARM_STATE_CHANGED, "STATECHG", 0, "State Changed", ""},
+ {SENS_ARM_LIN_ERROR_BELOW, "LINERRORBELOW", 0, "Lin error below", ""},
+ {SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""},
+ {SENS_ARM_ROT_ERROR_BELOW, "ROTERRORBELOW", 0, "Rot error below", ""},
+ {SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORBELOW", 0, "Rot error above", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "ArmatureSensor", "Sensor");
+ RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver.");
+ RNA_def_struct_sdna_from(srna, "bArmatureSensor", "data");
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Test Type", "Type of value and test.");
+
+ prop= RNA_def_property(srna, "channel_name", 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");
+
+ prop= RNA_def_property(srna, "constraint_name", 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.");
+
+ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "value");
+ RNA_def_property_ui_text(prop, "Compare Value", "Specify value to be used in comparison.");
+}
+
static void rna_def_actuator_sensor(BlenderRNA *brna)
{
StructRNA *srna;
@@ -531,6 +568,7 @@ void RNA_def_sensor(BlenderRNA *brna)
rna_def_touch_sensor(brna);
rna_def_keyboard_sensor(brna);
rna_def_property_sensor(brna);
+ rna_def_armature_sensor(brna);
rna_def_actuator_sensor(brna);
rna_def_delay_sensor(brna);
rna_def_collision_sensor(brna);
diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c
index 4e12aab853e..c48031d51b3 100644
--- a/source/blender/makesrna/intern/rna_sequence.c
+++ b/source/blender/makesrna/intern/rna_sequence.c
@@ -228,7 +228,15 @@ static char *rna_Sequence_path(PointerRNA *ptr)
/* sequencer data comes from scene...
* TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
*/
- return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2);
+ if (seq->name+2)
+ return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2);
+ else {
+ /* compromise for the frequent sitation when strips don't have names... */
+ Scene *sce= (Scene*)ptr->id.data;
+ Editing *ed= seq_give_editing(sce, FALSE);
+
+ return BLI_sprintfN("sequence_editor.sequences[%d]", BLI_findindex(&ed->seqbase, seq));
+ }
}
static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *iter)
@@ -239,6 +247,35 @@ static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
+static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, dir, name);
+ BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
+ BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+}
+
+static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, dir, name);
+ BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
+ BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+}
+
+static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
+{
+ StripElem *elem= (StripElem*)(ptr->data);
+ char name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, NULL, name);
+ BLI_strncpy(elem->name, name, sizeof(elem->name));
+}
+
#else
static void rna_def_strip_element(BlenderRNA *brna)
@@ -253,6 +290,7 @@ static void rna_def_strip_element(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
}
static void rna_def_strip_crop(BlenderRNA *brna)
@@ -490,6 +528,7 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "machine");
+ RNA_def_property_range(prop, 0, MAXSEQ-1);
RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip.");
RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
@@ -509,7 +548,7 @@ static void rna_def_sequence(BlenderRNA *brna)
/* functions */
func= RNA_def_function(srna, "getStripElem", "give_stripelem");
RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
- prop= RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "The frame to get the strip element from", INT_MIN, INT_MAX);
+ prop= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
RNA_def_property_flag(prop, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
}
@@ -736,6 +775,7 @@ static void rna_def_movie(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
@@ -762,6 +802,7 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 943129c7169..c8193bb4005 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -211,13 +211,20 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "point_cache_low", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache_low", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
RNA_def_property_ui_text(prop, "Point Cache", "");
- prop= RNA_def_property(srna, "point_cache_high", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "point_cache_high", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]");
RNA_def_property_ui_text(prop, "Point Cache", "");
+
+ prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "EffectorWeights");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Effector Weights", "");
}
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index bb01ab9a9c7..72856e54bdf 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -38,8 +38,7 @@
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
-#include "BKE_paint.h"
-
+#include "WM_api.h"
#include "WM_types.h"
EnumPropertyItem space_type_items[] = {
@@ -65,26 +64,35 @@ EnumPropertyItem space_type_items[] = {
{SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
{0, NULL, 0, NULL, NULL}};
-#define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."}
-#define DC_RGBA {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency."}
-#define DC_ALPHA {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel."}
-#define DC_Z {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)."}
+static EnumPropertyItem draw_channels_items[] = {
+ {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."},
+ {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency."},
+ {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel."},
+ {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)."},
#ifdef WITH_LCMS
-#define DC_LCMS {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."}
-#else
-#define DC_LCMS {0, NULL, 0, NULL, NULL}
+ {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."},
#endif
-#define DC_ZERO {0, NULL, 0, NULL, NULL}
+ {0, NULL, 0, NULL, NULL}};
-static EnumPropertyItem dc_all_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_Z, DC_LCMS, DC_ZERO};
+static EnumPropertyItem transform_orientation_items[] = {
+ {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"},
+ {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
+ {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
+ {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
+ {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
+ {0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
+#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "BKE_animsys.h"
#include "BKE_brush.h"
+#include "BKE_colortools.h"
#include "BKE_context.h"
+#include "BKE_paint.h"
#include "ED_image.h"
#include "ED_screen.h"
@@ -139,6 +147,59 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr)
}
}
+static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
+{
+ Scene *scene = ((bScreen*)ptr->id.data)->scene;
+ View3D *v3d= (View3D*)ptr->data;
+
+ if (v3d->twmode < 4)
+ return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
+ else
+ return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, BLI_findlink(&scene->transform_spaces, v3d->twmode - 4));
+}
+
+EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ Scene *scene = NULL;
+ ListBase *transform_spaces;
+ TransformOrientation *ts= NULL;
+ EnumPropertyItem tmp = {0, "", 0, "", ""};
+ EnumPropertyItem *item= NULL;
+ int i = V3D_MANIP_CUSTOM, totitem= 0;
+
+ RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GLOBAL);
+ RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_NORMAL);
+ RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
+ RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
+
+ if (ptr->type == &RNA_Space3DView)
+ scene = ((bScreen*)ptr->id.data)->scene;
+ else
+ scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
+
+ if(scene) {
+ transform_spaces = &scene->transform_spaces;
+ ts = transform_spaces->first;
+ }
+
+ if(ts)
+ {
+ RNA_enum_item_add_separator(&item, &totitem);
+
+ for(; ts; ts = ts->next) {
+ tmp.identifier = ts->name;
+ tmp.name= ts->name;
+ tmp.value = i++;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
+}
+
/* Space Image Editor */
static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
@@ -181,34 +242,58 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
}
-static EnumPropertyItem dc_rgb_items[] = {DC_RGB, DC_LCMS, DC_ZERO};
-static EnumPropertyItem dc_alpha_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_LCMS, DC_ZERO};
-static EnumPropertyItem dc_z_items[] = {DC_RGB, DC_Z, DC_LCMS, DC_ZERO};
-
static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, int *free)
{
SpaceImage *sima= (SpaceImage*)ptr->data;
- ImBuf *ibuf= ED_space_image_buffer(sima);
- int zbuf, alpha;
+ EnumPropertyItem *item= NULL;
+ ImBuf *ibuf;
+ void *lock;
+ int zbuf, alpha, totitem= 0;
- if(C==NULL) {
- /* needed for doc generation */
- return dc_all_items;
- }
+ ibuf= ED_space_image_acquire_buffer(sima, &lock);
alpha= ibuf && (ibuf->channels == 4);
zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
+ ED_space_image_release_buffer(sima, lock);
+
if(alpha && zbuf)
- return dc_all_items;
- else if(alpha)
- return dc_alpha_items;
- else if(zbuf)
- return dc_z_items;
- else
- return dc_rgb_items;
+ return draw_channels_items;
+
+ RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
+
+ if(alpha) {
+ RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
+ RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
+ }
+ else if(zbuf) {
+ RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
+ }
+
+#ifdef WITH_LCMS
+ RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_COLOR_CORRECTION);
+#endif
+
+ RNA_enum_item_end(&item, &totitem);
+ *free= 1;
+
+ return item;
}
+static void rna_SpaceImageEditor_curves_update(bContext *C, PointerRNA *ptr)
+{
+ SpaceImage *sima= (SpaceImage*)ptr->data;
+ ImBuf *ibuf;
+ void *lock;
+
+ ibuf= ED_space_image_acquire_buffer(sima, &lock);
+ curvemapping_do_ibuf(sima->cumap, ibuf);
+ ED_space_image_release_buffer(sima, lock);
+
+ WM_event_add_notifier(C, NC_IMAGE, sima->image);
+}
+
+
/* Space Text Editor */
static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
@@ -227,13 +312,6 @@ static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
st->top= 0;
}
-static void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value)
-{
- SpaceFile *sfile= (SpaceFile*)(ptr->data);
-
- sfile->params= value.data;
-}
-
/* Space Properties */
static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
@@ -311,12 +389,36 @@ static void rna_View3D_display_background_image_set(PointerRNA *ptr, int value)
}
/* Space Time */
+
static void rna_SpaceTime_redraw_update(bContext *C, PointerRNA *ptr)
{
SpaceTime *st= (SpaceTime*)ptr->data;
ED_screen_animation_timer_update(C, st->redraws);
}
+/* Space Dopesheet */
+
+static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
+{
+ SpaceAction *saction= (SpaceAction*)(ptr->data);
+ saction->action= value.data;
+}
+
+static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
+{
+ SpaceAction *saction= (SpaceAction*)(ptr->data);
+ Object *obact= CTX_data_active_object(C);
+
+ /* we must set this action to be the one used by active object (if not pinned) */
+ if(obact && saction->pin == 0) {
+ AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
+
+ /* set action */
+ adt->action= saction->action;
+ id_us_plus(&adt->action->id);
+ }
+}
+
#else
static void rna_def_space(BlenderRNA *brna)
@@ -491,7 +593,8 @@ static void rna_def_background_image(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -540,19 +643,12 @@ static void rna_def_space_3dview(BlenderRNA *brna)
{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem transform_orientation_items[] = {
- {V3D_MANIP_GLOBAL, "ORIENT_GLOBAL", 0, "Global", "Align the transformation axes to world space"},
- {V3D_MANIP_LOCAL, "ORIENT_LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
- {V3D_MANIP_NORMAL, "ORIENT_NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
- {V3D_MANIP_VIEW, "ORIENT_VIEW", 0, "View", "Align the transformation axes to the window"},
- {V3D_MANIP_CUSTOM, "ORIENT_CUSTOM", 0, "Custom", "Use a custom transform orientation"},
- {0, NULL, 0, NULL, NULL}};
-
srna= RNA_def_struct(brna, "Space3DView", "Space");
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "camera");
RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera).");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -572,11 +668,9 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
- prop= RNA_def_property(srna, "localview", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "localview", 0);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "localvd");
RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility.");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lens");
@@ -666,6 +760,11 @@ static void rna_def_space_3dview(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+ prop= RNA_def_property(srna, "pivot_point_align", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
+ RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms.");
@@ -689,9 +788,15 @@ static void rna_def_space_3dview(BlenderRNA *brna)
prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "twmode");
RNA_def_property_enum_items(prop, transform_orientation_items);
- RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles.");
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
+ RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+ prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "TransformOrientation");
+ RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation.");
+
prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED);
RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation");
@@ -715,12 +820,14 @@ static void rna_def_space_buttons(BlenderRNA *brna)
static EnumPropertyItem buttons_context_items[] = {
{BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"},
+ {BCONTEXT_RENDER, "RENDER", ICON_SCENE_DATA, "Render", "Render"},
{BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
{BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
- {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraint", "Constraint"},
- {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifier", "Modifier"},
+ {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Constraints"},
+ {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifiers"},
{BCONTEXT_DATA, "DATA", 0, "Data", "Data"},
{BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"},
+ {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"},
{BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
{BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
{BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"},
@@ -779,7 +886,8 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
- prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -787,7 +895,7 @@ static void rna_def_space_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cumap");
RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image.");
- RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
@@ -802,13 +910,14 @@ static void rna_def_space_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
- RNA_def_property_enum_items(prop, dc_all_items);
+ RNA_def_property_enum_items(prop, draw_channels_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* uv */
- prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "SpaceUVEditor");
RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL);
RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings.");
@@ -1036,6 +1145,13 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
RNA_def_struct_sdna(srna, "SpaceAction");
RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data.");
+
+ /* data */
+ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL);
+ RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space.");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
@@ -1199,6 +1315,11 @@ static void rna_def_space_time(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sequencer Windows", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
+ prop= RNA_def_property(srna, "play_nodes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_NODES);
+ RNA_def_property_ui_text(prop, "Node Windows", "");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
+
/* Other options */
prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE);
@@ -1422,7 +1543,6 @@ static void rna_def_space_filebrowser(BlenderRNA *brna)
prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "params");
- RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL);
RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser.");
}
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 22cf7e7aeae..8c9b2b58887 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -198,7 +198,8 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Lines", "Lines of text.");
- prop= RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "curl");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine");
@@ -209,7 +210,8 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Current Character", "Index of current character in current line, and also start index of character in selection if one exists.");
- prop= RNA_def_property(srna, "selection_end_line", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "selection_end_line", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sell");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine");
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 7a81138a3be..f49eb4122c5 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -37,11 +37,10 @@
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "DNA_node_types.h"
+#include "DNA_scene_types.h" /* MAXFRAME only */
#include "BKE_node.h"
-#include "WM_types.h"
-
static EnumPropertyItem texture_filter_items[] = {
{TXF_BOX, "BOX", 0, "Box", ""},
{TXF_EWA, "EWA", 0, "EWA", ""},
@@ -52,9 +51,15 @@ static EnumPropertyItem texture_filter_items[] = {
#ifdef RNA_RUNTIME
+#include "BKE_depsgraph.h"
#include "BKE_texture.h"
+#include "BKE_main.h"
+
#include "ED_node.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
Tex *tex= (Tex*)ptr->data;
@@ -95,6 +100,22 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
}
}
+static void rna_Texture_update(bContext *C, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ DAG_id_flush_update(&tex->id, 0);
+ WM_event_add_notifier(C, NC_TEXTURE, tex);
+}
+
+static void rna_Texture_nodes_update(bContext *C, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ DAG_id_flush_update(&tex->id, 0);
+ WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, tex);
+}
+
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
@@ -112,6 +133,28 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
tex->type = value;
}
+void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ DAG_id_flush_update(id, 0);
+
+ switch(GS(id->name)) {
+ case ID_MA:
+ WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, id);
+ break;
+ case ID_WO:
+ WM_event_add_notifier(C, NC_WORLD, id);
+ break;
+ case ID_LA:
+ WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, id);
+ break;
+ case ID_BR:
+ WM_event_add_notifier(C, NC_BRUSH, id);
+ break;
+ }
+}
+
static int rna_TextureSlot_name_length(PointerRNA *ptr)
{
MTex *mtex= ptr->data;
@@ -163,7 +206,7 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR
EnumPropertyItem *item= NULL;
int totitem= 0;
- if(tex && C) { /* Note, tex/mtex/ntree can be invalid of C is NULL, TODO - can this give valid results when C is NULL? */
+ if(tex) {
bNodeTree *ntree= tex->nodetree;
if(ntree) {
EnumPropertyItem tmp= {0, "", 0, "", ""};
@@ -186,8 +229,8 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR
}
RNA_enum_item_end(&item, &totitem);
-
*free = 1;
+
return item;
}
@@ -242,20 +285,6 @@ static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA *
return item;
}
-static float rna_TextureSlot_angle_get(PointerRNA *ptr)
-{
- MTex *tex= (MTex*)ptr->data;
- const float conv = 57.295779506;
- return tex->rot * conv;
-}
-
-static void rna_TextureSlot_angle_set(PointerRNA *ptr, float v)
-{
- MTex *tex= (MTex*)ptr->data;
- const float conv = 0.017453293;
- tex->rot = v * conv;
-}
-
#else
static void rna_def_color_ramp_element(BlenderRNA *brna)
@@ -271,13 +300,13 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Position", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_color_ramp(BlenderRNA *brna)
@@ -301,13 +330,13 @@ static void rna_def_color_ramp(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texmapping(BlenderRNA *brna)
@@ -321,37 +350,37 @@ static void rna_def_texmapping(BlenderRNA *brna)
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "has_minimum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "has_maximum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_mtex(BlenderRNA *brna)
@@ -378,12 +407,6 @@ static void rna_def_mtex(BlenderRNA *brna)
{MTEX_LIN_LIGHT , "LINEAR LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem prop_map_mode_items[] = {
- {MTEX_MAP_MODE_FIXED, "FIXED", 0, "Fixed", ""},
- {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
- {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem output_node_items[] = {
{0, "DUMMY", 0, "Dummy", ""},
{0, NULL, 0, NULL, NULL}};
@@ -398,89 +421,66 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL);
RNA_def_property_ui_text(prop, "Name", "Texture slot name.");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
/* mapping */
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
RNA_def_property_enum_items(prop, prop_blend_type_items);
RNA_def_property_ui_text(prop, "Blend Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL);
RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "negate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE);
RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT);
RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
- RNA_def_property_float_sdna(prop, NULL, "rot");
- RNA_def_property_range(prop, 0, 360);
- RNA_def_property_float_funcs(prop, "rna_TextureSlot_angle_get", "rna_TextureSlot_angle_set", NULL);
- RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "brush_map_mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_map_mode_items);
- RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "def_var");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
- RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Variable Factor", "Amount texture affects other values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "norfac");
- RNA_def_property_ui_range(prop, 0, 5, 10, 3);
- RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "which_output");
RNA_def_property_enum_items(prop, output_node_items);
RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf");
RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
}
static void rna_def_filter_size_common(StructRNA *srna)
@@ -491,14 +491,14 @@ static void rna_def_filter_size_common(StructRNA *srna)
prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
RNA_def_property_ui_text(prop, "Use Filter", "Use Filter Size as a minimal filter value in pixels");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "filtersize");
RNA_def_property_range(prop, 0.1, 50.0);
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_environment_map_common(StructRNA *srna)
@@ -515,14 +515,14 @@ static void rna_def_environment_map_common(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_source_items);
RNA_def_property_ui_text(prop, "Source", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: move this to specific types if needed */
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_environment_map(BlenderRNA *brna)
@@ -545,28 +545,28 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.01, 50, 100, 2);
RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2);
RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viewscale");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_range(prop, 0.5, 5, 100, 2);
RNA_def_property_ui_text(prop, "Zoom", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: EnvMap.notlay */
@@ -574,12 +574,12 @@ static void rna_def_environment_map(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "cuberes");
RNA_def_property_range(prop, 50, 4096);
RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static EnumPropertyItem prop_noise_basis_items[] = {
@@ -620,38 +620,38 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_clouds_stype);
RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_wood(BlenderRNA *brna)
@@ -681,44 +681,44 @@ static void rna_def_texture_wood(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_wood_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -748,51 +748,51 @@ static void rna_def_texture_marble(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "turbul");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_marble_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -810,14 +810,14 @@ static void rna_def_texture_magic(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 6, 0, 2);
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_blend(BlenderRNA *brna)
@@ -848,13 +848,13 @@ static void rna_def_texture_blend(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_blend_progression);
RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_flip_axis_items);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -878,32 +878,32 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
RNA_def_property_enum_items(prop, prop_noise_type);
RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_stucci_stype);
RNA_def_property_ui_text(prop, "Pattern", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_noise(BlenderRNA *brna)
@@ -921,11 +921,11 @@ static void rna_def_texture_image(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_image_extension[] = {
- {1, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
- {2, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
- {4, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"},
- {3, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
- {5, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
+ {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
+ {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
+ {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"},
+ {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
+ {TEX_CHECKER, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ImageTexture", "Texture");
@@ -936,45 +936,45 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
RNA_def_property_ui_text(prop, "MIP Map Gauss", "Uses Gauss filter to sample down MIP maps");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using Area filter");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */
prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT);
RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA);
RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "calculate_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA);
RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_size_common(srna);
prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3"
* not sure why this goes in mtex instead of texture directly? */
@@ -982,47 +982,47 @@ static void rna_def_texture_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_image_extension);
- RNA_def_property_ui_text(prop, "Extension", "Sets how the image is stretched in the texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_ui_text(prop, "Extension", "Sets how the image is extrapolated past its original bounds");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat X", "Sets a repetition multiplier in the X direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrepeat");
RNA_def_property_range(prop, 1, 512);
RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR);
RNA_def_property_ui_text(prop, "Mirror X", "Mirrors the image repetition on the X direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR);
RNA_def_property_ui_text(prop, "Mirror Y", "Mirrors the image repetition on the Y direction");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_odd", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD);
RNA_def_property_ui_text(prop, "Checker Odd", "Sets odd checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_even", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN);
RNA_def_property_ui_text(prop, "Checker Even", "Sets even checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "checkerdist");
RNA_def_property_range(prop, 0.0, 0.99);
RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01);
RNA_def_property_ui_text(prop, "Checker Distance", "Sets distance between checker tiles");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
#if 0
@@ -1034,7 +1034,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_array(prop, 4);
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_text(prop, "Crop Rectangle", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
#endif
@@ -1043,35 +1043,40 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum X", "Sets minimum X value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymin");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Minimum Y", "Sets minimum Y value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum X", "Sets maximum X value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropymax");
RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2);
RNA_def_property_ui_text(prop, "Crop Maximum Y", "Sets maximum Y value to crop the image");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ima");
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "iuser");
+ RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* filtering */
prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
@@ -1079,19 +1084,19 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_enum_items(prop, texture_filter_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf");
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_plugin(BlenderRNA *brna)
@@ -1116,11 +1121,16 @@ static void rna_def_texture_environment_map(BlenderRNA *brna)
rna_def_environment_map_common(srna);
+ prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "iuser");
+ RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed.");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "env");
RNA_def_property_struct_type(prop, "EnvironmentMap");
RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
rna_def_filter_size_common(srna);
}
@@ -1146,62 +1156,62 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "stype");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "highest_dimension", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_H");
RNA_def_property_range(prop, 0.0001, 2);
RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Lacunarity", "Gap between succesive frequencies");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_octaves");
RNA_def_property_range(prop, 0, 8);
RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_offset");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Offset", "The fractal offset");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_gain");
RNA_def_property_range(prop, 0, 6);
RNA_def_property_ui_text(prop, "Gain", "The gain multiplier");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_voronoi(BlenderRNA *brna)
@@ -1235,62 +1245,62 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w2");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w3");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_w4");
RNA_def_property_range(prop, -2, 2);
RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_distm");
RNA_def_property_enum_items(prop, prop_distance_metric_items);
RNA_def_property_ui_text(prop, "Distance Metric", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vn_coltype");
RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
RNA_def_property_range(prop, 0.01, 10);
RNA_def_property_ui_text(prop, "Noise Intensity", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_distorted_noise(BlenderRNA *brna)
@@ -1306,32 +1316,32 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Distortion Amount", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_pointdensity(BlenderRNA *brna)
@@ -1387,104 +1397,104 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "source");
RNA_def_property_enum_items(prop, point_source_items);
RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Object", "Object to take point data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points");
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);
RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
RNA_def_property_enum_items(prop, vertice_cache_items);
RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "falloff_type");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "falloff_softness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "falloff_softness");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "color_source");
RNA_def_property_enum_items(prop, color_source_items);
RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_scale");
RNA_def_property_range(prop, 0.001, 100.0);
RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* Turbulence */
prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE);
RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_size");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "noise_fac");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Strength", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noise_depth");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_influence");
RNA_def_property_enum_items(prop, turbulence_influence_items);
RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_basis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
srna= RNA_def_struct(brna, "PointDensityTexture", "Texture");
@@ -1495,7 +1505,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "PointDensity");
RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture_voxeldata(BlenderRNA *brna)
@@ -1518,6 +1528,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"},
{TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem voxeldata_extension[] = {
+ {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
+ {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
+ {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "VoxelData", NULL);
RNA_def_struct_sdna(srna, "VoxelData");
@@ -1527,46 +1543,52 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "interp_type");
RNA_def_property_enum_items(prop, interpolation_type_items);
RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "extend");
+ RNA_def_property_enum_items(prop, voxeldata_extension);
+ RNA_def_property_ui_text(prop, "Extension", "Sets how the texture is extrapolated past its original bounds");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "int_multiplier");
RNA_def_property_range(prop, 0.01, FLT_MAX);
RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
- RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
@@ -1577,7 +1599,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "vd");
RNA_def_property_struct_type(prop, "VoxelData");
RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
}
static void rna_def_texture(BlenderRNA *brna)
@@ -1587,9 +1609,9 @@ static void rna_def_texture(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{0, "NONE", 0, "None", ""},
- {TEX_PLUGIN, "PLUGIN", ICON_CONSTRAINT, "Plugin", ""},
- {TEX_IMAGE, "IMAGE", ICON_RENDER_RESULT, "Image or Movie", ""},
- {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_RENDER_RESULT, "Environment Map", ""},
+ {TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""},
+ {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", ""},
+ {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", ""},
{TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", ""},
{TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", ""},
{TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", ""},
@@ -1616,51 +1638,61 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
RNA_def_property_ui_text(prop, "Brightness", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
-
- /* XXX: would be nicer to have this as a color selector?
- but the values can go past [0,1]. */
- prop= RNA_def_property(srna, "rgb_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ /* RGB Factor */
+ prop= RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rfac");
- RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0, 2);
- RNA_def_property_ui_text(prop, "RGB Factor", "");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_ui_text(prop, "Factor Red", "");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "factor_green", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "gfac");
+ RNA_def_property_range(prop, 0, 2);
+ RNA_def_property_ui_text(prop, "Factor Green", "");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "factor_blue", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "bfac");
+ RNA_def_property_range(prop, 0, 2);
+ RNA_def_property_ui_text(prop, "Factor Blue", "");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* nodetree */
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set");
RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
rna_def_animdata_common(srna);
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index f16180451a7..303511a2dca 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -343,17 +343,15 @@ static void menu_draw(const bContext *C, Menu *hdr)
static void rna_Menu_unregister(const bContext *C, StructRNA *type)
{
- ARegionType *art;
MenuType *mt= RNA_struct_blender_type_get(type);
if(!mt)
return;
- if(!(art=region_type_find(NULL, mt->space_type, RGN_TYPE_HEADER)))
- return;
RNA_struct_free_extension(type, &mt->ext);
- BLI_freelinkN(&art->menutypes, mt);
+ WM_menutype_freelink(mt);
+
RNA_struct_free(&BLENDER_RNA, type);
/* update while blender is running */
@@ -363,7 +361,6 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type)
static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
- ARegionType *art;
MenuType *mt, dummymt = {0};
Menu dummymenu= {0};
PointerRNA dummymtr;
@@ -376,18 +373,11 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
/* validate the python class */
if(validate(&dummymtr, data, have_function) != 0)
return NULL;
-
- if(!(art=region_type_find(reports, dummymt.space_type, RGN_TYPE_HEADER)))
- return NULL;
/* check if we have registered this menu type before, and remove it */
- for(mt=art->menutypes.first; mt; mt=mt->next) {
- if(strcmp(mt->idname, dummymt.idname) == 0) {
- if(mt->ext.srna)
- rna_Menu_unregister(C, mt->ext.srna);
- break;
- }
- }
+ mt= WM_menutype_find(dummymt.idname, TRUE);
+ if(mt && mt->ext.srna)
+ rna_Menu_unregister(C, mt->ext.srna);
/* create a new menu type */
mt= MEM_callocN(sizeof(MenuType), "python buttons menu");
@@ -402,7 +392,7 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
mt->poll= (have_function[0])? menu_poll: NULL;
mt->draw= (have_function[1])? menu_draw: NULL;
- BLI_addtail(&art->menutypes, mt);
+ WM_menutype_add(mt);
/* update while blender is running */
if(C)
@@ -738,11 +728,6 @@ static void rna_def_menu(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
- RNA_def_property_enum_items(prop, space_type_items);
- RNA_def_property_flag(prop, PROP_REGISTER);
-
RNA_define_verify_sdna(1);
}
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index e3cae8ab453..cce8fb0fef7 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -37,7 +37,7 @@
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only)
+static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle, int icon_only, int event, int full_event)
{
int flag= 0;
@@ -45,6 +45,8 @@ static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr,
flag |= (expand)? UI_ITEM_R_EXPAND: 0;
flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
+ flag |= (event)? UI_ITEM_R_EVENT: 0;
+ flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0;
uiItemR(layout, name, icon, ptr, propname, flag);
}
@@ -89,7 +91,7 @@ static void api_ui_item_rna_common(FunctionRNA *func)
PropertyRNA *parm;
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -146,7 +148,9 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values.");
RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values.");
- RNA_def_boolean(func, "icon_only", 0, "", "Only show the property's icon, with no text");
+ RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text.");
+ RNA_def_boolean(func, "event", 0, "", "Use button to input key events.");
+ RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers.");
func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR");
api_ui_item_rna_common(func);
@@ -165,7 +169,7 @@ void RNA_api_ui_layout(StructRNA *srna)
api_ui_item_common(func);
api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property.");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -251,34 +255,52 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block.");
RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block.");
RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block.");
-
+
+ func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_string(func, "type_property", "", 0, "", "Identifier of property in data giving the type of the ID-blocks to use.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI.");
+
+ func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ parm= RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI.");
+
func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_preview", "uiTemplatePreview");
parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
- parm= RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
+ RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
+ RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
- parm= RNA_def_pointer(func, "curvemap", "CurveMapping", "", "Curve mapping pointer.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_rna_common(func);
RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display.");
- RNA_def_boolean(func, "compact", 0, "", "Use more compact curve mapping.");
+ RNA_def_boolean(func, "levels", 0, "", "Show black/white levels.");
func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
- parm= RNA_def_pointer(func, "ramp", "ColorRamp", "", "Color ramp pointer.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
+ api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
func= RNA_def_function(srna, "template_layers", "uiTemplateLayers");
@@ -294,11 +316,21 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- func= RNA_def_function(srna, "template_list", "uiTemplateList");
+ func= RNA_def_function(srna, "template_image", "uiTemplateImage");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element.");
+ parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ RNA_def_boolean(func, "compact", 0, "", "Use more compact layout.");
+
+ func= RNA_def_function(srna, "template_list", "uiTemplateList");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element.");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX);
@@ -316,11 +348,6 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
-
- func= RNA_def_function(srna, "template_texture_image", "uiTemplateTextureImage");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "texture", "Texture", "", "");
- RNA_def_property_flag(parm, PROP_REQUIRED);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index fc66c04ee26..76778214537 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -42,6 +42,11 @@
#ifdef RNA_RUNTIME
+#include "BKE_main.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_depsgraph.h"
+#include "DNA_object_types.h"
+
static void rna_userdef_update(bContext *C, PointerRNA *ptr)
{
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -59,10 +64,12 @@ static void rna_userdef_lmb_select_set(PointerRNA *ptr,int value)
userdef->flag &= ~USER_LMOUSESELECT;
}
+#if 0
static void rna_userdef_rmb_select_set(PointerRNA *ptr,int value)
{
rna_userdef_lmb_select_set(ptr, !value);
}
+#endif
static void rna_userdef_emulate_set(PointerRNA *ptr,int value)
{
@@ -109,11 +116,6 @@ static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
}
-static PointerRNA rna_UserDef_language_get(PointerRNA *ptr)
-{
- return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesLanguage, ptr->data);
-}
-
static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
@@ -129,6 +131,23 @@ static void rna_UserDef_audio_update(bContext *C, PointerRNA *ptr)
sound_init(C);
}
+static void rna_UserDef_weight_color_update(bContext *C, PointerRNA *ptr)
+{
+ Main *bmain= CTX_data_main(C);
+ Object *ob;
+
+ vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
+
+ for(ob= bmain->object.first; ob; ob= ob->id.next) {
+ if(ob->mode & OB_MODE_WEIGHT_PAINT)
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+ }
+
+ rna_userdef_update(C, ptr);
+}
+
+
+
#else
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
@@ -197,25 +216,29 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_property_range(prop, 0.5, 2.0);
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas.");
- prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Panel Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Group Label Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Widget Label Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widget");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Widget Font", "");
@@ -317,7 +340,7 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Driven Selected", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_PERCENTAGE);
+ prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_ui_text(prop, "Blend", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -334,97 +357,113 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ThemeUI");
RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements.");
- prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Text Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Option Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Number Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Menu Item Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
RNA_def_property_struct_type(prop, "ThemeWidgetColors");
RNA_def_property_ui_text(prop, "List Item Colors", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
RNA_def_property_ui_text(prop, "State Colors", "");
@@ -1390,87 +1429,104 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "Name of the theme.");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tui");
RNA_def_property_struct_type(prop, "ThemeUserInterface");
RNA_def_property_ui_text(prop, "User Interface", "");
- prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
RNA_def_property_struct_type(prop, "ThemeView3D");
RNA_def_property_ui_text(prop, "3D View", "");
- prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tipo");
RNA_def_property_struct_type(prop, "ThemeGraphEditor");
RNA_def_property_ui_text(prop, "Graph Editor", "");
- prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tfile");
RNA_def_property_struct_type(prop, "ThemeFileBrowser");
RNA_def_property_ui_text(prop, "File Browser", "");
- prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tnla");
RNA_def_property_struct_type(prop, "ThemeNLAEditor");
RNA_def_property_ui_text(prop, "NLA Editor", "");
- prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tact");
RNA_def_property_struct_type(prop, "ThemeDopeSheet");
RNA_def_property_ui_text(prop, "DopeSheet", "");
- prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tima");
RNA_def_property_struct_type(prop, "ThemeImageEditor");
RNA_def_property_ui_text(prop, "Image Editor", "");
- prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tseq");
RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
RNA_def_property_ui_text(prop, "Sequence Editor", "");
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
RNA_def_property_struct_type(prop, "ThemeProperties");
RNA_def_property_ui_text(prop, "Properties", "");
- prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "text");
RNA_def_property_struct_type(prop, "ThemeTextEditor");
RNA_def_property_ui_text(prop, "Text Editor", "");
- prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "ttime");
RNA_def_property_struct_type(prop, "ThemeTimeline");
RNA_def_property_ui_text(prop, "Timeline", "");
- prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tnode");
RNA_def_property_struct_type(prop, "ThemeNodeEditor");
RNA_def_property_ui_text(prop, "Node Editor", "");
- prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
RNA_def_property_struct_type(prop, "ThemeLogicEditor");
RNA_def_property_ui_text(prop, "Logic Editor", "");
- prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "toops");
RNA_def_property_struct_type(prop, "ThemeOutliner");
RNA_def_property_ui_text(prop, "Outliner", "");
- prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
RNA_def_property_struct_type(prop, "ThemeInfo");
RNA_def_property_ui_text(prop, "Info", "");
- prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
RNA_def_property_struct_type(prop, "ThemeUserPreferences");
RNA_def_property_ui_text(prop, "User Preferences", "");
- prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
RNA_def_property_ui_text(prop, "Bone Color Sets", "");
@@ -1541,6 +1597,16 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement."},
{USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."},
{0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem select_mouse_items[] = {
+ {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection."},
+ {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem middle_mouse_mouse_items[] = {
+ {0, "PAN", 0, "Pan", "Use the middle mouse button for panning the viewport."},
+ {USER_VIEWMOVE, "ROTATE", 0, "Rotate", "Use the middle mouse button for rotation the viewport."},
+ {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem view_rotation_items[] = {
{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport."},
@@ -1623,6 +1689,10 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction.");
+ prop= RNA_def_property(srna, "continuous_mouse", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
+ RNA_def_property_ui_text(prop, "Continuous Grab", "Experimental option to allow moving the mouse outside the view");
+
prop= RNA_def_property(srna, "global_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views.");
@@ -1656,15 +1726,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the orbiting center.");
/* select with */
- prop= RNA_def_property(srna, "left_mouse_button_select", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_LMOUSESELECT);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_lmb_select_set");
- RNA_def_property_ui_text(prop, "Left Mouse Button Select", "Use left Mouse Button for selection.");
- prop= RNA_def_property(srna, "right_mouse_button_select", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_LMOUSESELECT);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_rmb_select_set");
- RNA_def_property_ui_text(prop, "Right Mouse Button Select", "Use Right Mouse Button for selection.");
+ prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, select_mouse_items);
+ RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection.");
prop= RNA_def_property(srna, "emulate_3_button_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
@@ -1693,13 +1759,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* middle mouse button */
- prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_VIEWMOVE);
- RNA_def_property_ui_text(prop, "Middle Mouse Rotate", "Use the middle mouse button for rotation the viewport.");
-
- prop= RNA_def_property(srna, "middle_mouse_pan", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_VIEWMOVE);
- RNA_def_property_ui_text(prop, "Middle Mouse Pan", "Use the middle mouse button for panning the viewport.");
+
+ prop= RNA_def_property(srna, "middle_mouse", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, middle_mouse_mouse_items);
+ RNA_def_property_ui_text(prop, "Middle Mouse", "Use the middle mouse button to pan or zoom the view.");
prop= RNA_def_property(srna, "wheel_invert_zoom", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
@@ -1851,10 +1915,14 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "auto_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves.");
-
- prop= RNA_def_property(srna, "auto_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
+
+ prop= RNA_def_property(srna, "auto_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
+ RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set.");
+
+ prop= RNA_def_property(srna, "keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
- RNA_def_property_ui_text(prop, "Auto Keyframe Insert Needed", "Automatic keyframe insertion only when keyframe needed.");
+ RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed.");
prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
@@ -1937,12 +2005,83 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object.");
}
-static void rna_def_userdef_language(BlenderRNA *brna)
+static void rna_def_userdef_system(BlenderRNA *brna)
{
PropertyRNA *prop;
StructRNA *srna;
-
- /* hardcoded here, could become dynamic somehow */
+
+ static EnumPropertyItem gl_texture_clamp_items[] = {
+ {0, "CLAMP_OFF", 0, "Off", ""},
+ {8192, "CLAMP_8192", 0, "8192", ""},
+ {4096, "CLAMP_4096", 0, "4096", ""},
+ {2048, "CLAMP_2048", 0, "2048", ""},
+ {1024, "CLAMP_1024", 0, "1024", ""},
+ {512, "CLAMP_512", 0, "512", ""},
+ {256, "CLAMP_256", 0, "256", ""},
+ {128, "CLAMP_128", 0, "128", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_mixing_samples_items[] = {
+ {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
+ {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
+ {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
+ {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
+ {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
+ {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
+ {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
+ {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_device_items[] = {
+ {0, "NONE", 0, "None", "Null device - there will be no audio output."},
+#ifdef WITH_SDL
+ {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage."},
+#endif
+#ifdef WITH_OPENAL
+ {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage."},
+#endif
+#ifdef WITH_JACK
+ {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users."},
+#endif
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_rate_items[] = {
+// {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second."},
+// {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second."},
+// {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second."},
+// {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second."},
+// {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second."},
+ {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second."},
+ {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second."},
+// {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second."},
+ {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second."},
+ {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_format_items[] = {
+ {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer."},
+ {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer."},
+ {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer."},
+ {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer."},
+ {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float."},
+ {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem audio_channel_items[] = {
+ {1, "MONO", 0, "Mono", "Set audio channels to mono."},
+ {2, "STEREO", 0, "Stereo", "Set audio channels to stereo."},
+ {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels."},
+ {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound."},
+ {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound."},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem draw_method_items[] = {
+ {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory."},
+ {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws."},
+ {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails."},
+ {0, NULL, 0, NULL, NULL}};
+
+ /* hardcoded here, could become dynamic somehow */
static EnumPropertyItem language_items[] = {
{0, "ENGLISH", 0, "English", ""},
{1, "JAPANESE", 0, "Japanese", ""},
@@ -1968,11 +2107,13 @@ static void rna_def_userdef_language(BlenderRNA *brna)
{21, "GREEK", 0, "Greek", ""},
{22, "KOREAN", 0, "Korean", ""},
{0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "UserPreferencesLanguage", NULL);
+
+ srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
- RNA_def_struct_ui_text(srna, "Language & Font", "User interface translation settings.");
+ RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings.");
+
+ /* Language */
prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
@@ -2016,88 +2157,6 @@ static void rna_def_userdef_language(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts.");
RNA_def_property_update(prop, 0, "rna_userdef_update");
-}
-
-static void rna_def_userdef_system(BlenderRNA *brna)
-{
- PropertyRNA *prop;
- StructRNA *srna;
-
- static EnumPropertyItem gl_texture_clamp_items[] = {
- {0, "GL_CLAMP_OFF", 0, "Off", ""},
- {8192, "GL_CLAMP_8192", 0, "8192", ""},
- {4096, "GL_CLAMP_4096", 0, "4096", ""},
- {2048, "GL_CLAMP_2048", 0, "2048", ""},
- {1024, "GL_CLAMP_1024", 0, "1024", ""},
- {512, "GL_CLAMP_512", 0, "512", ""},
- {256, "GL_CLAMP_256", 0, "256", ""},
- {128, "GL_CLAMP_128", 0, "128", ""},
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem audio_mixing_samples_items[] = {
- {256, "AUDIO_SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
- {512, "AUDIO_SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
- {1024, "AUDIO_SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
- {2048, "AUDIO_SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
- {4096, "AUDIO_SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
- {8192, "AUDIO_SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
- {16384, "AUDIO_SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
- {32768, "AUDIO_SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem audio_device_items[] = {
- {0, "AUDIO_DEVICE_NULL", 0, "No Audio", "Null device - there will be no audio output."},
-#ifdef WITH_SDL
- {1, "AUDIO_DEVICE_SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage."},
-#endif
-#ifdef WITH_OPENAL
- {2, "AUDIO_DEVICE_OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage."},
-#endif
-#ifdef WITH_JACK
- {3, "AUDIO_DEVICE_JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users."},
-#endif
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem audio_rate_items[] = {
-// {8000, "AUDIO_RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second."},
-// {11025, "AUDIO_RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second."},
-// {16000, "AUDIO_RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second."},
-// {22050, "AUDIO_RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second."},
-// {32000, "AUDIO_RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second."},
- {44100, "AUDIO_RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second."},
- {48000, "AUDIO_RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second."},
-// {88200, "AUDIO_RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second."},
- {96000, "AUDIO_RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second."},
- {192000, "AUDIO_RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second."},
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem audio_format_items[] = {
- {0x01, "AUDIO_FORMAT_U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer."},
- {0x12, "AUDIO_FORMAT_S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer."},
- {0x13, "AUDIO_FORMAT_S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer."},
- {0x14, "AUDIO_FORMAT_S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer."},
- {0x24, "AUDIO_FORMAT_FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float."},
- {0x28, "AUDIO_FORMAT_DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float."},
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem audio_channel_items[] = {
- {1, "AUDIO_CHANNELS_MONO", 0, "Mono", "Set audio channels to mono."},
- {2, "AUDIO_CHANNELS_STEREO", 0, "Stereo", "Set audio channels to stereo."},
- {4, "AUDIO_CHANNELS_SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels."},
- {6, "AUDIO_CHANNELS_SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound."},
- {8, "AUDIO_CHANNELS_SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound."},
- {0, NULL, 0, NULL, NULL}};
-
- static EnumPropertyItem draw_method_items[] = {
- {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory."},
- {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws."},
- {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails."},
- {0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
- RNA_def_struct_sdna(srna, "UserDef");
- RNA_def_struct_nested(brna, srna, "UserPreferences");
- RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings.");
/* System & OpenGL */
@@ -2109,11 +2168,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
- prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode.");
+ RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
prop= RNA_def_property(srna, "enable_all_codecs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
@@ -2146,14 +2208,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_SOUND);
RNA_def_property_ui_text(prop, "Game Sound", "Enables sounds to be played in games.");
- prop= RNA_def_property(srna, "filter_file_extensions", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
- RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window.");
-
- prop= RNA_def_property(srna, "hide_dot_files_datablocks", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
- RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
-
prop= RNA_def_property(srna, "clip_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -2163,6 +2217,10 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3d View (looks nicer but uses more memory and slows image reloading.)");
+ prop= RNA_def_property(srna, "use_vbos", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
+ RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering.");
+
prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
RNA_def_property_enum_items(prop, gl_texture_clamp_items);
@@ -2233,7 +2291,15 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "UserDef");
RNA_def_struct_nested(brna, srna, "UserPreferences");
RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files.");
-
+
+ prop= RNA_def_property(srna, "hide_dot_files_datablocks", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
+ RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
+
+ prop= RNA_def_property(srna, "filter_file_extensions", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
+ RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window.");
+
prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector.");
@@ -2310,12 +2376,12 @@ void RNA_def_userdef(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem user_pref_sections[] = {
- {0, "VIEW_CONTROLS", 0, "View", ""},
- {1, "EDIT_METHODS", 0, "Editing", ""},
- {2, "LANGUAGE_COLORS", 0, "Language", ""},
- {3, "SYSTEM_OPENGL", 0, "System", ""},
- {4, "FILE_PATHS", 0, "File", ""},
- {5, "THEMES", 0, "Themes", ""},
+ {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
+ {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
+ {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
+// {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, // Leave this out until we figure out a way to manage themes in the prefs.
+ {USER_SECTION_FILE, "FILES", 0, "File", ""},
+ {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
{0, NULL, 0, NULL, NULL}};
rna_def_userdef_dothemes(brna);
@@ -2329,6 +2395,7 @@ void RNA_def_userdef(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "userpref");
RNA_def_property_enum_items(prop, user_pref_sections);
RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface.");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
@@ -2341,34 +2408,32 @@ void RNA_def_userdef(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Styles", "");
/* nested structs */
- prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesView");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL);
RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data.");
- prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesEdit");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data.");
- prop= RNA_def_property(srna, "language", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_struct_type(prop, "UserPreferencesLanguage");
- RNA_def_property_pointer_funcs(prop, "rna_UserDef_language_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Language & Font", "User interface translation settings.");
-
- prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL);
RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files.");
- prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UserPreferencesSystem");
RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL);
RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings.");
rna_def_userdef_view(brna);
rna_def_userdef_edit(brna);
- rna_def_userdef_language(brna);
rna_def_userdef_filepaths(brna);
rna_def_userdef_system(brna);
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 53532e3f383..82b244fa702 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -24,14 +24,37 @@
#include <stdlib.h>
+#include "RNA_access.h"
#include "RNA_define.h"
+#include "RNA_enum_types.h"
#include "RNA_types.h"
#include "rna_internal.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
-#include "WM_types.h" /* wmEvent */
+#include "WM_types.h"
+
+EnumPropertyItem event_keymouse_value_items[] = {
+ {KM_ANY, "ANY", 0, "Any", ""},
+ {KM_PRESS, "PRESS", 0, "Press", ""},
+ {KM_RELEASE, "RELEASE", 0, "Release", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem event_tweak_value_items[]= {
+ {KM_ANY, "ANY", 0, "Any", ""},
+ {EVT_GESTURE_N, "NORTH", 0, "North", ""},
+ {EVT_GESTURE_NE, "NORTH_EAST", 0, "North-East", ""},
+ {EVT_GESTURE_E, "EAST", 0, "East", ""},
+ {EVT_GESTURE_SE, "SOUTH_EAST", 0, "South-East", ""},
+ {EVT_GESTURE_S, "SOUTH", 0, "South", ""},
+ {EVT_GESTURE_SW, "SOUTH_WEST", 0, "South-West", ""},
+ {EVT_GESTURE_W, "WEST", 0, "West", ""},
+ {EVT_GESTURE_NW, "NORTH_WEST", 0, "North-West", ""},
+ {0, NULL, 0, NULL, NULL}};
EnumPropertyItem event_value_items[] = {
{KM_ANY, "ANY", 0, "Any", ""},
@@ -40,28 +63,64 @@ EnumPropertyItem event_value_items[] = {
{KM_RELEASE, "RELEASE", 0, "Release", ""},
{0, NULL, 0, NULL, NULL}};
+EnumPropertyItem event_tweak_type_items[]= {
+ {EVT_TWEAK_L, "EVT_TWEAK_L", 0, "Left", ""},
+ {EVT_TWEAK_M, "EVT_TWEAK_M", 0, "Middle", ""},
+ {EVT_TWEAK_R, "EVT_TWEAK_R", 0, "Right", ""},
+ {EVT_TWEAK_A, "EVT_TWEAK_A", 0, "Action", ""},
+ {EVT_TWEAK_S, "EVT_TWEAK_S", 0, "Select", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem event_mouse_type_items[]= {
+ {LEFTMOUSE, "LEFTMOUSE", 0, "Left", ""},
+ {MIDDLEMOUSE, "MIDDLEMOUSE", 0, "Middle", ""},
+ {RIGHTMOUSE, "RIGHTMOUSE", 0, "Right", ""},
+ {BUTTON4MOUSE, "BUTTON4MOUSE", 0, "Button4", ""},
+ {BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5", ""},
+ {ACTIONMOUSE, "ACTIONMOUSE", 0, "Action", ""},
+ {SELECTMOUSE, "SELECTMOUSE", 0, "Select", ""},
+ {0, "", 0, NULL, NULL},
+ {MOUSEMOVE, "MOUSEMOVE", 0, "Move", ""},
+ {0, "", 0, NULL, NULL},
+ {WHEELUPMOUSE, "WHEELUPMOUSE", 0, "Wheel Up", ""},
+ {WHEELDOWNMOUSE, "WHEELDOWNMOUSE", 0, "Wheel Down", ""},
+ {WHEELINMOUSE, "WHEELINMOUSE", 0, "Wheel In", ""},
+ {WHEELOUTMOUSE, "WHEELOUTMOUSE", 0, "Wheel Out", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem event_timer_type_items[]= {
+ {TIMER, "TIMER", 0, "Timer", ""},
+ {TIMER0, "TIMER0", 0, "Timer 0", ""},
+ {TIMER1, "TIMER1", 0, "Timer 1", ""},
+ {TIMER2, "TIMER2", 0, "Timer 2", ""},
+ {TIMERJOBS, "JOBS_TIMER", 0, "Jobs Timer", ""},
+ {0, NULL, 0, NULL, NULL}};
+
/* not returned: CAPSLOCKKEY, UNKNOWNKEY, GRLESSKEY */
EnumPropertyItem event_type_items[] = {
+ {0, "NONE", 0, "", ""},
{LEFTMOUSE, "LEFTMOUSE", 0, "Left Mouse", ""},
{MIDDLEMOUSE, "MIDDLEMOUSE", 0, "Middle Mouse", ""},
{RIGHTMOUSE, "RIGHTMOUSE", 0, "Right Mouse", ""},
+ {BUTTON4MOUSE, "BUTTON4MOUSE", 0, "Button4 Mouse", ""},
+ {BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5 Mouse", ""},
{ACTIONMOUSE, "ACTIONMOUSE", 0, "Action Mouse", ""},
{SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", ""},
-
+ {0, "", 0, NULL, NULL},
{MOUSEMOVE, "MOUSEMOVE", 0, "Mouse Move", ""},
-
+ {0, "", 0, NULL, NULL},
{WHEELUPMOUSE, "WHEELUPMOUSE", 0, "Wheel Up", ""},
{WHEELDOWNMOUSE, "WHEELDOWNMOUSE", 0, "Wheel Down", ""},
{WHEELINMOUSE, "WHEELINMOUSE", 0, "Wheel In", ""},
{WHEELOUTMOUSE, "WHEELOUTMOUSE", 0, "Wheel Out", ""},
-
+ {0, "", 0, NULL, NULL},
{EVT_TWEAK_L, "EVT_TWEAK_L", 0, "Tweak Left", ""},
{EVT_TWEAK_M, "EVT_TWEAK_M", 0, "Tweak Middle", ""},
{EVT_TWEAK_R, "EVT_TWEAK_R", 0, "Tweak Right", ""},
{EVT_TWEAK_A, "EVT_TWEAK_A", 0, "Tweak Action", ""},
{EVT_TWEAK_S, "EVT_TWEAK_S", 0, "Tweak Select", ""},
-
+ {0, "", 0, NULL, NULL},
{AKEY, "A", 0, "A", ""},
{BKEY, "B", 0, "B", ""},
{CKEY, "C", 0, "C", ""},
@@ -88,7 +147,7 @@ EnumPropertyItem event_type_items[] = {
{XKEY, "X", 0, "X", ""},
{YKEY, "Y", 0, "Y", ""},
{ZKEY, "Z", 0, "Z", ""},
-
+ {0, "", 0, NULL, NULL},
{ZEROKEY, "ZERO", 0, "0", ""},
{ONEKEY, "ONE", 0, "1", ""},
{TWOKEY, "TWO", 0, "2", ""},
@@ -99,16 +158,16 @@ EnumPropertyItem event_type_items[] = {
{SEVENKEY, "SEVEN", 0, "7", ""},
{EIGHTKEY, "EIGHT", 0, "8", ""},
{NINEKEY, "NINE", 0, "9", ""},
-
+ {0, "", 0, NULL, NULL},
{LEFTCTRLKEY, "LEFT_CTRL", 0, "Left Ctrl", ""},
{LEFTALTKEY, "LEFT_ALT", 0, "Left Alt", ""},
{LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Left Shift", ""},
{RIGHTALTKEY, "RIGHT_ALT", 0, "Right Alt", ""},
{RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""},
{RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""},
-
+ {0, "", 0, NULL, NULL},
{COMMANDKEY, "COMMAND", 0, "Command", ""},
-
+ {0, "", 0, NULL, NULL},
{ESCKEY, "ESC", 0, "Esc", ""},
{TABKEY, "TAB", 0, "Tab", ""},
{RETKEY, "RET", 0, "Return", ""},
@@ -165,8 +224,20 @@ EnumPropertyItem event_type_items[] = {
{PAGEUPKEY, "PAGE_UP", 0, "Page Up", ""},
{PAGEDOWNKEY, "PAGE_DOWN", 0, "Page Down", ""},
{ENDKEY, "END", 0, "End", ""},
+ {0, "", 0, NULL, NULL},
+ {TIMER, "TIMER", 0, "Timer", ""},
+ {TIMER0, "TIMER0", 0, "Timer 0", ""},
+ {TIMER1, "TIMER1", 0, "Timer 1", ""},
+ {TIMER2, "TIMER2", 0, "Timer 2", ""},
+ {TIMERJOBS, "JOBS_TIMER", 0, "Jobs Timer", ""},
{0, NULL, 0, NULL, NULL}};
+#define KMI_TYPE_KEYBOARD 0
+#define KMI_TYPE_MOUSE 1
+#define KMI_TYPE_TWEAK 2
+#define KMI_TYPE_TEXTINPUT 3
+#define KMI_TYPE_TIMER 4
+
#ifdef RNA_RUNTIME
#include "WM_api.h"
@@ -261,6 +332,156 @@ static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
}
}
+static PointerRNA rna_KeyMapItem_properties_get(PointerRNA *ptr)
+{
+ wmKeyMapItem *kmi= ptr->data;
+
+ if(kmi->ptr)
+ return *(kmi->ptr);
+
+ //return rna_pointer_inherit_refine(ptr, &RNA_OperatorProperties, op->properties);
+ return PointerRNA_NULL;
+}
+
+static int rna_wmKeyMapItem_map_type_get(PointerRNA *ptr)
+{
+ wmKeyMapItem *kmi= ptr->data;
+
+ if(ISTIMER(kmi->type)) return KMI_TYPE_TIMER;
+ if(ISKEYBOARD(kmi->type)) return KMI_TYPE_KEYBOARD;
+ if(ISTWEAK(kmi->type)) return KMI_TYPE_TWEAK;
+ if(ISMOUSE(kmi->type)) return KMI_TYPE_MOUSE;
+ if(kmi->type == KM_TEXTINPUT) return KMI_TYPE_TEXTINPUT;
+ return KMI_TYPE_KEYBOARD;
+}
+
+static void rna_wmKeyMapItem_map_type_set(PointerRNA *ptr, int value)
+{
+ wmKeyMapItem *kmi= ptr->data;
+ int map_type= rna_wmKeyMapItem_map_type_get(ptr);
+
+ if(value != map_type) {
+ switch(value) {
+ case KMI_TYPE_KEYBOARD:
+ kmi->type= AKEY;
+ kmi->val= KM_PRESS;
+ break;
+ case KMI_TYPE_TWEAK:
+ kmi->type= EVT_TWEAK_L;
+ kmi->val= KM_ANY;
+ break;
+ case KMI_TYPE_MOUSE:
+ kmi->type= LEFTMOUSE;
+ kmi->val= KM_PRESS;
+ break;
+ case KMI_TYPE_TEXTINPUT:
+ kmi->type= KM_TEXTINPUT;
+ kmi->val= KM_NOTHING;
+ break;
+ case KMI_TYPE_TIMER:
+ kmi->type= TIMER;
+ kmi->val= KM_NOTHING;
+ break;
+ }
+ }
+}
+
+static EnumPropertyItem *rna_KeyMapItem_type_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ int map_type= rna_wmKeyMapItem_map_type_get(ptr);
+
+ if(map_type == KMI_TYPE_MOUSE) return event_mouse_type_items;
+ if(map_type == KMI_TYPE_TWEAK) return event_tweak_type_items;
+ if(map_type == KMI_TYPE_TIMER) return event_timer_type_items;
+ else return event_type_items;
+}
+
+static EnumPropertyItem *rna_KeyMapItem_value_itemf(bContext *C, PointerRNA *ptr, int *free)
+{
+ int map_type= rna_wmKeyMapItem_map_type_get(ptr);
+
+ if(map_type == KMI_TYPE_MOUSE || map_type == KMI_TYPE_KEYBOARD) return event_keymouse_value_items;
+ if(map_type == KMI_TYPE_TWEAK) return event_tweak_value_items;
+ else return event_value_items;
+}
+
+static PointerRNA rna_WindowManager_active_keyconfig_get(PointerRNA *ptr)
+{
+ wmWindowManager *wm= ptr->data;
+ wmKeyConfig *kc;
+
+ for(kc=wm->keyconfigs.first; kc; kc=kc->next)
+ if(strcmp(kc->idname, U.keyconfigstr) == 0)
+ break;
+
+ if(!kc)
+ kc= wm->defaultconf;
+
+ return rna_pointer_inherit_refine(ptr, &RNA_KeyConfig, kc);
+}
+
+static void rna_WindowManager_active_keyconfig_set(PointerRNA *ptr, PointerRNA value)
+{
+ wmKeyConfig *kc= value.data;
+
+ if(kc)
+ BLI_strncpy(U.keyconfigstr, kc->idname, sizeof(U.keyconfigstr));
+}
+
+static PointerRNA rna_WindowManager_active_keymap_get(PointerRNA *ptr)
+{
+ wmWindowManager *wm= ptr->data;
+ wmKeyMap *km= NULL;
+
+ if(wm->defaultconf) {
+ km= BLI_findlink(&wm->defaultconf->keymaps, wm->defaultactmap);
+
+ if(!km)
+ km= wm->defaultconf->keymaps.first;
+ }
+
+ return rna_pointer_inherit_refine(ptr, &RNA_KeyMap, WM_keymap_active(wm, km));
+}
+
+static void rna_WindowManager_active_keymap_set(PointerRNA *ptr, PointerRNA value)
+{
+ wmWindowManager *wm= ptr->data;
+ wmKeyMap *km= value.data;
+ int index;
+
+ if(wm->defaultconf && km) {
+ km= WM_keymap_find(wm->defaultconf, km->idname, km->spaceid, km->regionid);
+ index= BLI_findindex(&wm->defaultconf->keymaps, km);
+
+ if(index != -1) wm->defaultactmap= index;
+ else wm->defaultactmap= 0;
+ }
+}
+
+static void rna_wmKeyMapItem_idname_get(PointerRNA *ptr, char *value)
+{
+ wmKeyMapItem *kmi= ptr->data;
+ WM_operator_py_idname(value, kmi->idname);
+}
+
+static int rna_wmKeyMapItem_idname_length(PointerRNA *ptr)
+{
+ wmKeyMapItem *kmi= ptr->data;
+ char pyname[OP_MAX_TYPENAME];
+
+ WM_operator_py_idname(pyname, kmi->idname);
+ return strlen(pyname);
+}
+
+static void rna_wmKeyMapItem_idname_set(PointerRNA *ptr, const char *value)
+{
+ wmKeyMapItem *kmi= ptr->data;
+ char idname[OP_MAX_TYPENAME];
+
+ WM_operator_bl_idname(idname, value);
+ BLI_strncpy(kmi->idname, idname, sizeof(kmi->idname));
+}
+
#else
static void rna_def_operator(BlenderRNA *brna)
@@ -278,7 +499,8 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_ui_text(prop, "Properties", "");
RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL);
@@ -404,7 +626,8 @@ static void rna_def_window(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Window", "Open window.");
RNA_def_struct_sdna(srna, "wmWindow");
- prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Screen");
RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window.");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -430,9 +653,154 @@ static void rna_def_windowmanager(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Window");
RNA_def_property_ui_text(prop, "Windows", "Open windows.");
+ prop= RNA_def_property(srna, "keyconfigs", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyConfig");
+ RNA_def_property_ui_text(prop, "Key Configurations", "Registered key configurations.");
+
+ prop= RNA_def_property(srna, "active_keyconfig", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "KeyConfig");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", 0);
+ RNA_def_property_ui_text(prop, "Active Key Configuration", "");
+
+ prop= RNA_def_property(srna, "default_keyconfig", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "defaultconf");
+ RNA_def_property_struct_type(prop, "KeyConfig");
+ RNA_def_property_ui_text(prop, "Default Key Configuration", "");
+
+ prop= RNA_def_property(srna, "active_keymap", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "KeyMap");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keymap_get", "rna_WindowManager_active_keymap_set", 0);
+ RNA_def_property_ui_text(prop, "Active Key Map", "");
+
RNA_api_wm(srna);
}
+static void rna_def_keyconfig(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ FunctionRNA *func;
+ PropertyRNA *prop, *parm;
+
+ static EnumPropertyItem map_type_items[] = {
+ {KMI_TYPE_KEYBOARD, "KEYBOARD", 0, "Keyboard", ""},
+ {KMI_TYPE_TWEAK, "TWEAK", 0, "Tweak", ""},
+ {KMI_TYPE_MOUSE, "MOUSE", 0, "Mouse", ""},
+ {KMI_TYPE_TEXTINPUT, "TEXTINPUT", 0, "Text Input", ""},
+ {KMI_TYPE_TIMER, "TIMER", 0, "Timer", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+ /* KeyConfig */
+ srna= RNA_def_struct(brna, "KeyConfig", NULL);
+ RNA_def_struct_sdna(srna, "wmKeyConfig");
+ RNA_def_struct_ui_text(srna, "Key Configuration", "Input configuration, including keymaps.");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "idname");
+ RNA_def_property_ui_text(prop, "Name", "Name of the key configuration.");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "keymaps", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyMap");
+ RNA_def_property_ui_text(prop, "Key Maps", "Key maps configured as part of this configuration.");
+
+ RNA_api_keyconfig(srna);
+
+ /* KeyMap */
+ srna= RNA_def_struct(brna, "KeyMap", NULL);
+ RNA_def_struct_sdna(srna, "wmKeyMap");
+ RNA_def_struct_ui_text(srna, "Key Map", "Input configuration, including keymaps.");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "idname");
+ RNA_def_property_ui_text(prop, "Name", "Name of the key map.");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "spaceid");
+ RNA_def_property_enum_items(prop, space_type_items);
+ RNA_def_property_ui_text(prop, "Space Type", "Optional space type keymap is associated with.");
+
+ prop= RNA_def_property(srna, "region_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "regionid");
+ RNA_def_property_enum_items(prop, region_type_items);
+ RNA_def_property_ui_text(prop, "Region Type", "Optional region type keymap is associated with.");
+
+ prop= RNA_def_property(srna, "items", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "KeyMapItem");
+ RNA_def_property_ui_text(prop, "Items", "Items in the keymap, linking an operator to an input event.");
+
+ prop= RNA_def_property(srna, "user_defined", PROP_BOOLEAN, PROP_NEVER_NULL);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_USER);
+ RNA_def_property_ui_text(prop, "User Defined", "Keymap is defined by the user.");
+
+ RNA_api_keymap(srna);
+
+ /* KeyMapItem */
+ srna= RNA_def_struct(brna, "KeyMapItem", NULL);
+ RNA_def_struct_sdna(srna, "wmKeyMapItem");
+ RNA_def_struct_ui_text(srna, "Key Map Item", "Item in a Key Map.");
+
+ prop= RNA_def_property(srna, "idname", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "idname");
+ RNA_def_property_ui_text(prop, "Identifier", "Identifier of operator to call on input event.");
+ RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_idname_get", "rna_wmKeyMapItem_idname_length", "rna_wmKeyMapItem_idname_set");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "OperatorProperties");
+ RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Properties", "Properties to set when the operator is called.");
+
+ prop= RNA_def_property(srna, "map_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "maptype");
+ RNA_def_property_enum_items(prop, map_type_items);
+ RNA_def_property_enum_funcs(prop, "rna_wmKeyMapItem_map_type_get", "rna_wmKeyMapItem_map_type_set", NULL);
+ RNA_def_property_ui_text(prop, "Map Type", "Type of event mapping.");
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_KeyMapItem_type_itemf");
+ RNA_def_property_ui_text(prop, "Type", "Type of event.");
+
+ prop= RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "val");
+ RNA_def_property_enum_items(prop, event_value_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_KeyMapItem_value_itemf");
+ RNA_def_property_ui_text(prop, "Value", "");
+
+ prop= RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "shift", 0);
+ RNA_def_property_ui_text(prop, "Shift", "Shift key pressed.");
+
+ prop= RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 0);
+ RNA_def_property_ui_text(prop, "Ctrl", "Control key pressed.");
+
+ prop= RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "alt", 0);
+ RNA_def_property_ui_text(prop, "Alt", "Alt key pressed.");
+
+ prop= RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "oskey", 0);
+ RNA_def_property_ui_text(prop, "OS Key", "Operating system key pressed.");
+
+ prop= RNA_def_property(srna, "key_modifier", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "keymodifier");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_ui_text(prop, "Key Modifier", "Regular key pressed as a modifier.");
+
+ prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_EXPANDED);
+ RNA_def_property_ui_text(prop, "Expanded", "Expanded in the user interface.");
+
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", KMI_INACTIVE);
+ RNA_def_property_ui_text(prop, "Active", "Activate or deactivate item.");
+}
+
void RNA_def_wm(BlenderRNA *brna)
{
rna_def_operator(brna);
@@ -441,6 +809,7 @@ void RNA_def_wm(BlenderRNA *brna)
rna_def_event(brna);
rna_def_window(brna);
rna_def_windowmanager(brna);
+ rna_def_keyconfig(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 5bf7999d67f..1a5568cb4f4 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -31,25 +31,93 @@
#include "RNA_define.h"
#include "RNA_types.h"
+#include "RNA_enum_types.h"
+
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
#ifdef RNA_RUNTIME
#include "BKE_context.h"
#include "WM_api.h"
+#include "WM_types.h"
+
+static wmKeyMapItem *rna_KeyMap_add_item(wmKeyMap *km, char *idname, int type, int value, int shift, int ctrl, int alt, int oskey, int keymodifier)
+{
+ int modifier= 0;
+
+ if(shift) modifier |= KM_SHIFT;
+ if(ctrl) modifier |= KM_CTRL;
+ if(alt) modifier |= KM_ALT;
+ if(oskey) modifier |= KM_OSKEY;
+
+ return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier);
+}
#else
void RNA_api_wm(StructRNA *srna)
{
FunctionRNA *func;
- PropertyRNA *prop;
+ PropertyRNA *parm;
func= RNA_def_function(srna, "add_fileselect", "WM_event_add_fileselect");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Show up the file selector.");
- prop= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call.");
- RNA_def_property_flag(prop, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "add_keyconfig", "WM_keyconfig_add");
+ parm= RNA_def_string(func, "name", "", 0, "Name", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration.");
+ RNA_def_function_return(func, parm);
+}
+
+void RNA_api_keyconfig(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "add_keymap", "WM_keymap_find");
+ parm= RNA_def_string(func, "name", "", 0, "Name", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
+ RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
+ parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map.");
+ RNA_def_function_return(func, parm);
+}
+
+void RNA_api_keymap(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "add_item", "rna_KeyMap_add_item");
+ parm= RNA_def_string(func, "idname", "", 0, "Operator Identifier", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_boolean(func, "shift", 0, "Shift", "");
+ RNA_def_boolean(func, "ctrl", 0, "Ctrl", "");
+ RNA_def_boolean(func, "alt", 0, "Alt", "");
+ RNA_def_boolean(func, "oskey", 0, "OS Key", "");
+ RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
+ parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "remove_item", "WM_keymap_remove_item");
+ parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func= RNA_def_function(srna, "copy_to_user", "WM_keymap_copy_to_user");
+ parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "User editable key map.");
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default");
}
#endif
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index d2eebbc61aa..c0c9c1d6568 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -34,14 +34,17 @@
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
-#include "WM_types.h"
-
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
+#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_texture.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
static PointerRNA rna_World_ambient_occlusion_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_WorldAmbientOcclusion, ptr->id.data);
@@ -68,31 +71,31 @@ static PointerRNA rna_World_active_texture_get(PointerRNA *ptr)
World *wo= (World*)ptr->data;
Tex *tex;
- tex= (wo->mtex[(int)wo->texact])? wo->mtex[(int)wo->texact]->tex: NULL;
+ tex= give_current_world_texture(wo);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
}
static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
World *wo= (World*)ptr->data;
- int act= wo->texact;
-
- if(wo->mtex[act] && wo->mtex[act]->tex)
- id_us_min(&wo->mtex[act]->tex->id);
-
- if(value.data) {
- if(!wo->mtex[act]) {
- wo->mtex[act]= add_mtex();
- wo->mtex[act]->texco= TEXCO_VIEW;
- }
-
- wo->mtex[act]->tex= value.data;
- id_us_plus(&wo->mtex[act]->tex->id);
- }
- else if(wo->mtex[act]) {
- MEM_freeN(wo->mtex[act]);
- wo->mtex[act]= NULL;
- }
+
+ set_current_world_texture(wo, value.data);
+}
+
+static void rna_World_update(bContext *C, PointerRNA *ptr)
+{
+ World *wo= ptr->id.data;
+
+ DAG_id_flush_update(&wo->id, 0);
+ WM_event_add_notifier(C, NC_WORLD, wo);
+}
+
+static void rna_World_draw_update(bContext *C, PointerRNA *ptr)
+{
+ World *wo= ptr->id.data;
+
+ DAG_id_flush_update(&wo->id, 0);
+ WM_event_add_notifier(C, NC_WORLD|ND_WORLD_DRAW, wo);
}
#else
@@ -119,22 +122,22 @@ static void rna_def_world_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "map_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_zenith_up", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "map_zenith_down", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* unused
prop= RNA_def_property(srna, "map_mist", PROP_BOOLEAN, PROP_NONE);
@@ -145,38 +148,38 @@ static void rna_def_world_mtex(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, texco_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "varfac");
+ RNA_def_property_float_sdna(prop, NULL, "blendfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "zenupfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "colfac");
+ RNA_def_property_float_sdna(prop, NULL, "zendownfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below.");
- RNA_def_property_update(prop, NC_TEXTURE, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_ambient_occlusion(BlenderRNA *brna)
@@ -215,83 +218,100 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
RNA_def_property_ui_text(prop, "Enabled", "Use Ambient Occlusion to add light based on distance between elements, creating the illusion of omnipresent light");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "aodist");
RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aodistfac");
RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aoenergy");
RNA_def_property_ui_range(prop, 0, 10, 0.1, 3);
RNA_def_property_ui_text(prop, "Energy", "Amount of enerygy generated by ambient occlusion.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aobias");
RNA_def_property_range(prop, 0, 0.5);
RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_error");
RNA_def_property_range(prop, 0.0001, 10);
RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST);
RNA_def_property_ui_text(prop, "Falloff", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "pixel_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE);
RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighbouring pixels for speedup (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "aosamp");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aomix");
RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aocolor");
RNA_def_property_enum_items(prop, prop_color_items);
RNA_def_property_ui_text(prop, "Color", "Defines the color of the AO light");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method");
RNA_def_property_enum_items(prop, prop_sample_method_items);
RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method");
RNA_def_property_enum_items(prop, prop_gather_method_items);
RNA_def_property_ui_text(prop, "Gather Method", "");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion (for Approximate).");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_mist(BlenderRNA *brna)
@@ -313,35 +333,39 @@ static void rna_def_world_mist(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST);
RNA_def_property_ui_text(prop, "Enabled", "Occlude objects with the environment color as they are further away.");
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "misi");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist effect.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "miststa");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "misthi");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mistype");
RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist");
+ RNA_def_property_update(prop, 0, "rna_World_update");
}
static void rna_def_world_stars(BlenderRNA *brna)
@@ -357,37 +381,38 @@ static void rna_def_world_stars(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
RNA_def_property_ui_text(prop, "Enabled", "Enable starfield generation.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starsize");
RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starmindist");
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stardist");
RNA_def_property_range(prop, 2, 1000);
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color_randomization", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starcolnoise");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* unused
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "starr");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Color", "Stars color.");*/
+ RNA_def_property_ui_text(prop, "Color", "Stars color.");
+ RNA_def_property_update(prop, 0, "rna_World_update");*/
}
void RNA_def_world(BlenderRNA *brna)
@@ -412,66 +437,71 @@ void RNA_def_world(BlenderRNA *brna)
rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_World_mtex_begin", "rna_World_active_texture_get",
- "rna_World_active_texture_set", "WorldTextureSlot");
+ "rna_World_active_texture_set", "WorldTextureSlot", "rna_World_update");
/* colors */
prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "horr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "zenr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "ambr");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Ambient Color", "");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* exp, range */
prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "exp");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.2, 5.0);
RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1.");
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* sky type */
prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle.");
- RNA_def_property_update(prop, NC_WORLD, NULL);
+ RNA_def_property_update(prop, 0, "rna_World_update");
/* nested structs */
- prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldAmbientOcclusion");
RNA_def_property_pointer_funcs(prop, "rna_World_ambient_occlusion_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Ambient Occlusion", "World ambient occlusion settings.");
- prop= RNA_def_property(srna, "mist", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "mist", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldMistSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Mist", "World mist settings.");
- prop= RNA_def_property(srna, "stars", PROP_POINTER, PROP_NEVER_NULL);
+ prop= RNA_def_property(srna, "stars", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldStarsSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Stars", "World stars settings.");