Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_render.c
| Show All 25 Lines | |||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BKE_global.h" | |||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| ▲ Show 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static PointerRNA rna_BakePixel_next_get(PointerRNA *ptr) | static PointerRNA rna_BakePixel_next_get(PointerRNA *ptr) | ||||
| { | { | ||||
| BakePixel *bp = ptr->data; | BakePixel *bp = ptr->data; | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_BakePixel, bp + 1); | return rna_pointer_inherit_refine(ptr, &RNA_BakePixel, bp + 1); | ||||
| } | } | ||||
| static int rna_BakePixel_primitive_id_get(BakePixel *bp, RenderEngine *engine) | |||||
| { | |||||
| if (RE_bake_object_id_get(engine->re) == bp->object_id) | |||||
| return bp->primitive_id; | |||||
| else | |||||
| return -1; | |||||
| } | |||||
| #else /* RNA_RUNTIME */ | #else /* RNA_RUNTIME */ | ||||
| static void rna_def_render_engine(BlenderRNA *brna) | static void rna_def_render_engine(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| ▲ Show 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | static void rna_def_render_pass(BlenderRNA *brna) | ||||
| RNA_define_verify_sdna(1); | RNA_define_verify_sdna(1); | ||||
| } | } | ||||
| static void rna_def_render_bake_pixel(BlenderRNA *brna) | static void rna_def_render_bake_pixel(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | |||||
| PropertyRNA *parm; | |||||
| srna = RNA_def_struct(brna, "BakePixel", NULL); | srna = RNA_def_struct(brna, "BakePixel", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Bake Pixel", ""); | RNA_def_struct_ui_text(srna, "Bake Pixel", ""); | ||||
| RNA_define_verify_sdna(0); | RNA_define_verify_sdna(0); | ||||
| prop = RNA_def_property(srna, "primitive_id", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "primitive_id"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_array(prop, 2); | RNA_def_property_array(prop, 2); | ||||
| RNA_def_property_float_sdna(prop, NULL, "uv"); | RNA_def_property_float_sdna(prop, NULL, "uv"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| prop = RNA_def_property(srna, "du_dx", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "du_dx", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "du_dx"); | RNA_def_property_float_sdna(prop, NULL, "du_dx"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| Show All 10 Lines | static void rna_def_render_bake_pixel(BlenderRNA *brna) | ||||
| RNA_def_property_float_sdna(prop, NULL, "dv_dy"); | RNA_def_property_float_sdna(prop, NULL, "dv_dy"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| prop = RNA_def_property(srna, "next", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "next", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "BakePixel"); | RNA_def_property_struct_type(prop, "BakePixel"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_BakePixel_next_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_BakePixel_next_get", NULL, NULL, NULL); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| func = RNA_def_function(srna, "primitive_id", "rna_BakePixel_primitive_id_get"); | |||||
| RNA_def_function_ui_description(func, "Get the primitive id for the current Bake Pixel"); | |||||
| parm = RNA_def_pointer(func, "engine", "RenderEngine", "", "Render Engine"); | |||||
| parm = RNA_def_int(func, "object_id", 0, -1, INT_MAX, "Object ID", "", -1, INT_MAX); | |||||
| RNA_def_function_return(func, parm); | |||||
| RNA_define_verify_sdna(1); | RNA_define_verify_sdna(1); | ||||
| } | } | ||||
| void RNA_def_render(BlenderRNA *brna) | void RNA_def_render(BlenderRNA *brna) | ||||
| { | { | ||||
| rna_def_render_engine(brna); | rna_def_render_engine(brna); | ||||
| rna_def_render_result(brna); | rna_def_render_result(brna); | ||||
| rna_def_render_layer(brna); | rna_def_render_layer(brna); | ||||
| rna_def_render_pass(brna); | rna_def_render_pass(brna); | ||||
| rna_def_render_bake_pixel(brna); | rna_def_render_bake_pixel(brna); | ||||
| } | } | ||||
| #endif /* RNA_RUNTIME */ | #endif /* RNA_RUNTIME */ | ||||