Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_bake_api.c
| Context not available. | |||||
| bool is_split_materials; | bool is_split_materials; | ||||
| bool is_automatic_name; | bool is_automatic_name; | ||||
| bool is_selected_to_active; | bool is_selected_to_active; | ||||
| bool is_average_normals; | |||||
| bool is_cage; | bool is_cage; | ||||
| float cage_extrusion; | float cage_extrusion; | ||||
| Context not available. | |||||
| Render *re, Main *bmain, Scene *scene, Object *ob_low, ListBase *selected_objects, ReportList *reports, | Render *re, Main *bmain, Scene *scene, Object *ob_low, ListBase *selected_objects, ReportList *reports, | ||||
| const eScenePassType pass_type, const int pass_filter, const int margin, | const eScenePassType pass_type, const int pass_filter, const int margin, | ||||
| const eBakeSaveMode save_mode, const bool is_clear, const bool is_split_materials, | const eBakeSaveMode save_mode, const bool is_clear, const bool is_split_materials, | ||||
| const bool is_automatic_name, const bool is_selected_to_active, const bool is_cage, | const bool is_automatic_name, const bool is_selected_to_active, const bool use_average_normals, const bool is_cage, | ||||
| const float cage_extrusion, const int normal_space, const eBakeNormalSwizzle normal_swizzle[], | const float cage_extrusion, const int normal_space, const eBakeNormalSwizzle normal_swizzle[], | ||||
| const char *custom_cage, const char *filepath, const int width, const int height, | const char *custom_cage, const char *filepath, const int width, const int height, | ||||
| const char *identifier, ScrArea *sa, const char *uv_layer) | const char *identifier, ScrArea *sa, const char *uv_layer) | ||||
| Context not available. | |||||
| /* populate the pixel arrays with the corresponding face data for each high poly object */ | /* populate the pixel arrays with the corresponding face data for each high poly object */ | ||||
| if (!RE_bake_pixels_populate_from_objects( | if (!RE_bake_pixels_populate_from_objects( | ||||
| me_low, pixel_array_low, pixel_array_high, highpoly, tot_highpoly, num_pixels, ob_cage != NULL, | me_low, pixel_array_low, pixel_array_high, highpoly, tot_highpoly, num_pixels, ob_cage != NULL, | ||||
| cage_extrusion, ob_low->obmat, (ob_cage ? ob_cage->obmat : ob_low->obmat), me_cage)) | cage_extrusion, ob_low->obmat, (ob_cage ? ob_cage->obmat : ob_low->obmat), me_cage, use_average_normals)) | ||||
| { | { | ||||
| BKE_report(reports, RPT_ERROR, "Error handling selected objects"); | BKE_report(reports, RPT_ERROR, "Error handling selected objects"); | ||||
| goto cage_cleanup; | goto cage_cleanup; | ||||
| Context not available. | |||||
| bkr->is_split_materials = (!is_save_internal) && RNA_boolean_get(op->ptr, "use_split_materials"); | bkr->is_split_materials = (!is_save_internal) && RNA_boolean_get(op->ptr, "use_split_materials"); | ||||
| bkr->is_automatic_name = RNA_boolean_get(op->ptr, "use_automatic_name"); | bkr->is_automatic_name = RNA_boolean_get(op->ptr, "use_automatic_name"); | ||||
| bkr->is_selected_to_active = RNA_boolean_get(op->ptr, "use_selected_to_active"); | bkr->is_selected_to_active = RNA_boolean_get(op->ptr, "use_selected_to_active"); | ||||
| bkr->is_average_normals = RNA_boolean_get(op->ptr, "use_average_normals"); | |||||
| bkr->is_cage = RNA_boolean_get(op->ptr, "use_cage"); | bkr->is_cage = RNA_boolean_get(op->ptr, "use_cage"); | ||||
| bkr->cage_extrusion = RNA_float_get(op->ptr, "cage_extrusion"); | bkr->cage_extrusion = RNA_float_get(op->ptr, "cage_extrusion"); | ||||
| Context not available. | |||||
| result = bake( | result = bake( | ||||
| bkr.render, bkr.main, bkr.scene, bkr.ob, &bkr.selected_objects, bkr.reports, | bkr.render, bkr.main, bkr.scene, bkr.ob, &bkr.selected_objects, bkr.reports, | ||||
| bkr.pass_type, bkr.pass_filter, bkr.margin, bkr.save_mode, | bkr.pass_type, bkr.pass_filter, bkr.margin, bkr.save_mode, | ||||
| bkr.is_clear, bkr.is_split_materials, bkr.is_automatic_name, true, bkr.is_cage, | bkr.is_clear, bkr.is_split_materials, bkr.is_automatic_name, true, bkr.is_average_normals, bkr.is_cage, | ||||
| bkr.cage_extrusion, bkr.normal_space, bkr.normal_swizzle, | bkr.cage_extrusion, bkr.normal_space, bkr.normal_swizzle, | ||||
| bkr.custom_cage, bkr.filepath, bkr.width, bkr.height, bkr.identifier, bkr.sa, | bkr.custom_cage, bkr.filepath, bkr.width, bkr.height, bkr.identifier, bkr.sa, | ||||
| bkr.uv_layer); | bkr.uv_layer); | ||||
| Context not available. | |||||
| result = bake( | result = bake( | ||||
| bkr.render, bkr.main, bkr.scene, ob_iter, NULL, bkr.reports, | bkr.render, bkr.main, bkr.scene, ob_iter, NULL, bkr.reports, | ||||
| bkr.pass_type, bkr.pass_filter, bkr.margin, bkr.save_mode, | bkr.pass_type, bkr.pass_filter, bkr.margin, bkr.save_mode, | ||||
| is_clear, bkr.is_split_materials, bkr.is_automatic_name, false, bkr.is_cage, | is_clear, bkr.is_split_materials, bkr.is_automatic_name, false, bkr.is_average_normals, bkr.is_cage, | ||||
| bkr.cage_extrusion, bkr.normal_space, bkr.normal_swizzle, | bkr.cage_extrusion, bkr.normal_space, bkr.normal_swizzle, | ||||
| bkr.custom_cage, bkr.filepath, bkr.width, bkr.height, bkr.identifier, bkr.sa, | bkr.custom_cage, bkr.filepath, bkr.width, bkr.height, bkr.identifier, bkr.sa, | ||||
| bkr.uv_layer); | bkr.uv_layer); | ||||
| Context not available. | |||||
| bkr->result = bake( | bkr->result = bake( | ||||
| bkr->render, bkr->main, bkr->scene, bkr->ob, &bkr->selected_objects, bkr->reports, | bkr->render, bkr->main, bkr->scene, bkr->ob, &bkr->selected_objects, bkr->reports, | ||||
| bkr->pass_type, bkr->pass_filter, bkr->margin, bkr->save_mode, | bkr->pass_type, bkr->pass_filter, bkr->margin, bkr->save_mode, | ||||
| bkr->is_clear, bkr->is_split_materials, bkr->is_automatic_name, true, bkr->is_cage, | bkr->is_clear, bkr->is_split_materials, bkr->is_automatic_name, true, bkr->is_average_normals, bkr->is_cage, | ||||
| bkr->cage_extrusion, bkr->normal_space, bkr->normal_swizzle, | bkr->cage_extrusion, bkr->normal_space, bkr->normal_swizzle, | ||||
| bkr->custom_cage, bkr->filepath, bkr->width, bkr->height, bkr->identifier, bkr->sa, | bkr->custom_cage, bkr->filepath, bkr->width, bkr->height, bkr->identifier, bkr->sa, | ||||
| bkr->uv_layer); | bkr->uv_layer); | ||||
| Context not available. | |||||
| bkr->result = bake( | bkr->result = bake( | ||||
| bkr->render, bkr->main, bkr->scene, ob_iter, NULL, bkr->reports, | bkr->render, bkr->main, bkr->scene, ob_iter, NULL, bkr->reports, | ||||
| bkr->pass_type, bkr->pass_filter, bkr->margin, bkr->save_mode, | bkr->pass_type, bkr->pass_filter, bkr->margin, bkr->save_mode, | ||||
| is_clear, bkr->is_split_materials, bkr->is_automatic_name, false, bkr->is_cage, | is_clear, bkr->is_split_materials, bkr->is_automatic_name, false, bkr->is_average_normals, bkr->is_cage, | ||||
| bkr->cage_extrusion, bkr->normal_space, bkr->normal_swizzle, | bkr->cage_extrusion, bkr->normal_space, bkr->normal_swizzle, | ||||
| bkr->custom_cage, bkr->filepath, bkr->width, bkr->height, bkr->identifier, bkr->sa, | bkr->custom_cage, bkr->filepath, bkr->width, bkr->height, bkr->identifier, bkr->sa, | ||||
| bkr->uv_layer); | bkr->uv_layer); | ||||
| Context not available. | |||||
| if (!RNA_property_is_set(op->ptr, prop)) { | if (!RNA_property_is_set(op->ptr, prop)) { | ||||
| RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_CAGE) != 0); | RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_CAGE) != 0); | ||||
| } | } | ||||
| prop = RNA_struct_find_property(op->ptr, "use_average_normals"); | |||||
| if (!RNA_property_is_set(op->ptr, prop)) { | |||||
| RNA_property_boolean_set(op->ptr, prop, (bake->flag & R_BAKE_AVG_NORMALS) != 0); | |||||
| } | |||||
| prop = RNA_struct_find_property(op->ptr, "use_split_materials"); | prop = RNA_struct_find_property(op->ptr, "use_split_materials"); | ||||
| if (!RNA_property_is_set(op->ptr, prop)) { | if (!RNA_property_is_set(op->ptr, prop)) { | ||||
| Context not available. | |||||
| "Choose how to save the baking map"); | "Choose how to save the baking map"); | ||||
| RNA_def_boolean(ot->srna, "use_clear", false, "Clear", | RNA_def_boolean(ot->srna, "use_clear", false, "Clear", | ||||
| "Clear Images before baking (only for internal saving)"); | "Clear Images before baking (only for internal saving)"); | ||||
| RNA_def_boolean(ot->srna, "use_average_normals", false, "Average Normals", | |||||
| "Use an average of all the normals at a given position to do the projection"); | |||||
brecht: This should have an explanation of why this is needed.
Do you think this should be enabled by… | |||||
MacroAuthorUnsubmitted Not Done Inline ActionsAre you sure you want an explanation of why is needed there? Do you think this should be enabled by default? Macro: Are you sure you want an explanation of why is needed there?
All other properties seem to have… | |||||
brechtUnsubmitted Not Done Inline ActionsThe explanation could be as short as: "Use smooth averaged normals for projection, to avoid continuity artifacts around sharp edges." brecht: The explanation could be as short as: "Use smooth averaged normals for projection, to avoid… | |||||
| RNA_def_boolean(ot->srna, "use_cage", false, "Cage", | RNA_def_boolean(ot->srna, "use_cage", false, "Cage", | ||||
| "Cast rays to active object from a cage"); | "Cast rays to active object from a cage"); | ||||
| RNA_def_boolean(ot->srna, "use_split_materials", false, "Split Materials", | RNA_def_boolean(ot->srna, "use_split_materials", false, "Split Materials", | ||||
| Context not available. | |||||
This should have an explanation of why this is needed.
Do you think this should be enabled by default?