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:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-29 21:42:53 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-07-29 21:42:53 +0400
commit287b24926fefe078e4baae45808a5453b5c731bc (patch)
treee2336456d73c8b4bb5b9dad80cb475d5ea9c38d5 /source/blender/makesrna
parente382a373f5c26be3279ce91b119cce1b24bec388 (diff)
parentb948459031dd6d0f1ccc81d607a589fd7d1e8ab2 (diff)
merge with trunk r38787
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt12
-rw-r--r--source/blender/makesrna/intern/SConscript3
-rw-r--r--source/blender/makesrna/intern/rna_access.c6
-rw-r--r--source/blender/makesrna/intern/rna_image.c5
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c5
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c60
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c4
-rw-r--r--source/blender/makesrna/intern/rna_scene.c8
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c1
-rw-r--r--source/blender/makesrna/intern/rna_wm.c2
12 files changed, 96 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 09fb11282f9..be58daa1ac4 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -172,17 +172,25 @@ if(WITH_IMAGE_HDR)
add_definitions(-DWITH_HDR)
endif()
+if(WITH_IMAGE_FRAMESERVER)
+ add_definitions(-DWITH_FRAMESERVER)
+endif()
+
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
endif()
if(WITH_CODEC_QUICKTIME)
- list(APPEND INC ../../quicktime)
+ list(APPEND INC
+ ../../quicktime
+ )
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_CODEC_FFMPEG)
- list(APPEND INC_SYS ${FFMPEG_INCLUDE_DIRS})
+ list(APPEND INC_SYS
+ ${FFMPEG_INCLUDE_DIRS}
+ )
add_definitions(-DWITH_FFMPEG)
endif()
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index 421c3a60691..160aeca4a51 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -12,6 +12,7 @@ root_build_dir=normpath(env['BF_BUILDDIR'])
source_files = env.Glob('*.c')
source_files.remove('rna_access.c')
+source_files.append('../../blenfont/intern/blf_gettext.c')
generated_files = source_files[:]
generated_files.remove('rna_define.c')
@@ -54,6 +55,8 @@ if env['WITH_BF_CINEON']:
if env['WITH_BF_HDR']:
defs.append('WITH_HDR')
+defs.append('WITH_FRAMESERVER') # TODO, make optional
+
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
incs += ' ' + env['BF_FFMPEG_INC']
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index efa7306124a..b6f38332a3b 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4488,15 +4488,15 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE
if(!(parm->flag & PROP_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) {
switch(parm->type) {
case PROP_BOOLEAN:
- if(parm->arraydimension) memcpy(data, &((BooleanPropertyRNA*)parm)->defaultarray, size);
+ if(parm->arraydimension) memcpy(data, ((BooleanPropertyRNA*)parm)->defaultarray, size);
else memcpy(data, &((BooleanPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_INT:
- if(parm->arraydimension) memcpy(data, &((IntPropertyRNA*)parm)->defaultarray, size);
+ if(parm->arraydimension) memcpy(data, ((IntPropertyRNA*)parm)->defaultarray, size);
else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_FLOAT:
- if(parm->arraydimension) memcpy(data, &((FloatPropertyRNA*)parm)->defaultarray, size);
+ if(parm->arraydimension) memcpy(data, ((FloatPropertyRNA*)parm)->defaultarray, size);
else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size);
break;
case PROP_ENUM:
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index a52849b3366..eac4932ac43 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -502,6 +502,11 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
+ prop= RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT);
+ RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer");
+ 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);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index d2c1b862fee..ba655915fb6 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -805,6 +805,11 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", eMultiresModifierFlag_PlainUv);
+ RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_lattice(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 61d6a93d147..e2794baad34 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -484,7 +484,7 @@ static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr)
static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
- return MAX2(ob->actdef-1, 0);
+ return ob->actdef-1;
}
static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value)
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index d6af04f2475..21fa28af01a 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -45,6 +45,8 @@
// #include "ED_mesh.h"
+#include "BLI_math.h"
+
#ifdef RNA_RUNTIME
#include "BKE_main.h"
@@ -64,8 +66,6 @@
#include "BKE_mball.h"
#include "BKE_modifier.h"
-#include "BLI_math.h"
-
#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
#include "DNA_meshdata_types.h"
@@ -415,6 +415,41 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
*index= -1;
}
+void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float point_co[3], float max_dist, float n_location[3], float n_normal[3], int *index)
+{
+ BVHTreeFromMesh treeData= {NULL};
+
+ if(ob->derivedFinal==NULL) {
+ BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point.", ob->id.name+2);
+ return;
+ }
+
+ /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
+ bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
+
+ if(treeData.tree==NULL) {
+ BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point", ob->id.name+2);
+ return;
+ }
+ else {
+ BVHTreeNearest nearest;
+
+ nearest.index = -1;
+ nearest.dist = max_dist * max_dist;
+
+ if(BLI_bvhtree_find_nearest(treeData.tree, point_co, &nearest, treeData.nearest_callback, &treeData) != -1) {
+ copy_v3_v3(n_location, nearest.co);
+ copy_v3_v3(n_normal, nearest.no);
+ *index= nearest.index;
+ return;
+ }
+ }
+
+ zero_v3(n_location);
+ zero_v3(n_normal);
+ *index= -1;
+}
+
/* ObjectBase */
void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
@@ -501,6 +536,27 @@ void RNA_api_object(StructRNA *srna)
parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found.", 0, 0);
RNA_def_function_output(func, parm);
+ /* Nearest Point */
+ func= RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh");
+ RNA_def_function_ui_description(func, "Find the nearest point on the object.");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+
+ /* location of point for test and max distance */
+ parm= RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_float(func, "max_dist", sqrt(FLT_MAX), 0.0, FLT_MAX, "", "", 0.0, FLT_MAX);
+
+ /* return location and normal */
+ parm= RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
+ parm= RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the closest point", -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
+
+ parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found.", 0, 0);
+ RNA_def_function_output(func, parm);
+
/* View */
func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
RNA_def_function_ui_description(func, "Determine if object is visible in a given scene.");
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 3ff42e752af..9714b51a986 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -30,9 +30,11 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "BLF_api.h"
+
#include "rna_internal.h"
+#include "BLF_api.h"
+
#include "DNA_cloth_types.h"
#include "DNA_object_types.h"
#include "DNA_object_force.h"
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index adad1948032..7508b84a0d0 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -136,7 +136,9 @@ EnumPropertyItem image_type_items[] = {
#endif
{R_AVIJPEG, "AVI_JPEG", ICON_FILE_MOVIE, "AVI JPEG", "Output video in AVI JPEG format"},
{R_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
+#ifdef WITH_FRAMESERVER
{R_FRAMESERVER, "FRAMESERVER", ICON_FILE_SCRIPT, "Frame Server", "Output image to a frameserver"},
+#endif
#ifdef WITH_FFMPEG
{R_H264, "H264", ICON_FILE_MOVIE, "H.264", "Output video in H.264 format"},
{R_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "MPEG", "Output video in MPEG format"},
@@ -1177,9 +1179,9 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
- prop= RNA_def_property(srna, "use_snap_project_self", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT_NO_SELF);
- RNA_def_property_ui_text(prop, "Project to Self", "Project into its self (editmode)");
+ prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
+ RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 833f45ec4cc..68da28788de 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -702,7 +702,7 @@ static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *m
ConsoleLine *ci= (ConsoleLine*)ptr->data;
*min= 0;
- *max= ci->len;
+ *max= ci->len; /* intentionally _not_ -1 */
}
/* Space Dopesheet */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index ff9adfbab0d..3e2feec71d9 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2464,6 +2464,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{23, "GREEK", 0, N_("Greek (Ελληνικά)"), "el_GR"},
{24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"},
{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");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 0171576b52e..3db4d319420 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -942,7 +942,7 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
rna_Operator_unregister(bmain, ot->ext.srna);
}
- /* create a new menu type */
+ /* create a new operator type */
dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator");
RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */
dummyot.ext.data= data;