Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_texture_api.c
| Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| func = RNA_def_function(srna, "evaluate", "texture_evaluate"); | func = RNA_def_function(srna, "evaluate", "texture_evaluate"); | ||||
| RNA_def_function_ui_description(func, "Evaluate the texture at the coordinates given"); | RNA_def_function_ui_description(func, "Evaluate the texture at the coordinates given"); | ||||
| parm = RNA_def_float_vector(func, "value", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); | parm = RNA_def_float_vector(func, "value", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* return location and normal */ | /* return location and normal */ | ||||
| parm = RNA_def_float_vector(func, "result", 4, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); | parm = RNA_def_float_vector(func, "result", 4, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); | ||||
| RNA_def_property_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, parm); | RNA_def_function_output(func, parm); | ||||
| } | } | ||||
| void RNA_api_environment_map(StructRNA *srna) | void RNA_api_environment_map(StructRNA *srna) | ||||
| { | { | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| static const float default_layout[] = {0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1}; | static const float default_layout[] = {0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1}; | ||||
| func = RNA_def_function(srna, "clear", "clear_envmap"); | func = RNA_def_function(srna, "clear", "clear_envmap"); | ||||
| RNA_def_function_ui_description(func, "Discard the environment map and free it from memory"); | RNA_def_function_ui_description(func, "Discard the environment map and free it from memory"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| func = RNA_def_function(srna, "save", "save_envmap"); | func = RNA_def_function(srna, "save", "save_envmap"); | ||||
| RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings"); | RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | ||||
| parm = RNA_def_string_file_name(func, "filepath", NULL, FILE_MAX, "File path", "Location of the output file"); | parm = RNA_def_string_file_name(func, "filepath", NULL, FILE_MAX, "File path", "Location of the output file"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken"); | RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken"); | ||||
| RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 1000.0f, "File layout", | RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 1000.0f, "File layout", | ||||
| "Flat array describing the X,Y position of each cube face in the " | "Flat array describing the X,Y position of each cube face in the " | ||||
| "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " | "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " | ||||
| "(use -1 to skip a face)", 0.0f, 1000.0f); | "(use -1 to skip a face)", 0.0f, 1000.0f); | ||||
| } | } | ||||
| #endif | #endif | ||||