Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_render.c
| Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | static void engine_render(RenderEngine *engine, struct Scene *scene) | ||||
| RNA_parameter_list_create(&list, &ptr, func); | RNA_parameter_list_create(&list, &ptr, func); | ||||
| RNA_parameter_set_lookup(&list, "scene", &scene); | RNA_parameter_set_lookup(&list, "scene", &scene); | ||||
| engine->type->ext.call(NULL, &ptr, func, &list); | engine->type->ext.call(NULL, &ptr, func, &list); | ||||
| RNA_parameter_list_free(&list); | RNA_parameter_list_free(&list); | ||||
| } | } | ||||
| static void engine_bake(RenderEngine *engine, struct Scene *scene, struct Object *object, const int pass_type, | static void engine_bake(RenderEngine *engine, struct Scene *scene, | ||||
| const struct BakePixel *pixel_array, const int num_pixels, const int depth, void *result) | struct Object *object, const int pass_type, | ||||
| const int object_id, const struct BakePixel *pixel_array, | |||||
| const int num_pixels, const int depth, void *result) | |||||
| { | { | ||||
| extern FunctionRNA rna_RenderEngine_bake_func; | extern FunctionRNA rna_RenderEngine_bake_func; | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| ParameterList list; | ParameterList list; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); | RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); | ||||
| func = &rna_RenderEngine_bake_func; | func = &rna_RenderEngine_bake_func; | ||||
| RNA_parameter_list_create(&list, &ptr, func); | RNA_parameter_list_create(&list, &ptr, func); | ||||
| RNA_parameter_set_lookup(&list, "scene", &scene); | RNA_parameter_set_lookup(&list, "scene", &scene); | ||||
| RNA_parameter_set_lookup(&list, "object", &object); | RNA_parameter_set_lookup(&list, "object", &object); | ||||
| RNA_parameter_set_lookup(&list, "pass_type", &pass_type); | RNA_parameter_set_lookup(&list, "pass_type", &pass_type); | ||||
| RNA_parameter_set_lookup(&list, "object_id", &object_id); | |||||
| RNA_parameter_set_lookup(&list, "pixel_array", &pixel_array); | RNA_parameter_set_lookup(&list, "pixel_array", &pixel_array); | ||||
| RNA_parameter_set_lookup(&list, "num_pixels", &num_pixels); | RNA_parameter_set_lookup(&list, "num_pixels", &num_pixels); | ||||
| RNA_parameter_set_lookup(&list, "depth", &depth); | RNA_parameter_set_lookup(&list, "depth", &depth); | ||||
| RNA_parameter_set_lookup(&list, "result", &result); | RNA_parameter_set_lookup(&list, "result", &result); | ||||
| engine->type->ext.call(NULL, &ptr, func, &list); | engine->type->ext.call(NULL, &ptr, func, &list); | ||||
| RNA_parameter_list_free(&list); | RNA_parameter_list_free(&list); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | static void rna_def_render_engine(BlenderRNA *brna) | ||||
| RNA_def_function_ui_description(func, "Bake passes"); | RNA_def_function_ui_description(func, "Bake passes"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); | ||||
| prop = RNA_def_pointer(func, "scene", "Scene", "", ""); | prop = RNA_def_pointer(func, "scene", "Scene", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_property_flag(prop, PROP_REQUIRED); | ||||
| prop = RNA_def_pointer(func, "object", "Object", "", ""); | prop = RNA_def_pointer(func, "object", "Object", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_property_flag(prop, PROP_REQUIRED); | ||||
| prop = RNA_def_enum(func, "pass_type", render_pass_type_items, 0, "Pass", "Pass to bake"); | prop = RNA_def_enum(func, "pass_type", render_pass_type_items, 0, "Pass", "Pass to bake"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_property_flag(prop, PROP_REQUIRED); | ||||
| prop = RNA_def_int(func, "object_id", 0, 0, INT_MAX, "Object Id", "Id of the current object being baked in relation to the others", 0, INT_MAX); | |||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | |||||
| prop = RNA_def_pointer(func, "pixel_array", "BakePixel", "", ""); | prop = RNA_def_pointer(func, "pixel_array", "BakePixel", "", ""); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_property_flag(prop, PROP_REQUIRED); | ||||
| prop = RNA_def_int(func, "num_pixels", 0, 0, INT_MAX, "Number of Pixels", "Size of the baking batch", 0, INT_MAX); | prop = RNA_def_int(func, "num_pixels", 0, 0, INT_MAX, "Number of Pixels", "Size of the baking batch", 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_property_flag(prop, PROP_REQUIRED); | ||||
| prop = RNA_def_int(func, "depth", 0, 0, INT_MAX, "Pixels depth", "Number of channels", 1, INT_MAX); | prop = RNA_def_int(func, "depth", 0, 0, INT_MAX, "Pixels depth", "Number of channels", 1, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED); | RNA_def_property_flag(prop, PROP_REQUIRED); | ||||
| /* TODO, see how array size of 0 works, this shouldnt be used */ | /* TODO, see how array size of 0 works, this shouldnt be used */ | ||||
| prop = RNA_def_pointer(func, "result", "AnyType", "", ""); | prop = RNA_def_pointer(func, "result", "AnyType", "", ""); | ||||
| ▲ Show 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | static void rna_def_render_bake_pixel(BlenderRNA *brna) | ||||
| 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); | prop = RNA_def_property(srna, "primitive_id", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "primitive_id"); | RNA_def_property_int_sdna(prop, NULL, "primitive_id"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| prop = RNA_def_property(srna, "object_id", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "object_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 32 Lines | |||||