2008-10-31 23:50:02 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* 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).
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
#include "RNA_types.h"
|
|
|
|
|
|
2008-11-07 02:58:25 +00:00
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
2009-01-01 20:44:40 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
2009-01-08 13:57:29 +00:00
|
|
|
#include "BKE_context.h"
|
2008-10-31 23:50:02 +00:00
|
|
|
#include "BKE_global.h"
|
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
|
2008-10-31 23:50:02 +00:00
|
|
|
{
|
2008-11-17 18:44:06 +00:00
|
|
|
ListBaseIterator *internal= iter->internal;
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
/* we are actually iterating a Base list, so override get */
|
2009-02-02 19:57:57 +00:00
|
|
|
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object);
|
2008-10-31 23:50:02 +00:00
|
|
|
}
|
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static void rna_Scene_layer_set(PointerRNA *ptr, const int *values)
|
2008-11-14 11:15:53 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene= (Scene*)ptr->data;
|
2009-02-03 10:14:29 +00:00
|
|
|
int i, tot= 0;
|
2008-11-14 11:15:53 +00:00
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
/* ensure we always have some layer selected */
|
|
|
|
|
for(i=0; i<20; i++)
|
|
|
|
|
if(values[i])
|
|
|
|
|
tot++;
|
|
|
|
|
|
|
|
|
|
if(tot==0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for(i=0; i<20; i++) {
|
|
|
|
|
if(values[i]) scene->lay |= (1<<i);
|
|
|
|
|
else scene->lay &= ~(1<<i);
|
2008-11-14 11:15:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-26 23:13:59 +00:00
|
|
|
static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
|
|
|
|
Scene *data= (Scene*)ptr->data;
|
|
|
|
|
CLAMP(value, 1, data->r.efra);
|
|
|
|
|
data->r.sfra= value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
|
|
|
|
Scene *data= (Scene*)ptr->data;
|
2008-12-11 10:36:40 +00:00
|
|
|
CLAMP(value, data->r.sfra, MAXFRAME);
|
2008-11-26 23:13:59 +00:00
|
|
|
data->r.efra= value;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-01 20:44:40 +00:00
|
|
|
static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
//Scene *scene= ptr->id.data;
|
|
|
|
|
//update_for_newframe();
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
#else
|
|
|
|
|
|
2009-01-17 16:58:05 +00:00
|
|
|
void rna_def_sculpt(BlenderRNA *brna)
|
2009-01-15 02:36:24 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2009-01-17 16:58:05 +00:00
|
|
|
srna= RNA_def_struct(brna, "Sculpt", NULL);
|
2009-01-15 02:36:24 +00:00
|
|
|
RNA_def_struct_nested(brna, srna, "Scene");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Sculpt", "");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis.");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "symmetry_y", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis.");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "symmetry_z", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis.");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices.");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices.");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices.");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_BRUSH);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Show Brush", "");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "partial_redraw", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_FAST);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Partial Redraw", "Optimize sculpting by only refreshing modified faces.");
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-17 16:58:05 +00:00
|
|
|
void rna_def_tool_settings(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
srna= RNA_def_struct(brna, "ToolSettings", NULL);
|
|
|
|
|
RNA_def_struct_nested(brna, srna, "Scene");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Tool Settings", "");
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_struct_type(prop, "Sculpt");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Sculpt", "");
|
2009-01-18 11:05:56 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "vpaint", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_struct_type(prop, "VPaint");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Vertex Paint", "");
|
2009-01-17 16:58:05 +00:00
|
|
|
|
|
|
|
|
rna_def_sculpt(brna);
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-31 23:50:02 +00:00
|
|
|
void RNA_def_scene(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2008-11-24 12:12:24 +00:00
|
|
|
static EnumPropertyItem prop_mode_items[] ={
|
|
|
|
|
{PROP_SMOOTH, "SMOOTH", "Smooth", ""},
|
|
|
|
|
{PROP_SPHERE, "SPHERE", "Sphere", ""},
|
|
|
|
|
{PROP_ROOT, "ROOT", "Root", ""},
|
|
|
|
|
{PROP_SHARP, "SHARP", "Sharp", ""},
|
|
|
|
|
{PROP_LIN, "LINEAR", "Linear", ""},
|
|
|
|
|
{PROP_CONST, "CONSTANT", "Constant", ""},
|
|
|
|
|
{PROP_RANDOM, "RANDOM", "Random", ""},
|
|
|
|
|
{0, NULL, NULL, NULL}};
|
|
|
|
|
static EnumPropertyItem unwrapper_items[] = {
|
|
|
|
|
{0, "CONFORMAL", "Conformal", ""},
|
|
|
|
|
{1, "ANGLEBASED", "Angle Based", ""},
|
|
|
|
|
{0, NULL, NULL, NULL}};
|
2009-01-15 02:36:24 +00:00
|
|
|
|
2008-12-19 04:06:24 +00:00
|
|
|
srna= RNA_def_struct(brna, "Scene", "ID");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings.");
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Active Camera", "Active camera used for rendering the scene.");
|
|
|
|
|
|
2009-01-01 20:44:40 +00:00
|
|
|
prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_VECTOR);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "cursor");
|
2008-10-31 23:50:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
|
|
|
|
|
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
|
|
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
|
2008-11-07 02:58:25 +00:00
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
|
2008-10-31 23:50:02 +00:00
|
|
|
RNA_def_property_struct_type(prop, "Object");
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Objects", "");
|
2009-02-02 19:57:57 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2009-01-01 20:44:40 +00:00
|
|
|
prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE);
|
2008-10-31 23:50:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
|
|
|
|
|
RNA_def_property_array(prop, 20);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
|
2008-11-14 11:15:53 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
|
2008-10-31 23:50:02 +00:00
|
|
|
|
2009-01-15 04:22:23 +00:00
|
|
|
prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE);
|
2009-01-01 20:44:40 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
|
2008-10-31 23:50:02 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_mode_items);
|
2009-01-15 04:22:23 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE);
|
2009-01-17 13:54:56 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NOT_ANIMATEABLE);
|
2008-10-31 23:50:02 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
|
|
|
|
|
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Current Frame", "");
|
2009-01-01 20:44:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
|
2008-11-26 23:13:59 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
|
2009-01-17 13:54:56 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NOT_ANIMATEABLE);
|
2008-11-26 23:13:59 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "r.sfra");
|
|
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Start Frame", "");
|
2009-01-01 20:44:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
|
2008-11-26 23:13:59 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
|
2009-01-17 13:54:56 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NOT_ANIMATEABLE);
|
2008-11-26 23:13:59 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "r.efra");
|
|
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "End Frame", "");
|
2009-01-01 20:44:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
|
|
|
|
|
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
|
2009-01-01 20:44:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
|
2008-10-31 23:50:02 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "unwrapper", PROP_ENUM, PROP_NONE);
|
2008-12-03 20:17:12 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper");
|
2008-10-31 23:50:02 +00:00
|
|
|
RNA_def_property_enum_items(prop, unwrapper_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Unwrapper", "Unwrap algorithm used by the Unwrap tool.");
|
2008-11-27 00:23:22 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
|
2008-12-15 10:48:04 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "ed");
|
|
|
|
|
RNA_def_property_struct_type(prop, "SequenceEditor");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Sequence Editor", "");
|
2008-11-30 15:55:14 +00:00
|
|
|
|
|
|
|
|
prop= RNA_def_property(srna, "radiosity", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "radio");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Radiosity", "");
|
2009-01-15 02:36:24 +00:00
|
|
|
|
2009-01-17 16:58:05 +00:00
|
|
|
prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
|
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
|
|
|
|
|
RNA_def_property_struct_type(prop, "ToolSettings");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Tool Settings", "");
|
2009-01-15 02:36:24 +00:00
|
|
|
|
2009-01-17 16:58:05 +00:00
|
|
|
rna_def_tool_settings(brna);
|
2008-10-31 23:50:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|