Exemple #1
0
static void rna_def_render_slots(BlenderRNA *brna, PropertyRNA *cprop)
{
  StructRNA *srna;
  FunctionRNA *func;
  PropertyRNA *prop, *parm;

  RNA_def_property_srna(cprop, "RenderSlots");
  srna = RNA_def_struct(brna, "RenderSlots", NULL);
  RNA_def_struct_sdna(srna, "Image");
  RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");

  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_sdna(prop, NULL, "render_slot");
  RNA_def_property_int_funcs(prop,
                             "rna_render_slots_active_index_get",
                             "rna_render_slots_active_index_set",
                             "rna_render_slots_active_index_range");
  RNA_def_property_ui_text(prop, "Active", "Active render slot of the image");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
  RNA_def_property_struct_type(prop, "RenderSlot");
  RNA_def_property_pointer_funcs(
      prop, "rna_render_slots_active_get", "rna_render_slots_active_set", NULL, NULL);
  RNA_def_property_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Active", "Active render slot of the image");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  func = RNA_def_function(srna, "new", "BKE_image_add_renderslot");
  RNA_def_function_ui_description(func, "Add a render slot to the image");
  parm = RNA_def_string(func, "name", NULL, 0, "Name", "New name for the render slot");
  parm = RNA_def_pointer(func, "result", "RenderSlot", "", "Newly created render layer");
  RNA_def_function_return(func, parm);
}
static void rna_def_render_slots(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	srna = RNA_def_struct(brna, "RenderSlots", NULL);
	RNA_def_struct_sdna(srna, "RenderSlot");
	RNA_def_struct_ui_text(srna, "Render Slots", "Collection of the render slots");

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "RenderSlot");
	RNA_def_property_pointer_funcs(prop, "rna_render_slots_active_get", "rna_render_slots_active_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
	RNA_def_property_ui_text(prop, "Active", "Active render slot of the image");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
	RNA_def_property_int_funcs(prop, "rna_render_slots_active_index_get",
	                           "rna_render_slots_active_index_set",
	                           NULL);
	RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_ui_text(prop, "Active Index", "Index of an active render slot of the image");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
}
static void rna_def_mask(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	rna_def_mask_layer(brna);

	srna = RNA_def_struct(brna, "Mask", "ID");
	RNA_def_struct_ui_text(srna, "Mask", "Mask datablock defining mask for compositing");
	RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);

	/* mask layers */
	prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_funcs(prop, "rna_Mask_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
	RNA_def_property_struct_type(prop, "MaskLayer");
	RNA_def_property_ui_text(prop, "Layers", "Collection of layers which defines this mask");
	rna_def_masklayers(brna, prop);

	/* active masklay index */
	prop = RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "masklay_act");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_funcs(prop, "rna_Mask_layer_active_index_get", "rna_Mask_layer_active_index_set", "rna_Mask_layer_active_index_range");
	RNA_def_property_ui_text(prop, "Active Shape Index", "Index of active layer in list of all mask's layers");
	RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);

	/* frame range */
	prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_sdna(prop, NULL, "sfra");
	RNA_def_property_int_funcs(prop, NULL, "rna_Mask_start_frame_set", NULL);
	RNA_def_property_range(prop, MINFRAME, MAXFRAME);
	RNA_def_property_ui_text(prop, "Start Frame", "First frame of the mask (used for sequencer)");
	RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);

	prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_sdna(prop, NULL, "efra");
	RNA_def_property_int_funcs(prop, NULL, "rna_Mask_end_frame_set", NULL);
	RNA_def_property_range(prop, MINFRAME, MAXFRAME);
	RNA_def_property_ui_text(prop, "End Frame", "Final frame of the mask (used for sequencer)");
	RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);

	/* pointers */
	rna_def_animdata_common(srna);
}
Exemple #4
0
static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
{
	PropertyRNA *prop;

	/* the itemf func is used instead, keep blender happy */
	static EnumPropertyItem default_dummy_items[] = {
		{PROP_NONE, "DUMMY", 0, "Dummy", ""},
		{0, NULL, 0, NULL, NULL}};

	prop= RNA_def_property(srna, "default", PROP_ENUM, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_enum_items(prop, default_dummy_items);
	RNA_def_property_enum_funcs(prop, "rna_EnumProperty_default_get", NULL, "rna_EnumProperty_default_itemf");
	RNA_def_property_ui_text(prop, "Default", "Default value for this enum");

	/* same 'default' but uses 'PROP_ENUM_FLAG' */
	prop= RNA_def_property(srna, "default_flag", PROP_ENUM, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_flag(prop, PROP_ENUM_FLAG);
	RNA_def_property_enum_items(prop, default_dummy_items);
	RNA_def_property_enum_funcs(prop, "rna_EnumProperty_default_get", NULL, "rna_EnumProperty_default_itemf");
	RNA_def_property_ui_text(prop, "Default", "Default value for this enum");

	prop= RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_struct_type(prop, "EnumPropertyItem");
	RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
	RNA_def_property_ui_text(prop, "Items", "Possible values for the property");

	srna= RNA_def_struct(brna, "EnumPropertyItem", NULL);
	RNA_def_struct_ui_text(srna, "Enum Item Definition", "Definition of a choice in an RNA enum property");
	RNA_def_struct_ui_icon(srna, ICON_RNA);

	prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL);
	RNA_def_property_ui_text(prop, "Name", "Human readable name");

	prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_description_get", "rna_EnumPropertyItem_description_length", NULL);
	RNA_def_property_ui_text(prop, "Description", "Description of the item's purpose");

	prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_identifier_get", "rna_EnumPropertyItem_identifier_length", NULL);
	RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting");
	RNA_def_struct_name_property(srna, prop);

	prop= RNA_def_property(srna, "value", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_int_funcs(prop, "rna_EnumPropertyItem_value_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Value", "Value of the item");
}
Exemple #5
0
static void rna_def_string_property(StructRNA *srna)
{
	PropertyRNA *prop;

	prop= RNA_def_property(srna, "default", PROP_STRING, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_string_funcs(prop, "rna_StringProperty_default_get", "rna_StringProperty_default_length", NULL);
	RNA_def_property_ui_text(prop, "Default", "string default value");

	prop= RNA_def_property(srna, "length_max", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_int_funcs(prop, "rna_StringProperty_max_length_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Maximum Length", "Maximum length of the string, 0 means unlimited");
}
Exemple #6
0
static void rna_def_boidstate(BlenderRNA *brna)
{
    StructRNA *srna;
    PropertyRNA *prop;

    srna = RNA_def_struct(brna, "BoidState", NULL);
    RNA_def_struct_ui_text(srna, "Boid State", "Boid state for boid physics");

    prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
    RNA_def_property_ui_text(prop, "Name", "Boid state name");
    RNA_def_struct_name_property(srna, prop);

    prop = RNA_def_property(srna, "ruleset_type", PROP_ENUM, PROP_NONE);
    RNA_def_property_enum_items(prop, boidruleset_type_items);
    RNA_def_property_ui_text(prop, "Rule Evaluation", "How the rules in the list are evaluated");

    prop = RNA_def_property(srna, "rules", PROP_COLLECTION, PROP_NONE);
    RNA_def_property_struct_type(prop, "BoidRule");
    RNA_def_property_ui_text(prop, "Boid Rules", "");

    prop = RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE);
    RNA_def_property_struct_type(prop, "BoidRule");
    RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL, NULL);
    RNA_def_property_ui_text(prop, "Active Boid Rule", "");

    prop = RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED);
    RNA_def_property_int_funcs(prop, "rna_BoidState_active_boid_rule_index_get",
                               "rna_BoidState_active_boid_rule_index_set",
                               "rna_BoidState_active_boid_rule_index_range");
    RNA_def_property_ui_text(prop, "Active Boid Rule Index", "");

    prop = RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "rule_fuzziness");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Rule Fuzziness", "");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Volume", "");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 10.0);
    RNA_def_property_ui_text(prop, "Falloff", "");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");
}
static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "GreasePencilLayers");
	srna = RNA_def_struct(brna, "GreasePencilLayers", NULL);
	RNA_def_struct_sdna(srna, "bGPdata");
	RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");

	func = RNA_def_function(srna, "new", "rna_GPencil_layer_new");
	RNA_def_function_ui_description(func, "Add a new grease pencil layer");
	parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	RNA_def_boolean(func, "set_active", 0, "Set Active", "Set the newly created layer to the active layer");
	parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
	RNA_def_function_ui_description(func, "Remove a grease pencil layer");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);

	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "GPencilLayer");
	RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL);
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer");
	
	prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
	
	RNA_def_property_int_funcs(prop,
	                           "rna_GPencil_active_layer_index_get", 
	                           "rna_GPencil_active_layer_index_set", 
	                           "rna_GPencil_active_layer_index_range");
	RNA_def_property_ui_text(prop, "Active Layer Index", "Index of active grease pencil layer");
}
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	PropertyRNA *parm;

	RNA_def_property_srna(cprop, "ActionPoseMarkers");
	srna = RNA_def_struct(brna, "ActionPoseMarkers", NULL);
	RNA_def_struct_sdna(srna, "bAction");
	RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers");

	func = RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
	RNA_def_function_ui_description(func, "Add a pose marker to the action");
	parm = RNA_def_string(func, "name", "Marker", 0, NULL, "New name for the marker (not unique)");
	RNA_def_property_flag(parm, PROP_REQUIRED);

	parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
	RNA_def_function_return(func, parm);

	func = RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
	RNA_def_function_ui_description(func, "Remove a timeline marker");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
	
	prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "TimelineMarker");
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_LIB_EXCEPTION);
	RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get",
	                               "rna_Action_active_pose_marker_set", NULL, NULL);
	RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this action");
	
	prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "active_marker");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	RNA_def_property_int_funcs(prop, "rna_Action_active_pose_marker_index_get",
	                           "rna_Action_active_pose_marker_index_set", "rna_Action_active_pose_marker_index_range");
	RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker");
}
Exemple #9
0
/* canvas.canvas_surfaces */
static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;
	PropertyRNA *prop;

	RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
	srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
	RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
	RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces");

	prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set", "rna_Surface_active_point_range");
	RNA_def_property_ui_text(prop, "Active Point Cache Index", "");

	prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "DynamicPaintSurface");
	RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL);
	RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed");
	RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
}
Exemple #10
0
void RNA_def_controller(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	static EnumPropertyItem python_controller_modes[] = {
		{CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""},
		{CONT_PY_MODULE, "MODULE", 0, "Module", ""},
		{0, NULL, 0, NULL, NULL}};

	/* Controller */
	srna = RNA_def_struct(brna, "Controller", NULL);
	RNA_def_struct_sdna(srna, "bController");
	RNA_def_struct_refine_func(srna, "rna_Controller_refine");
	RNA_def_struct_ui_text(srna, "Controller",
	                       "Game engine logic brick to process events, connecting sensors to actuators");

	RNA_api_controller(srna);

	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Name", "");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL);
	RNA_def_property_enum_items(prop, controller_type_items);
	RNA_def_property_ui_text(prop, "Type", "");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW);
	RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface");
	RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO);
	RNA_def_property_ui_text(prop, "Priority",
	                         "Mark controller for execution before all non-marked controllers "
	                         "(good for startup scripts)");
	RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
	RNA_def_property_struct_type(prop, "Actuator");
	RNA_def_property_ui_text(prop, "Actuators", "The list containing the actuators connected to the controller");
	RNA_def_property_collection_funcs(prop, "rna_Controller_actuators_begin", "rna_iterator_array_next",
	                                  "rna_iterator_array_end", "rna_iterator_array_dereference_get",
	                                  "rna_Controller_actuators_length", NULL, NULL, NULL);

	/* State */
	
	/* array of OB_MAX_STATES */
	/*prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); */
	/*RNA_def_property_array(prop, OB_MAX_STATES); */
	/*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
	/*RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); */
	/*RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set"); */
	/*RNA_def_property_update(prop, NC_LOGIC, NULL); */

	/* number of the state */
	prop = RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "state_mask");
	RNA_def_property_range(prop, 1, OB_MAX_STATES);
	RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
	RNA_def_property_int_funcs(prop, "rna_Controller_state_number_get", "rna_Controller_state_number_set", NULL);
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* Expression Controller */
	srna = RNA_def_struct(brna, "ExpressionController", "Controller");
	RNA_def_struct_sdna_from(srna, "bExpressionCont", "data");
	RNA_def_struct_ui_text(srna, "Expression Controller",
	                       "Controller passing on events based on the evaluation of an expression");

	prop = RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "str");
	RNA_def_property_ui_text(prop, "Expression", "");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* Python Controller */
	srna = RNA_def_struct(brna, "PythonController", "Controller" );
	RNA_def_struct_sdna_from(srna, "bPythonCont", "data");
	RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script");

	prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, python_controller_modes);
	RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL);
	RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "Text");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Module",
	                         "Module name and function to run, e.g. \"someModule.main\" "
	                         "(internal texts and external python files can be used)");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	prop = RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG);
	RNA_def_property_ui_text(prop, "D",
	                         "Continuously reload the module from disk for editing external modules "
	                         "without restarting");
	RNA_def_property_update(prop, NC_LOGIC, NULL);

	/* Other Controllers */
	srna = RNA_def_struct(brna, "AndController", "Controller");
	RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation");
	
	srna = RNA_def_struct(brna, "OrController", "Controller");
	RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation");
	
	srna = RNA_def_struct(brna, "NorController", "Controller");
	RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation");
	
	srna = RNA_def_struct(brna, "NandController", "Controller");
	RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation");
	
	srna = RNA_def_struct(brna, "XorController", "Controller");
	RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation");
	
	srna = RNA_def_struct(brna, "XnorController", "Controller");
	RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation");
}
Exemple #11
0
static void rna_def_animviz_paths(BlenderRNA *brna)
{
    StructRNA *srna;
    PropertyRNA *prop;

    static const EnumPropertyItem prop_type_items[]= {
        {MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame"},
        {MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"},
        {0, NULL, 0, NULL, NULL}
    };
    static const EnumPropertyItem prop_location_items[]= {
        {MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
        {0, "TAILS", 0, "Tails", "Calculate bone paths from tails"},
        {0, NULL, 0, NULL, NULL}
    };

    srna= RNA_def_struct(brna, "AnimVizMotionPaths", NULL);
    RNA_def_struct_sdna(srna, "bAnimVizSettings");
    RNA_def_struct_nested(brna, srna, "AnimViz");
    RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualisation");

    /* Enums */
    prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
    RNA_def_property_enum_sdna(prop, NULL, "path_type");
    RNA_def_property_enum_items(prop, prop_type_items);
    RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE);
    RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag");
    RNA_def_property_enum_items(prop, prop_location_items);
    RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    /* Settings */
    prop= RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS);
    RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS);
    RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS);
    RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT);
    RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
    RNA_def_property_int_sdna(prop, NULL, "path_step");
    RNA_def_property_range(prop, 1, 100);
    RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */


    /* Playback Ranges */
    prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "path_sf");
    RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_start_frame_set", NULL);
    RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "path_ef");
    RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_end_frame_set", NULL);
    RNA_def_property_ui_text(prop, "End Frame", "End frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    /* Around Current Ranges */
    prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "path_bc");
    RNA_def_property_range(prop, 1, MAXFRAMEF/2);
    RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "path_ac");
    RNA_def_property_range(prop, 1, MAXFRAMEF/2);
    RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
}
Exemple #12
0
static void rna_def_animviz_ghosts(BlenderRNA *brna)
{
    StructRNA *srna;
    PropertyRNA *prop;

    static const EnumPropertyItem prop_type_items[] = {
        {GHOST_TYPE_NONE, "NONE", 0, "No Ghosts", "Do not show any ghosts"},
        {GHOST_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Current Frame", "Show ghosts from around the current frame"},
        {GHOST_TYPE_RANGE, "RANGE", 0, "In Range", "Show ghosts for the specified frame range"},
        {GHOST_TYPE_KEYS, "KEYS", 0, "On Keyframes", "Show ghosts on keyframes"},
        {0, NULL, 0, NULL, NULL}
    };


    srna= RNA_def_struct(brna, "AnimVizOnionSkinning", NULL);
    RNA_def_struct_sdna(srna, "bAnimVizSettings");
    RNA_def_struct_nested(brna, srna, "AnimViz");
    RNA_def_struct_ui_text(srna, "Onion Skinning Settings", "Onion Skinning settings for animation visualisation");

    /* Enums */
    prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
    RNA_def_property_enum_sdna(prop, NULL, "ghost_type");
    RNA_def_property_enum_items(prop, prop_type_items);
    RNA_def_property_ui_text(prop, "Type", "Method used for determining what ghosts get drawn");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    /* Settings */
    prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL);
    RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
    RNA_def_property_int_sdna(prop, NULL, "ghost_step");
    RNA_def_property_range(prop, 1, 20);
    RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    /* Playback Ranges */
    prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "ghost_sf");
    RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_start_frame_set", NULL);
    RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "ghost_ef");
    RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_end_frame_set", NULL);
    RNA_def_property_ui_text(prop, "End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    /* Around Current Ranges */
    prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "ghost_bc");
    RNA_def_property_range(prop, 0, 30);
    RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */

    prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
    RNA_def_property_int_sdna(prop, NULL, "ghost_ac");
    RNA_def_property_range(prop, 0, 30);
    RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
    RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
}
Exemple #13
0
static void rna_def_image(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	static const EnumPropertyItem prop_type_items[]= {
		{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
		{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
		{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_generated_type_items[]= {
		{0, "BLANK", 0, "Blank", "Generate a blank image"},
		{1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
		{2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV 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, "Upper First", "Upper field first"},
		{IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field 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");
	RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);

	prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
	RNA_def_property_string_sdna(prop, NULL, "name");
	RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");

	/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
	prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
	RNA_def_property_string_sdna(prop, NULL, "name");
	RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");

	prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, image_type_items);
	RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
	RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");

	prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
	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, "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);
	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, "use_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, "rna_Image_fields_update");

	prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
	RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");

	prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");

	/* generated image (image_generated_change_cb) */
	prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
	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, "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, "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, "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");
	RNA_def_property_enum_items(prop, prop_mapping_items);
	RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
	RNA_def_property_float_sdna(prop, NULL, "aspx");
	RNA_def_property_array(prop, 2);
	RNA_def_property_range(prop, 0.1f, 5000.0f);
	RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
	RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");

	prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "twsta");
	RNA_def_property_range(prop, 0, 128);
	RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");

	prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "twend");
	RNA_def_property_range(prop, 0, 128);
	RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");

	prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "animspeed");
	RNA_def_property_range(prop, 1, 100);
	RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
	RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "xrep");
	RNA_def_property_range(prop, 1, 16);
	RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "yrep");
	RNA_def_property_range(prop, 1, 16);
	RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
	RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);

	prop= RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
	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);

	prop= RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "bindcode");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
	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_UNSIGNED);
	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);

	prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
	RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
	RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL);

	prop= RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");
	RNA_def_property_dynamic_array_funcs(prop, "rna_Image_pixels_get_length");
	RNA_def_property_float_funcs(prop, "rna_Image_pixels_get", "rna_Image_pixels_set", NULL);

	RNA_api_image(srna);
}
static void rna_def_armature(BlenderRNA *brna)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *prop;
	
	static EnumPropertyItem prop_drawtype_items[] = {
		{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 deformation influence volume"},
		{ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"},
		{0, NULL, 0, NULL, NULL}
	};
	static EnumPropertyItem prop_vdeformer[] = {
		{ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Use Blender's armature vertex deformation"},
		{ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Use vertex deformation code optimized for the BGE"},
		{0, NULL, 0, NULL, NULL}
	};
	static EnumPropertyItem prop_ghost_type_items[] = {
		{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_pose_position_items[] = {
		{0, "POSE", 0, "Pose Position", "Show armature in posed state"},
		{ARM_RESTPOS, "REST", 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");

	func = RNA_def_function(srna, "transform", "rna_Armature_transform");
	RNA_def_function_ui_description(func, "Transform armature bones by a matrix");
	prop = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
	RNA_def_property_flag(prop, PROP_REQUIRED);

	/* 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);
	RNA_def_property_collection_funcs(prop, NULL, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL);
	RNA_def_property_struct_type(prop, "Bone");
	RNA_def_property_ui_text(prop, "Bones", "");
	rna_def_armature_bones(brna, prop);

	prop = RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "edbo", NULL);
	RNA_def_property_struct_type(prop, "EditBone");
	RNA_def_property_ui_text(prop, "Edit Bones", "");
	rna_def_armature_edit_bones(brna, prop);

	/* Enum values */
	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");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "drawtype");
	RNA_def_property_enum_items(prop, prop_drawtype_items);
	RNA_def_property_ui_text(prop, "Draw Type", "");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);

	prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer");
	RNA_def_property_enum_items(prop, prop_vdeformer);
	RNA_def_property_ui_text(prop, "Vertex Deformer", "Vertex Deformer Method (Game Engine only)");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
/* XXX deprecated ....... old animviz for armatures only */
	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 Type", "Method of Onion-skinning for active Action");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* XXX deprecated ....... old animviz for armatures only	 */

	/* Boolean values */
	/* layer */
	prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
	RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
	RNA_def_property_array(prop, 32);
	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, "rna_Armature_update_layers");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	/* layer protection */
	prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER);
	RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
	RNA_def_property_array(prop, 32);
	RNA_def_property_ui_text(prop, "Layer Proxy Protection",
	                         "Protected layers in Proxy Instances are restored to Proxy settings "
	                         "on file reload and undo");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
		
	/* flag */
	prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
	RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
	RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM);
	RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode");
	RNA_def_property_update(prop, 0, "rna_Armature_update_data");
	
	prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT);
	RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK);
	RNA_def_property_ui_text(prop, "Auto IK", "Add temporary IK constraints while grabbing bones in Pose Mode");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "show_bone_custom_shapes", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM);
	RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	
	prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM);
	RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	
/* XXX deprecated ....... old animviz for armatures only */
	prop = RNA_def_property(srna, "show_only_ghost_selected", PROP_BOOLEAN, PROP_NONE);
	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");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* XXX deprecated ....... old animviz for armatures only */

	/* Number fields */
/* XXX deprecated ....... old animviz for armatures only */
	/* ghost/onionskining settings */
	prop = RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "ghostep");
	RNA_def_property_range(prop, 0, 30);
	RNA_def_property_ui_text(prop, "Ghosting Step",
	                         "Number of frame steps on either side of current frame to show as ghosts "
	                         "(only for 'Around Current Frame' Onion-skinning method)");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "ghostsize");
	RNA_def_property_range(prop, 1, 20);
	RNA_def_property_ui_text(prop, "Ghosting Frame Step",
	                         "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME);
	RNA_def_property_int_sdna(prop, NULL, "ghostsf");
	RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL);
	RNA_def_property_ui_text(prop, "Ghosting Start Frame",
	                         "Starting frame of range of Ghosts to display (not for "
	                         "'Around Current Frame' Onion-skinning method)");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
	
	prop = RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME);
	RNA_def_property_int_sdna(prop, NULL, "ghostef");
	RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL);
	RNA_def_property_ui_text(prop, "Ghosting End Frame",
	                         "End frame of range of Ghosts to display "
	                         "(not for 'Around Current Frame' Onion-skinning method)");
	RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
	RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* XXX deprecated ....... old animviz for armatures only */


	prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_Armature_is_editmode_get", NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Is Editmode", "True when used in editmode");
}
static void rna_def_gpencil_layer(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	FunctionRNA *func;
	
	srna = RNA_def_struct(brna, "GPencilLayer", NULL);
	RNA_def_struct_sdna(srna, "bGPDlayer");
	RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
	RNA_def_struct_path_func(srna, "rna_GPencilLayer_path");
	
	/* Name */
	prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
	RNA_def_property_ui_text(prop, "Info", "Layer name");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
	RNA_def_struct_name_property(srna, prop);
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	/* Frames */
	prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
	RNA_def_property_struct_type(prop, "GPencilFrame");
	RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
	rna_def_gpencil_frames_api(brna, prop);

	/* Active Frame */
	prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "actframe");
	RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
	RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);

	/* Draw Style */
	// TODO: replace these with a "draw type" combo (i.e. strokes only, filled strokes, strokes + fills, volumetric)?
	prop = RNA_def_property(srna, "use_volumetric_strokes", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_VOLUMETRIC);
	RNA_def_property_ui_text(prop, "Volumetric Strokes", "Draw strokes as a series of circular blobs, resulting in a volumetric effect");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Stroke Drawing Color */
	prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "color[3]");
	RNA_def_property_range(prop, 0.0, 1.0f);
	RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Fill Drawing Color */
	prop = RNA_def_property(srna, "fill_color", PROP_FLOAT, PROP_COLOR_GAMMA);
	RNA_def_property_float_sdna(prop, NULL, "fill");
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Fill Color", "Color for filling region bounded by each stroke");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "fill_alpha", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "fill[3]");
	RNA_def_property_range(prop, 0.0, 1.0f);
	RNA_def_property_ui_text(prop, "Fill Opacity", "Opacity for filling region bounded by each stroke");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Line Thickness */
	prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_PIXEL);
	RNA_def_property_int_sdna(prop, NULL, "thickness");
	//RNA_def_property_range(prop, 1, 10); /* 10 px limit comes from Windows OpenGL limits for natively-drawn strokes */
	RNA_def_property_int_funcs(prop, NULL, NULL, "rna_GPencilLayer_line_width_range");
	RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Onion-Skinning */
	prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
	RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "ghost_before_range", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "gstep");
	RNA_def_property_range(prop, 0, 120);
	RNA_def_property_ui_text(prop, "Frames Before",
	                         "Maximum number of frames to show before current frame "
	                         "(0 = show only the previous sketch)");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "ghost_after_range", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "gstep_next");
	RNA_def_property_range(prop, 0, 120);
	RNA_def_property_ui_text(prop, "Frames After",
	                         "Maximum number of frames to show after current frame "
	                         "(0 = show only the next sketch)");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "use_ghost_custom_colors", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_GHOST_PREVCOL | GP_LAYER_GHOST_NEXTCOL);
	RNA_def_property_ui_text(prop, "Use Custom Ghost Colors", "Use custom colors for ghost frames");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "before_color", PROP_FLOAT, PROP_COLOR_GAMMA);
	RNA_def_property_float_sdna(prop, NULL, "gcolor_prev");
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Before Color", "Base color for ghosts before the active frame");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "after_color", PROP_FLOAT, PROP_COLOR_GAMMA);
	RNA_def_property_float_sdna(prop, NULL, "gcolor_next");
	RNA_def_property_array(prop, 3);
	RNA_def_property_range(prop, 0.0f, 1.0f);
	RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* Flags */
	prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
	RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
	RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
	RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
	RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
	RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
	RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");

	/* expose as layers.active */
#if 0
	prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
	RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
#endif

	prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
	RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* XXX keep this option? */
	prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
	RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	/* X-Ray */
	prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);
	RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects");
	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
	
	
	/* Read-only state props (for simpler UI code) */
	prop = RNA_def_property(srna, "is_stroke_visible", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_GPencilLayer_is_stroke_visible_get", NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Is Stroke Visible", "True when opacity of stroke is set high enough to be visible");
	
	prop = RNA_def_property(srna, "is_fill_visible", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_GPencilLayer_is_fill_visible_get", NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Is Fill Visible", "True when opacity of fill is set high enough to be visible");
	
	/* Layers API */
	func = RNA_def_function(srna, "clear", "rna_GPencil_layer_clear");
	RNA_def_function_ui_description(func, "Remove all the grease pencil layer data");
}
static void rna_def_movieclip(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	static EnumPropertyItem clip_source_items[] = {
		{MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
		{MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"},
		{0, NULL, 0, NULL, NULL}
	};

	srna = RNA_def_struct(brna, "MovieClip", "ID");
	RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file");
	RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);

	prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
	RNA_def_property_string_sdna(prop, NULL, "name");
	RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");

	prop = RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "MovieTracking");

	prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "MovieClipProxy");

	/* use proxy */
	prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_ui_text(prop, "Use Proxy / Timecode",
	                         "Use a preview proxy and/or timecode index for this clip");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);

	prop = RNA_def_int_vector(srna, "size", 2, NULL, 0, 0, "Size",
	                          "Width and height in pixels, zero when image data cant be loaded", 0, 0);
	RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get", NULL, NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
	RNA_def_property_float_sdna(prop, NULL, "aspx");
	RNA_def_property_array(prop, 2);
	RNA_def_property_range(prop, 0.1f, FLT_MAX);
	RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
	RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);

	/* source */
	prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, clip_source_items);
	RNA_def_property_ui_text(prop, "Source", "Where the clip comes from");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	/* custom proxy directory */
	prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR);
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	RNA_def_property_ui_text(prop, "Proxy Custom Directory",
	                         "Create proxy images in a custom directory (default is movie location)");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");

	/* grease pencil */
	prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "gpd");
	RNA_def_property_struct_type(prop, "GreasePencil");
	RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
	RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this movie clip");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);

	/* start_frame */
	prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "start_frame");
	RNA_def_property_ui_text(prop, "Start Frame", "Global scene frame number at which this movie starts playing "
	                         "(affects all data associated with a clip)");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");

	/* frame_offset */
	prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "frame_offset");
	RNA_def_property_ui_text(prop, "Frame Offset", "Offset of footage first frame relative to it's file name "
	                         "(affects only how footage is loading, does not change data associated with a clip)");
	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");

	/* length */
	prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_int_sdna(prop, NULL, "len");
	RNA_def_property_ui_text(prop, "Duration", "Detected duration of movie clip in frames");

	/* color management */
	prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "colorspace_settings");
	RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
	RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
}
Exemple #17
0
static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
{
	PropertyRNA *prop;
	
	static EnumPropertyItem prop_align_items[] = {
		{CU_LEFT, "LEFT", 0, "Left", "Align text to the left"},
		{CU_MIDDLE, "CENTRAL", 0, "Center", "Center text"},
		{CU_RIGHT, "RIGHT", 0, "Right", "Align text to the right"},
		{CU_JUSTIFY, "JUSTIFY", 0, "Justify", "Align to the left and the right"},
		{CU_FLUSH, "FLUSH", 0, "Flush", "Align to the left and the right, with equal character spacing"},
		{0, NULL, 0, NULL, NULL}};
		
	/* Enums */
	prop= RNA_def_property(srna, "spacemode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, prop_align_items);
	RNA_def_property_ui_text(prop, "Text Align", "Text align from the object center.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	/* 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.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");
	
	prop= RNA_def_property(srna, "line_dist", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "linedist");
	RNA_def_property_range(prop, 0.0f, 10.0f);
	RNA_def_property_ui_text(prop, "Distance between lines of text", "");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "word_spacing", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "wordspace");
	RNA_def_property_range(prop, 0.0f, 10.0f);
	RNA_def_property_ui_text(prop, "Spacing between words", "");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "spacing");
	RNA_def_property_range(prop, 0.0f, 10.0f);
	RNA_def_property_ui_text(prop, "Global spacing between characters", "");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "shear");
	RNA_def_property_range(prop, -1.0f, 1.0f);
	RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "xof");
	RNA_def_property_range(prop, -50.0f, 50.0f);
	RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "yof");
	RNA_def_property_range(prop, -50.0f, 50.0f);
	RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "ulpos");
	RNA_def_property_range(prop, -0.2f, 0.8f);
	RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "ulheight");
	RNA_def_property_range(prop, -0.2f, 0.8f);
	RNA_def_property_ui_text(prop, "Underline Thickness", "");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "textboxes", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox");
	RNA_def_property_struct_type(prop, "TextBox");
	RNA_def_property_ui_text(prop, "Textboxes", "");

	prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "actbox");
	RNA_def_property_ui_text(prop, "The active text box", "");
	RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_active_textbox_index_range");
	
	/* strings */
	prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
	RNA_def_property_string_maxlength(prop, 21);
	RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters. Give font objects a common name followed by the character it represents, eg. familya, familyb etc, and turn on Verts Duplication");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "str", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "str");
	RNA_def_property_ui_text(prop, "String", "");
	RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
	RNA_def_property_string_maxlength(prop, 8192); /* note that originally str did not have a limit! */
	RNA_def_struct_name_property(srna, prop);
	
	/* pointers */
	prop= RNA_def_property(srna, "text_on_curve", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "vfont");
	RNA_def_property_ui_text(prop, "Font", "");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
	RNA_def_property_ui_text(prop, "Edit Format", "Editing settings character formatting.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	/* flags */
	prop= RNA_def_property(srna, "fast", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
	RNA_def_property_ui_text(prop, "Fast", "Don't fill polygons while editing.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
Exemple #18
0
static void rna_def_text(BlenderRNA *brna)
{
  StructRNA *srna;
  PropertyRNA *prop;

  srna = RNA_def_struct(brna, "Text", "ID");
  RNA_def_struct_ui_text(
      srna, "Text", "Text data-block referencing an external or packed text file");
  RNA_def_struct_ui_icon(srna, ICON_TEXT);
  RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);

  prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE);
  RNA_def_property_string_funcs(
      prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set");
  RNA_def_property_ui_text(prop, "File Path", "Filename of the text file");

  prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Dirty", "Text file has been edited since last save");

  prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_boolean_funcs(prop, "rna_Text_modified_get", NULL);
  RNA_def_property_ui_text(
      prop, "Modified", "Text file on disk is different than the one in memory");

  prop = RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(
      prop, "Memory", "Text file is in memory, without a corresponding file on disk");

  prop = RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT);
  RNA_def_property_ui_text(
      prop, "Register", "Run this text as a script on loading, Text name must end with \".py\"");

  prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES);
  RNA_def_property_ui_text(
      prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces");

  prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);
  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_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");
  RNA_def_property_ui_text(
      prop, "Current Line", "Current line, and start line of selection if one exists");

  prop = RNA_def_property(srna, "current_character", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_sdna(prop, NULL, "curc");
  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, "current_line_index", PROP_INT, PROP_NONE);
  RNA_def_property_int_funcs(
      prop, "rna_Text_current_line_index_get", "rna_Text_current_line_index_set", NULL);
  RNA_def_property_ui_text(
      prop, "Current Line Index", "Index of current TextLine in TextLine collection");
  RNA_def_property_update(prop, NC_TEXT | ND_CURSOR, NULL);

  prop = RNA_def_property(srna, "select_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");
  RNA_def_property_ui_text(prop, "Selection End Line", "End line of selection");

  prop = RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_sdna(prop, NULL, "selc");
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop,
                           "Selection End Character",
                           "Index of character after end of selection in the selection end line");

  RNA_api_text(srna);
}
Exemple #19
0
static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
{
	PropertyRNA *prop;

	static const EnumPropertyItem prop_shadow_items[] = {
		{0, "NOSHADOW", 0, "No Shadow", ""},
		{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem prop_spot_shadow_items[] = {
		{0, "NOSHADOW", 0, "No Shadow", ""},
		{LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Let spotlight produce shadows using shadow buffer"},
		{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem prop_ray_sampling_method_items[] = {
		{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
		{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
		{0, NULL, 0, NULL, NULL}
	};
	
	static const EnumPropertyItem prop_spot_ray_sampling_method_items[] = {
		{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
		{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
		{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem prop_shadbuftype_items[] = {
		{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 artifacts"},
		{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 const EnumPropertyItem prop_shadbuffiltertype_items[] = {
		{LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"},
		{LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"},
		{LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"},
		{0, NULL, 0, NULL, NULL}
	};

	static const EnumPropertyItem prop_numbuffer_items[] = {
		{1, "BUFFERS_1", 0, "1", "Only one buffer rendered"},
		{4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"},
		{9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"},
		{0, NULL, 0, NULL, NULL}
	};

	/* GE only */
	static const EnumPropertyItem prop_ge_shadowbuffer_type_items[] = {
		{LA_SHADMAP_SIMPLE, "SIMPLE", 0, "Simple", "Simple shadow maps"},
		{LA_SHADMAP_VARIANCE, "VARIANCE", 0, "Variance", "Variance shadow maps"},
		{0, NULL, 0, NULL, NULL}
	};

	prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_use_shadow_get", "rna_use_shadow_set");
	RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");

	prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
	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_update(prop, 0, "rna_Lamp_draw_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, 128, 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, 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, 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, 0, "rna_Lamp_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, below which objects will not generate shadows");
	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, 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.001f, 5.0f);
	RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "shadow_buffer_bleed_bias", PROP_FLOAT, PROP_NONE);
	RNA_def_property_float_sdna(prop, NULL, "bleedbias");
	RNA_def_property_range(prop, 0.f, 1.f);
	RNA_def_property_ui_text(prop, "Shadow Buffer Bleed Bias", "Bias for reducing light-bleed on variance shadow maps");
	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, 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, 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, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "ge_shadow_buffer_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "shadowmap_type");
	RNA_def_property_enum_items(prop, prop_ge_shadowbuffer_type_items);
	RNA_def_property_ui_text(prop, "Shadow Map Type", "The shadow mapping algorithm used");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");


	prop = RNA_def_property(srna, "use_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, 0, "rna_Lamp_draw_update");

	prop = RNA_def_property(srna, "use_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, 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");

	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, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
	RNA_def_property_ui_text(prop, "Only Shadow", "Cast shadows only, without illuminating objects");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "shadow_ray_sample_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, 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",
	                         "Number of samples taken extra (samples x samples)");
	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",
		                         "Number of samples taken extra (samples x samples)");
		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, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
	RNA_def_property_float_sdna(prop, NULL, "area_size");
	RNA_def_property_range(prop, 0.0f, FLT_MAX);
	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, 0, "rna_Lamp_update");

	prop = RNA_def_property(srna, "use_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", "Objects on the same layers only cast shadows");
	RNA_def_property_update(prop, 0, "rna_Lamp_update");
}
Exemple #20
0
static void rna_def_image(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	static const EnumPropertyItem prop_type_items[] = {
		{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
		{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
		{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_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, "Upper First", "Upper field first"},
		{IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"},
		{0, NULL, 0, NULL, NULL}
	};
	static const EnumPropertyItem alpha_mode_items[] = {
		{IMA_ALPHA_STRAIGHT, "STRAIGHT", 0, "Straight", "Transparent RGB and alpha pixels are unmodified"},
		{IMA_ALPHA_PREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
		{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");
	RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);

	prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
	RNA_def_property_string_sdna(prop, NULL, "name");
	RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update");

	/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
	prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
	RNA_def_property_string_sdna(prop, NULL, "name");
	RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");

	prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, image_type_items);
	RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
	RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");

	prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, image_source_items);
	RNA_def_property_enum_funcs(prop, NULL, "rna_Image_source_set", "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);

	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);
	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, "use_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, "rna_Image_fields_update");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	

	prop = RNA_def_property(srna, "use_view_as_render", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_VIEW_AS_RENDER);
	RNA_def_property_ui_text(prop, "View as Render", "Apply render part of display transformation when displaying this image on the screen");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMA_IGNORE_ALPHA);
	RNA_def_property_ui_text(prop, "Use Alpha", "Use the alpha channel information from the image or make image fully opaque");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update");

	prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");

	/* generated image (image_generated_change_cb) */
	prop = RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "gen_type");
	RNA_def_property_enum_items(prop, image_generated_type_items);
	RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	
	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, 65536);
	RNA_def_property_ui_text(prop, "Generated Width", "Generated image width");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	
	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, 65536);
	RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
	
	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");
	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

	/* realtime properties */
	prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
	RNA_def_property_enum_items(prop, prop_mapping_items);
	RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
	RNA_def_property_float_sdna(prop, NULL, "aspx");
	RNA_def_property_array(prop, 2);
	RNA_def_property_range(prop, 0.1f, FLT_MAX);
	RNA_def_property_ui_range(prop, 0.1f, 5000.f, 1, 2);
	RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
	RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_animated_update");

	prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "twsta");
	RNA_def_property_range(prop, 0, 128);
	RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_animated_update");

	prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "twend");
	RNA_def_property_range(prop, 0, 128);
	RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_animated_update");

	prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "animspeed");
	RNA_def_property_range(prop, 1, 100);
	RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
	RNA_def_property_ui_text(prop, "Tiles",
	                         "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "xrep");
	RNA_def_property_range(prop, 1, 16);
	RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "yrep");
	RNA_def_property_range(prop, 1, 16);
	RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
	RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
	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);

	prop = RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "bindcode");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

	prop = RNA_def_property(srna, "render_slot", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT - 1);
	RNA_def_property_ui_text(prop, "Render Slot", "The current render slot displayed, only for viewer type images");
	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_UNSIGNED);
	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);

	prop = RNA_def_int_vector(srna, "size", 2, NULL, 0, 0, "Size",
	                          "Width and height in pixels, zero when image data cant be loaded", 0, 0);
	RNA_def_property_subtype(prop, PROP_PIXEL);
	RNA_def_property_int_funcs(prop, "rna_Image_size_get", NULL, NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_float_vector(srna, "resolution", 2, NULL, 0, 0, "Resolution", "X/Y pixels per meter", 0, 0);
	RNA_def_property_float_funcs(prop, "rna_Image_resolution_get", "rna_Image_resolution_set", NULL);

	prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_funcs(prop, "rna_Image_frame_duration_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Duration", "Duration (in frames) of the image (1 when not a video/sequence)");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	/* NOTE about pixels/channels/is_floa:
	 * this properties describes how image is stored internally (inside of ImBuf),
	 * not how it was saved to disk or how it'll be saved on disk
	 */
	prop = RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");
	RNA_def_property_dynamic_array_funcs(prop, "rna_Image_pixels_get_length");
	RNA_def_property_float_funcs(prop, "rna_Image_pixels_get", "rna_Image_pixels_set", NULL);

	prop = RNA_def_property(srna, "channels", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_funcs(prop, "rna_Image_channels_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Channels", "Number of channels in pixels buffer");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop = RNA_def_property(srna, "is_float", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_funcs(prop, "rna_Image_is_float_get", NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Is Float", "True if this image is stored in float buffer");

	prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "colorspace_settings");
	RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
	RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");

	prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, alpha_mode_items);
	RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels");
	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update");

	RNA_api_image(srna);
}
Exemple #21
0
/* keyingset.paths */
static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
{
	StructRNA *srna;

	FunctionRNA *func;
	PropertyRNA *parm;
	
	PropertyRNA *prop;

	RNA_def_property_srna(cprop, "KeyingSetPaths");
	srna = RNA_def_struct(brna, "KeyingSetPaths", NULL);
	RNA_def_struct_sdna(srna, "KeyingSet");
	RNA_def_struct_ui_text(srna, "Keying set paths", "Collection of keying set paths");

	
	/* Add Path */
	func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add");
	RNA_def_function_ui_description(func, "Add a new path for the Keying Set");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	/* return arg */
	parm = RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set");
	RNA_def_function_return(func, parm);
	/* ID-block for target */
	parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* rna-path */
	/* XXX hopefully this is long enough */
	parm = RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property");
	RNA_def_property_flag(parm, PROP_REQUIRED);
	/* index (defaults to -1 for entire array) */
	RNA_def_int(func, "index", -1, -1, INT_MAX, "Index",
	            "The index of the destination property (i.e. axis of Location/Rotation/etc.), "
	            "or -1 for the entire array", 0, INT_MAX);
	/* grouping */
	RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME,
	             "Grouping Method", "Method used to define which Group-name to use");
	RNA_def_string(func, "group_name", "", 64, "Group Name",
	               "Name of Action Group to assign destination to (only if grouping mode is to use this name)");


	/* Remove Path */
	func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove");
	RNA_def_function_ui_description(func, "Remove the given path from the Keying Set");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	/* path to remove */
	parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);


	/* Remove All Paths */
	func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
	RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set");
	RNA_def_function_flag(func, FUNC_USE_REPORTS);
	
	prop = RNA_def_property(srna, "active", 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, NULL);
	RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");

	prop = RNA_def_property(srna, "active_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");
}
Exemple #22
0
static void rna_def_image(BlenderRNA *brna)
{
  StructRNA *srna;
  PropertyRNA *prop;
  static const EnumPropertyItem prop_type_items[] = {
      {IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
      {IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
      {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 alpha_mode_items[] = {
      {IMA_ALPHA_STRAIGHT,
       "STRAIGHT",
       0,
       "Straight",
       "Store RGB and alpha channels separately with alpha acting as a mask, also known as "
       "unassociated alpha. Commonly used by image editing applications and file formats like "
       "PNG"},
      {IMA_ALPHA_PREMUL,
       "PREMUL",
       0,
       "Premultiplied",
       "Store RGB channels with alpha multipled in, also known as associated alpha. The natural "
       "format for renders and used by file formats like OpenEXR"},
      {IMA_ALPHA_CHANNEL_PACKED,
       "CHANNEL_PACKED",
       0,
       "Channel Packed",
       "Different images are packed in the RGB and alpha channels, and they should not "
       "affect each other. Channel packing is commonly used by game engines to save memory"},
      {IMA_ALPHA_IGNORE,
       "NONE",
       0,
       "None",
       "Ignore alpha channel from the file and make image fully opaque"},
      {0, NULL, 0, NULL, NULL},
  };

  srna = RNA_def_struct(brna, "Image", "ID");
  RNA_def_struct_ui_text(
      srna, "Image", "Image data-block referencing an external or packed image");
  RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);

  prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_string_sdna(prop, NULL, "name");
  RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update");

  /* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
  prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
  RNA_def_property_string_sdna(prop, NULL, "name");
  RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");

  prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
  RNA_def_property_enum_items(prop, rna_enum_image_type_items);
  RNA_def_property_enum_funcs(
      prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
  RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");

  prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
  RNA_def_property_enum_items(prop, image_source_items);
  RNA_def_property_enum_funcs(prop, NULL, "rna_Image_source_set", "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);

  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);
  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_struct_type(prop, "PackedFile");
  RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
  RNA_def_property_pointer_funcs(prop, "rna_Image_packed_file_get", NULL, NULL, NULL);
  RNA_def_property_ui_text(prop, "Packed File", "First packed file of the image");

  prop = RNA_def_property(srna, "packed_files", PROP_COLLECTION, PROP_NONE);
  RNA_def_property_collection_sdna(prop, NULL, "packedfiles", NULL);
  RNA_def_property_struct_type(prop, "ImagePackedFile");
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Packed Files", "Collection of packed images");

  prop = RNA_def_property(srna, "use_view_as_render", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_VIEW_AS_RENDER);
  RNA_def_property_ui_text(
      prop,
      "View as Render",
      "Apply render part of display transformation when displaying this image on the screen");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DEINTERLACE);
  RNA_def_property_ui_text(prop, "Deinterlace", "Deinterlace movie file on load");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update");

  prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_USE_VIEWS);
  RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_views_format_update");

  prop = RNA_def_property(srna, "is_stereo_3d", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_boolean_funcs(prop, "rna_Image_is_stereo_3d_get", NULL);
  RNA_def_property_ui_text(prop, "Stereo 3D", "Image has left and right views");
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);

  prop = RNA_def_property(srna, "is_multiview", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_boolean_funcs(prop, "rna_Image_is_multiview_get", NULL);
  RNA_def_property_ui_text(prop, "Multiple Views", "Image has more than one view");
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);

  prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");

  /* generated image (image_generated_change_cb) */
  prop = RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
  RNA_def_property_enum_sdna(prop, NULL, "gen_type");
  RNA_def_property_enum_items(prop, rna_enum_image_generated_type_items);
  RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  prop = RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
  RNA_def_property_int_sdna(prop, NULL, "gen_x");
  RNA_def_property_flag(prop, PROP_PROPORTIONAL);
  RNA_def_property_range(prop, 1, 65536);
  RNA_def_property_ui_text(prop, "Generated Width", "Generated image width");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  prop = RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
  RNA_def_property_int_sdna(prop, NULL, "gen_y");
  RNA_def_property_flag(prop, PROP_PROPORTIONAL);
  RNA_def_property_range(prop, 1, 65536);
  RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  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");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  prop = RNA_def_property(srna, "generated_color", PROP_FLOAT, PROP_COLOR_GAMMA);
  RNA_def_property_float_sdna(prop, NULL, "gen_color");
  RNA_def_property_array(prop, 4);
  RNA_def_property_ui_text(prop, "Color", "Fill color for the generated image");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

  prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_float_sdna(prop, NULL, "aspx");
  RNA_def_property_array(prop, 2);
  RNA_def_property_range(prop, 0.1f, FLT_MAX);
  RNA_def_property_ui_range(prop, 0.1f, 5000.f, 1, 2);
  RNA_def_property_ui_text(
      prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  prop = RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_funcs(prop, "rna_Image_bindcode_get", NULL, NULL);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);

  prop = RNA_def_property(srna, "render_slots", PROP_COLLECTION, PROP_NONE);
  RNA_def_property_struct_type(prop, "RenderSlot");
  RNA_def_property_collection_sdna(prop, NULL, "renderslots", NULL);
  RNA_def_property_ui_text(prop, "Render Slots", "Render slots of the image");
  rna_def_render_slots(brna, prop);

  /*
   * 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 the image data is loaded into memory");

  prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
  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);

  prop = RNA_def_int_vector(srna,
                            "size",
                            2,
                            NULL,
                            0,
                            0,
                            "Size",
                            "Width and height in pixels, zero when image data cant be loaded",
                            0,
                            0);
  RNA_def_property_subtype(prop, PROP_PIXEL);
  RNA_def_property_int_funcs(prop, "rna_Image_size_get", NULL, NULL);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);

  prop = RNA_def_float_vector(
      srna, "resolution", 2, NULL, 0, 0, "Resolution", "X/Y pixels per meter", 0, 0);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_float_funcs(prop, "rna_Image_resolution_get", "rna_Image_resolution_set", NULL);

  prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_funcs(prop, "rna_Image_frame_duration_get", NULL, NULL);
  RNA_def_property_ui_text(
      prop, "Duration", "Duration (in frames) of the image (1 when not a video/sequence)");
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);

  /* NOTE about pixels/channels/is_floa:
   * this properties describes how image is stored internally (inside of ImBuf),
   * not how it was saved to disk or how it'll be saved on disk
   */
  prop = RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
  RNA_def_property_flag(prop, PROP_DYNAMIC);
  RNA_def_property_multi_array(prop, 1, NULL);
  RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");
  RNA_def_property_dynamic_array_funcs(prop, "rna_Image_pixels_get_length");
  RNA_def_property_float_funcs(prop, "rna_Image_pixels_get", "rna_Image_pixels_set", NULL);

  prop = RNA_def_property(srna, "channels", PROP_INT, PROP_UNSIGNED);
  RNA_def_property_int_funcs(prop, "rna_Image_channels_get", NULL, NULL);
  RNA_def_property_ui_text(prop, "Channels", "Number of channels in pixels buffer");
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);

  prop = RNA_def_property(srna, "is_float", PROP_BOOLEAN, PROP_NONE);
  RNA_def_property_boolean_funcs(prop, "rna_Image_is_float_get", NULL);
  RNA_def_property_clear_flag(prop, PROP_EDITABLE);
  RNA_def_property_ui_text(prop, "Is Float", "True if this image is stored in float buffer");

  prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
  RNA_def_property_pointer_sdna(prop, NULL, "colorspace_settings");
  RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
  RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");

  prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_enum_items(prop, alpha_mode_items);
  RNA_def_property_ui_text(prop,
                           "Alpha Mode",
                           "Representation of alpha in the image file, to convert to and from "
                           "when saving and loading the image");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update");

  /* multiview */
  prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
  RNA_def_property_enum_sdna(prop, NULL, "views_format");
  RNA_def_property_enum_items(prop, rna_enum_views_format_items);
  RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views");
  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_views_format_update");

  prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
  RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
  RNA_def_property_flag(prop, PROP_NEVER_NULL);
  RNA_def_property_struct_type(prop, "Stereo3dFormat");
  RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3d");

  RNA_api_image(srna);
}
Exemple #23
0
static void rna_def_image_preview(BlenderRNA *brna)
{
	StructRNA *srna;
	FunctionRNA *func;
	PropertyRNA *prop;

	srna = RNA_def_struct(brna, "ImagePreview", NULL);
	RNA_def_struct_sdna(srna, "PreviewImage");
	RNA_def_struct_ui_text(srna, "Image Preview", "Preview image and icon");

	prop = RNA_def_property(srna, "is_image_custom", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag[ICON_SIZE_PREVIEW]", PRV_USER_EDITED);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_ImagePreview_is_image_custom_set");
	RNA_def_property_ui_text(prop, "Custom Image", "True if this preview image has been modified by py script,"
	                         "and is no more auto-generated by Blender");

	prop = RNA_def_int_vector(srna, "image_size", 2, NULL, 0, 0, "Image Size",
	                          "Width and height in pixels", 0, 0);
	RNA_def_property_subtype(prop, PROP_PIXEL);
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_image_size_get", "rna_ImagePreview_image_size_set", NULL);

	prop = RNA_def_property(srna, "image_pixels", PROP_INT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Image Pixels", "Image pixels, as bytes (always RGBA 32bits)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_image_pixels_get_length");
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_image_pixels_get", "rna_ImagePreview_image_pixels_set", NULL);

	prop = RNA_def_property(srna, "image_pixels_float", PROP_FLOAT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Float Image Pixels",
	                         "Image pixels components, as floats (RGBA concatenated values)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_image_pixels_float_get_length");
	RNA_def_property_float_funcs(prop, "rna_ImagePreview_image_pixels_float_get",
	                             "rna_ImagePreview_image_pixels_float_set", NULL);


	prop = RNA_def_property(srna, "is_icon_custom", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag[ICON_SIZE_ICON]", PRV_USER_EDITED);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_ImagePreview_is_icon_custom_set");
	RNA_def_property_ui_text(prop, "Custom Icon", "True if this preview icon has been modified by py script,"
	                         "and is no more auto-generated by Blender");

	prop = RNA_def_int_vector(srna, "icon_size", 2, NULL, 0, 0, "Icon Size",
	                          "Width and height in pixels", 0, 0);
	RNA_def_property_subtype(prop, PROP_PIXEL);
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_size_get", "rna_ImagePreview_icon_size_set", NULL);

	prop = RNA_def_property(srna, "icon_pixels", PROP_INT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Icon Pixels", "Icon pixels, as bytes (always RGBA 32bits)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_icon_pixels_get_length");
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_pixels_get", "rna_ImagePreview_icon_pixels_set", NULL);

	prop = RNA_def_property(srna, "icon_pixels_float", PROP_FLOAT, PROP_NONE);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_multi_array(prop, 1, NULL);
	RNA_def_property_ui_text(prop, "Float Icon Pixels", "Icon pixels components, as floats (RGBA concatenated values)");
	RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_icon_pixels_float_get_length");
	RNA_def_property_float_funcs(prop, "rna_ImagePreview_icon_pixels_float_get",
	                             "rna_ImagePreview_icon_pixels_float_set", NULL);

	prop = RNA_def_int(srna, "icon_id", 0, INT_MIN, INT_MAX, "Icon ID",
	                   "Unique integer identifying this preview as an icon (zero means invalid)", INT_MIN, INT_MAX);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_id_get", NULL, NULL);

	func = RNA_def_function(srna, "reload", "rna_ImagePreview_icon_reload");
	RNA_def_function_ui_description(func, "Reload the preview from its source path");
}
Exemple #24
0
static void rna_def_curve_nurb(BlenderRNA *brna)
{
	static EnumPropertyItem curve_type_items[] = {
		{CU_POLY, "POLY", 0, "Poly", ""},
		{CU_BEZIER, "BEZIER", 0, "Bezier", ""},
		{CU_BSPLINE, "BSPLINE", 0, "BSpline", ""},
		{CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
		{CU_NURBS, "NURBS", 0, "Ease", ""},
		{0, NULL, 0, NULL, NULL}};

	static EnumPropertyItem spline_interpolation_items[] = {
		{BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""},
		{BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""},
		{BEZT_IPO_BEZ, "BSPLINE", 0, "BSpline", ""},
		{BEZT_IPO_BEZ, "EASE", 0, "Ease", ""},
		{0, NULL, 0, NULL, NULL}};

	StructRNA *srna;
	PropertyRNA *prop;

	srna= RNA_def_struct(brna, "Nurb", NULL);
	RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects.");

	prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_collection_sdna(prop, NULL, "bp", NULL);
	RNA_def_property_struct_type(prop, "CurvePoint");
	RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0, 0, 0);
	RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline.");

	prop= RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_struct_type(prop, "BezierCurvePoint");
	RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu");
	RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for bezier curves only.");

	
	prop= RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "tilt_interp");
	RNA_def_property_enum_items(prop, spline_interpolation_items);
	RNA_def_property_ui_text(prop, "Tilt Interpolation", "The type of tilt interpolation for 3D, Bezier curves.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "radius_interpolation", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "radius_interp");
	RNA_def_property_enum_items(prop, spline_interpolation_items);
	RNA_def_property_ui_text(prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	// XXX - switching type probably needs comprehensive recalc of data like in 2.4x
	prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, curve_type_items);
	RNA_def_property_enum_funcs(prop, NULL, "rna_Nurb_type_set", NULL);
	RNA_def_property_ui_text(prop, "Type", "The interpolation type for this curve element.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "point_count_u", PROP_INT, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
	RNA_def_property_int_sdna(prop, NULL, "pntsu");
	RNA_def_property_ui_text(prop, "Points U", "Total number points for the curve or surface in the U direction");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "point_count_v", PROP_INT, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
	RNA_def_property_int_sdna(prop, NULL, "pntsv");
	RNA_def_property_ui_text(prop, "Points V", "Total number points for the surface on the V direction");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");


	prop= RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "orderu");
	RNA_def_property_range(prop, 2, 6);
	RNA_def_property_ui_text(prop, "Order U", "Nurbs order in the U direction (For splines and surfaces), Higher values let points influence a greater area");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");

	prop= RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "orderv");
	RNA_def_property_range(prop, 2, 6);
	RNA_def_property_ui_text(prop, "Order V", "Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");


	prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "resolu");
	RNA_def_property_range(prop, 1, 1024);
	RNA_def_property_ui_text(prop, "Resolution U", "Curve or Surface subdivisions per segment");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "resolv");
	RNA_def_property_range(prop, 1, 1024);
	RNA_def_property_ui_text(prop, "Resolution V", "Surface subdivisions per segment");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "cyclic_u", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flagu", CU_CYCLIC);
	RNA_def_property_ui_text(prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction.");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_handle_data"); /* only needed for cyclic_u because cyclic_v cant do bezier */

	prop= RNA_def_property(srna, "cyclic_v", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_CYCLIC);
	RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");


	/* Note, endpoint and bezier flags should never be on at the same time! */
	prop= RNA_def_property(srna, "endpoint_u", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flagu", 2);
	RNA_def_property_ui_text(prop, "Endpoint U", "Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled).");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");

	prop= RNA_def_property(srna, "endpoint_v", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flagv", 2);
	RNA_def_property_ui_text(prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled).");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");

	prop= RNA_def_property(srna, "bezier_u", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flagu", 4);
	RNA_def_property_ui_text(prop, "Bezier U", "Make this nurbs curve or surface act like a bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled).");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");

	prop= RNA_def_property(srna, "bezier_v", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flagv", 4);
	RNA_def_property_ui_text(prop, "Bezier V", "Make this nurbs surface act like a bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled).");
	RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");


	prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_SMOOTH);
	RNA_def_property_ui_text(prop, "Smooth", "Smooth the normals of the surface or beveled curve.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "hide", 1);
	RNA_def_property_ui_text(prop, "Hide", "Hide this curve in editmode.");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");

	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", "");
	RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
	
	prop= RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_int_sdna(prop, NULL, "charidx");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/
	RNA_def_property_ui_text(prop, "Character Index", "Location of this character in the text data (only for text curves)");
	RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
Exemple #25
0
static void rna_def_movieclip(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	static EnumPropertyItem clip_source_items[]= {
		{MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
		{MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"},
		{0, NULL, 0, NULL, NULL}};

	srna= RNA_def_struct(brna, "MovieClip", "ID");
	RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file");
	RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);

	prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
	RNA_def_property_string_sdna(prop, NULL, "name");
	RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file");
	RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");

	prop= RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "MovieTracking");

	prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
	RNA_def_property_struct_type(prop, "MovieClipProxy");

	/* use proxy */
	prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY);
	RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip");
	RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);

	prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
	RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
	RNA_def_property_float_sdna(prop, NULL, "aspx");
	RNA_def_property_array(prop, 2);
	RNA_def_property_range(prop, 0.1f, 5000.0f);
	RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
	RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering");
	RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);

	/* source */
	prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, clip_source_items);
	RNA_def_property_ui_text(prop, "Source", "Where the clip comes from");
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	/* custom proxy directory */
	prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR);
	RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)");
	RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");

	/* grease pencil */
	prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "gpd");
	RNA_def_property_flag(prop, PROP_EDITABLE);
	RNA_def_property_struct_type(prop, "GreasePencil");
	RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this movie clip");
}
Exemple #26
0
static void rna_def_number_property(StructRNA *srna, PropertyType type)
{
	PropertyRNA *prop;

	prop= RNA_def_property(srna, "default", type, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_ui_text(prop, "Default", "Default value for this number");

	switch(type) {
		case PROP_BOOLEAN:
			RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_get", NULL);
			break;
		case PROP_INT:
			RNA_def_property_int_funcs(prop, "rna_IntProperty_default_get", NULL, NULL);
			break;
		case PROP_FLOAT:
			RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_get", NULL, NULL);
			break;
		default:
			break;
	}


	prop= RNA_def_property(srna, "default_array", type, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_array(prop, RNA_MAX_ARRAY_DIMENSION); /* no fixed default length, important its not 0 though */
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_NumberProperty_default_array_get_length"); /* same for all types */

	switch(type) {
		case PROP_BOOLEAN:
			RNA_def_property_boolean_funcs(prop, "rna_BoolProperty_default_array_get", NULL);
			break;
		case PROP_INT:
			RNA_def_property_int_funcs(prop, "rna_IntProperty_default_array_get", NULL, NULL);
			break;
		case PROP_FLOAT:
			RNA_def_property_float_funcs(prop, "rna_FloatProperty_default_array_get", NULL, NULL);
			break;
		default:
			break;
	}
	RNA_def_property_ui_text(prop, "Default Array", "Default value for this array");


	prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	RNA_def_property_int_funcs(prop, "rna_Property_array_length_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Array Length", "Maximum length of the array, 0 means unlimited");

	if(type == PROP_BOOLEAN)
		return;

	prop= RNA_def_property(srna, "hard_min", type, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_min_get", NULL, NULL);
	else RNA_def_property_float_funcs(prop, "rna_FloatProperty_hard_min_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Hard Minimum", "Minimum value used by buttons");

	prop= RNA_def_property(srna, "hard_max", type, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_max_get", NULL, NULL);
	else RNA_def_property_float_funcs(prop, "rna_FloatProperty_hard_max_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Hard Maximum", "Maximum value used by buttons");

	prop= RNA_def_property(srna, "soft_min", type, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_min_get", NULL, NULL);
	else RNA_def_property_float_funcs(prop, "rna_FloatProperty_soft_min_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Soft Minimum", "Minimum value used by buttons");

	prop= RNA_def_property(srna, "soft_max", type, PROP_NONE);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_max_get", NULL, NULL);
	else RNA_def_property_float_funcs(prop, "rna_FloatProperty_soft_max_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Soft Maximum", "Maximum value used by buttons");

	prop= RNA_def_property(srna, "step", type, PROP_UNSIGNED);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
	if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_step_get", NULL, NULL);
	else RNA_def_property_float_funcs(prop, "rna_FloatProperty_step_get", NULL, NULL);
	RNA_def_property_ui_text(prop, "Step", "Step size used by number buttons, for floats 1/100th of the step size");

	if(type == PROP_FLOAT) {
		prop= RNA_def_property(srna, "precision", PROP_INT, PROP_UNSIGNED);
		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
		RNA_def_property_int_funcs(prop, "rna_FloatProperty_precision_get", NULL, NULL);
		RNA_def_property_ui_text(prop, "Precision", "Number of digits after the dot used by buttons");
	}
}
Exemple #27
0
static void rna_def_lattice(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;

	static EnumPropertyItem prop_keyblock_type_items[] = {
		{KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""},
		{KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""},
		{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
		{0, NULL, 0, NULL, NULL}};

	srna= RNA_def_struct(brna, "Lattice", "ID");
	RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects");
	RNA_def_struct_ui_icon(srna, ICON_LATTICE_DATA);

	prop= RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "pntsu");
	RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL);
	RNA_def_property_range(prop, 1, 64);
	RNA_def_property_ui_text(prop, "U", "Points in U direction (can't be changed when there are shape keys)");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
	RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");

	prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "pntsv");
	RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL);
	RNA_def_property_range(prop, 1, 64);
	RNA_def_property_ui_text(prop, "V", "Points in V direction (can't be changed when there are shape keys)");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
	RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");

	prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
	RNA_def_property_int_sdna(prop, NULL, "pntsw");
	RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL);
	RNA_def_property_range(prop, 1, 64);
	RNA_def_property_ui_text(prop, "W", "Points in W direction (can't be changed when there are shape keys)");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
	RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");

	prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "typeu");
	RNA_def_property_enum_items(prop, prop_keyblock_type_items);
	RNA_def_property_ui_text(prop, "Interpolation Type U", "");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_data");

	prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "typev");
	RNA_def_property_enum_items(prop, prop_keyblock_type_items);
	RNA_def_property_ui_text(prop, "Interpolation Type V", "");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_data");

	prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_sdna(prop, NULL, "typew");
	RNA_def_property_enum_items(prop, prop_keyblock_type_items);
	RNA_def_property_ui_text(prop, "Interpolation Type W", "");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_data");

	prop= RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
	RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set");
	RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
	
	prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "vgroup");
	RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice");
	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set");
	RNA_def_property_update(prop, 0, "rna_Lattice_update_data");

	prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
	RNA_def_property_pointer_sdna(prop, NULL, "key");
	RNA_def_property_ui_text(prop, "Shape Keys", "");

	prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
	RNA_def_property_struct_type(prop, "LatticePoint");
	RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
	RNA_def_property_ui_text(prop, "Points", "Points of the lattice");
	
	/* pointers */
	rna_def_animdata_common(srna);
}
Exemple #28
0
static void rna_def_boid_settings(BlenderRNA *brna)
{
    StructRNA *srna;
    PropertyRNA *prop;

    srna = RNA_def_struct(brna, "BoidSettings", NULL);
    RNA_def_struct_path_func(srna, "rna_BoidSettings_path");
    RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics");

    prop = RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "landing_smoothness");
    RNA_def_property_range(prop, 0.0, 10.0);
    RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "banking");
    RNA_def_property_range(prop, 0.0, 2.0);
    RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "pitch");
    RNA_def_property_range(prop, 0.0, 2.0);
    RNA_def_property_ui_text(prop, "Pitch", "Amount of rotation around side vector");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 2.0);
    RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    /* states */
    prop = RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE);
    RNA_def_property_struct_type(prop, "BoidState");
    RNA_def_property_ui_text(prop, "Boid States", "");

    prop = RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE);
    RNA_def_property_struct_type(prop, "BoidRule");
    RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL);
    RNA_def_property_ui_text(prop, "Active Boid Rule", "");

    prop = RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED);
    RNA_def_property_int_funcs(prop, "rna_BoidSettings_active_boid_state_index_get",
                               "rna_BoidSettings_active_boid_state_index_set",
                               "rna_BoidSettings_active_boid_state_index_range");
    RNA_def_property_ui_text(prop, "Active Boid State Index", "");

    /* character properties */
    prop = RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Health", "Initial boid health when born");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    /* physical properties */
    prop = RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_min_speed");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_max_speed");
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_max_acc");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "air_max_ave");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Max Air Angular Velocity",
                             "Maximum angular velocity in air (relative to 180 degrees)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 10.0);
    RNA_def_property_ui_text(prop, "Air Personal Space", "Radius of boids personal space in air (% of particle size)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "land_speed_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "land_max_speed");
    RNA_def_property_range(prop, 0.0, 100.0);
    RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "land_acc_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "land_max_acc");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Max Land Acceleration",
                             "Maximum acceleration on land (relative to maximum speed)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "land_ave_max", PROP_FLOAT, PROP_NONE);
    RNA_def_property_float_sdna(prop, NULL, "land_max_ave");
    RNA_def_property_range(prop, 0.0, 1.0);
    RNA_def_property_ui_text(prop, "Max Land Angular Velocity",
                             "Maximum angular velocity on land (relative to 180 degrees)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 10.0);
    RNA_def_property_ui_text(prop, "Land Personal Space",
                             "Radius of boids personal space on land (% of particle size)");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE);
    RNA_def_property_range(prop, 0.0, 1000.0);
    RNA_def_property_ui_text(prop, "Land Stick Force", "How strong a force must be to start effecting a boid on land");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    /* options */
    prop = RNA_def_property(srna, "use_flight", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT);
    RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "use_land", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND);
    RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");

    prop = RNA_def_property(srna, "use_climb", PROP_BOOLEAN, PROP_NONE);
    RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB);
    RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects");
    RNA_def_property_update(prop, 0, "rna_Boids_reset");
}
Exemple #29
0
void RNA_def_test(BlenderRNA *brna)
{
#ifdef UNIT_TEST
	StructRNA *srna;
	PropertyRNA *prop;
	unsigned short dimsize[]= {MARRAY_DIMSIZE};

	srna= RNA_def_struct(brna, "Test", NULL);
	RNA_def_struct_sdna(srna, "Test");

	prop= RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f);
	RNA_def_property_float_funcs(prop, "rna_Test_farr_get", "rna_Test_farr_set", NULL);

	prop= RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0);
	RNA_def_property_int_funcs(prop, "rna_Test_iarr_get", "rna_Test_iarr_set", NULL);

	prop= RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array");
	RNA_def_property_boolean_funcs(prop, "rna_Test_barr_get", "rna_Test_barr_set");

	/* dynamic arrays */

	prop= RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdarr_get_length", "rna_Test_fdarr_set_length");
	RNA_def_property_float_funcs(prop, "rna_Test_fdarr_get", "rna_Test_fdarr_set", NULL);

	prop= RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length");
	RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL);
	
	prop= RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array");
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length");
	RNA_def_property_boolean_funcs(prop, "rna_Test_bdarr_get", "rna_Test_bdarr_set");

	/* multidimensional arrays */

	prop= RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE);
	RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize);
	RNA_def_property_float_funcs(prop, "rna_Test_fmarr_get", "rna_Test_fmarr_set", NULL);

	prop= RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE);
	RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
	RNA_def_property_int_funcs(prop, "rna_Test_imarr_get", "rna_Test_imarr_set", NULL);

	prop= RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
	RNA_def_property_boolean_funcs(prop, "rna_Test_bmarr_get", "rna_Test_bmarr_set");

	/* dynamic multidimensional arrays */

	prop= RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE);
	RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdmarr_get_length", "rna_Test_fdmarr_set_length");
	RNA_def_property_float_funcs(prop, "rna_Test_fdmarr_get", "rna_Test_fdmarr_set", NULL);

	prop= RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE);
	RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idmarr_get_length", "rna_Test_idmarr_set_length");
	RNA_def_property_int_funcs(prop, "rna_Test_idmarr_get", "rna_Test_idmarr_set", NULL);

	prop= RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
	RNA_def_property_flag(prop, PROP_DYNAMIC);
	RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdmarr_get_length", "rna_Test_bdmarr_set_length");
	RNA_def_property_boolean_funcs(prop, "rna_Test_bdmarr_get", "rna_Test_bdmarr_set");

#endif
}
Exemple #30
0
static void rna_def_uilist(BlenderRNA *brna)
{
	StructRNA *srna;
	PropertyRNA *prop;
	PropertyRNA *parm;
	FunctionRNA *func;

	srna = RNA_def_struct(brna, "UIList", NULL);
	RNA_def_struct_ui_text(srna, "UIList", "UI list containing the elements of a collection");
	RNA_def_struct_sdna(srna, "uiList");
	RNA_def_struct_refine_func(srna, "rna_UIList_refine");
	RNA_def_struct_register_funcs(srna, "rna_UIList_register", "rna_UIList_unregister", NULL);
	RNA_def_struct_idprops_func(srna, "rna_UIList_idprops");
	RNA_def_struct_flag(srna, STRUCT_NO_DATABLOCK_IDPROPERTIES | STRUCT_PUBLIC_NAMESPACE_INHERIT);

	/* Registration */
	prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "type->idname");
	RNA_def_property_flag(prop, PROP_REGISTER);
	RNA_def_property_ui_text(prop, "ID Name",
	                         "If this is set, the uilist gets a custom ID, otherwise it takes the "
	                         "name of the class used to define the uilist (for example, if the "
	                         "class name is \"OBJECT_UL_vgroups\", and bl_idname is not set by the "
	                         "script, then bl_idname = \"OBJECT_UL_vgroups\")");

	/* Data */
	prop = RNA_def_property(srna, "layout_type", PROP_ENUM, PROP_NONE);
	RNA_def_property_enum_items(prop, rna_enum_uilist_layout_type_items);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);

	/* Filter options */
	prop = RNA_def_property(srna, "use_filter_show", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filter_flag", UILST_FLT_SHOW);
	RNA_def_property_ui_text(prop, "Show Filter", "Show filtering options");

	prop = RNA_def_property(srna, "filter_name", PROP_STRING, PROP_NONE);
	RNA_def_property_string_sdna(prop, NULL, "filter_byname");
	RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE);
	RNA_def_property_ui_text(prop, "Filter by Name", "Only show items matching this name (use '*' as wildcard)");

	prop = RNA_def_property(srna, "use_filter_invert", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filter_flag", UILST_FLT_EXCLUDE);
	RNA_def_property_ui_text(prop, "Invert", "Invert filtering (show hidden items, and vice-versa)");

	prop = RNA_def_property(srna, "use_filter_sort_alpha", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filter_sort_flag", UILST_FLT_SORT_ALPHA);
	RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0);
	RNA_def_property_ui_text(prop, "Sort by Name", "Sort items by their name");

	prop = RNA_def_property(srna, "use_filter_sort_reverse", PROP_BOOLEAN, PROP_NONE);
	RNA_def_property_boolean_sdna(prop, NULL, "filter_sort_flag", UILST_FLT_SORT_REVERSE);
	RNA_def_property_ui_text(prop, "Invert", "Invert the order of shown items");

	/* draw_item */
	func = RNA_def_function(srna, "draw_item", NULL);
	RNA_def_function_ui_description(func, "Draw an item in the list (NOTE: when you define your own draw_item "
	                                      "function, you may want to check given 'item' is of the right type...)");
	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
	parm = RNA_def_pointer(func, "context", "Context", "", "");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Layout to draw the item");
	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take Collection property");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR);
	parm = RNA_def_pointer(func, "item", "AnyType", "", "Item of the collection property");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR);
	parm = RNA_def_int(func, "icon", 0, 0, INT_MAX, "", "Icon of the item in the collection", 0, INT_MAX);
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "active_data", "AnyType", "",
	                       "Data from which to take property for the active element");
	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
	parm = RNA_def_string(func, "active_property", NULL, 0, "",
	                      "Identifier of property in active_data, for the active element");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of the item in the collection", 0, INT_MAX);
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_PYFUNC_OPTIONAL);
	prop = RNA_def_property(func, "flt_flag", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_ui_text(prop, "", "The filter-flag result for this item");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_PYFUNC_OPTIONAL);

	/* draw_filter */
	func = RNA_def_function(srna, "draw_filter", NULL);
	RNA_def_function_ui_description(func, "Draw filtering options");
	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
	parm = RNA_def_pointer(func, "context", "Context", "", "");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "layout", "UILayout", "", "Layout to draw the item");
	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);

	/* filter */
	func = RNA_def_function(srna, "filter_items", NULL);
	RNA_def_function_ui_description(func, "Filter and/or re-order items of the collection (output filter results in "
	                                      "filter_flags, and reorder results in filter_neworder arrays)");
	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
	parm = RNA_def_pointer(func, "context", "Context", "", "");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take Collection property");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR);
	parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in data, for the collection");
	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
	prop = RNA_def_property(func, "filter_flags", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_flag(prop, PARM_REQUIRED | PROP_DYNAMIC);
	RNA_def_property_array(prop, 1);  /* XXX Dummy value, default 0 does not work */
	RNA_def_property_ui_text(prop, "", "An array of filter flags, one for each item in the collection (NOTE: "
	                                   "FILTER_ITEM bit is reserved, it defines whether the item is shown or not)");
	RNA_def_function_output(func, prop);
	prop = RNA_def_property(func, "filter_neworder", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_flag(prop, PARM_REQUIRED | PROP_DYNAMIC);
	RNA_def_property_array(prop, 1);  /* XXX Dummy value, default 0 does not work */
	RNA_def_property_ui_text(prop, "", "An array of indices, one for each item in the collection, mapping the org "
	                                   "index to the new one");
	RNA_def_function_output(func, prop);

	/* "Constants"! */
	RNA_define_verify_sdna(0); /* not in sdna */

	prop = RNA_def_property(srna, "bitflag_filter_item", PROP_INT, PROP_UNSIGNED);
	RNA_def_property_ui_text(prop, "FILTER_ITEM",
	                               "The value of the reserved bitflag 'FILTER_ITEM' (in filter_flags values)");
	RNA_def_property_int_funcs(prop, "rna_UIList_filter_const_FILTER_ITEM_get", NULL, NULL);
	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}