Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_particle.c
| Show First 20 Lines • Show All 608 Lines • ▼ Show 20 Lines | else { | ||||
| psys_interpolate_mcol(&mc[num * 4], mface->v4, *fuv, &mcol); | psys_interpolate_mcol(&mc[num * 4], mface->v4, *fuv, &mcol); | ||||
| r_mcol[0] = (float)mcol.b / 255.0f; | r_mcol[0] = (float)mcol.b / 255.0f; | ||||
| r_mcol[1] = (float)mcol.g / 255.0f; | r_mcol[1] = (float)mcol.g / 255.0f; | ||||
| r_mcol[2] = (float)mcol.r / 255.0f; | r_mcol[2] = (float)mcol.r / 255.0f; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Scene *scene, SceneLayer *scene_layer, Object *object, int resolution) | static void rna_ParticleSystem_set_resolution(ParticleSystem *particlesystem, Scene *scene, ViewLayer *view_layer, Object *object, int resolution) | ||||
| { | { | ||||
| EvaluationContext eval_ctx; | EvaluationContext eval_ctx; | ||||
| DEG_evaluation_context_init(&eval_ctx, resolution); | DEG_evaluation_context_init(&eval_ctx, resolution); | ||||
| eval_ctx.ctime = (float)scene->r.cfra + scene->r.subframe; | eval_ctx.ctime = (float)scene->r.cfra + scene->r.subframe; | ||||
| eval_ctx.scene_layer = scene_layer; | eval_ctx.view_layer = view_layer; | ||||
| if (resolution == eModifierMode_Render) { | if (resolution == eModifierMode_Render) { | ||||
| ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem); | ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem); | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| unit_m4(mat); | unit_m4(mat); | ||||
| psys_render_set(object, particlesystem, mat, mat, 1, 1, 0.f); | psys_render_set(object, particlesystem, mat, mat, 1, 1, 0.f); | ||||
| ▲ Show 20 Lines • Show All 2,920 Lines • ▼ Show 20 Lines | #endif | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_struct_path_func(srna, "rna_ParticleSystem_path"); | RNA_def_struct_path_func(srna, "rna_ParticleSystem_path"); | ||||
| /* set viewport or render resolution */ | /* set viewport or render resolution */ | ||||
| func = RNA_def_function(srna, "set_resolution", "rna_ParticleSystem_set_resolution"); | func = RNA_def_function(srna, "set_resolution", "rna_ParticleSystem_set_resolution"); | ||||
| RNA_def_function_ui_description(func, "Set the resolution to use for the number of particles"); | RNA_def_function_ui_description(func, "Set the resolution to use for the number of particles"); | ||||
| RNA_def_pointer(func, "scene", "Scene", "", "Scene"); | RNA_def_pointer(func, "scene", "Scene", "", "Scene"); | ||||
| RNA_def_pointer(func, "scene_layer", "SceneLayer", "", "SceneLayer"); | RNA_def_pointer(func, "view_layer", "ViewLayer", "", "ViewLayer"); | ||||
| RNA_def_pointer(func, "object", "Object", "", "Object"); | RNA_def_pointer(func, "object", "Object", "", "Object"); | ||||
| RNA_def_enum(func, "resolution", resolution_items, 0, "", "Resolution settings to apply"); | RNA_def_enum(func, "resolution", resolution_items, 0, "", "Resolution settings to apply"); | ||||
| /* extract cached hair location data */ | /* extract cached hair location data */ | ||||
| func = RNA_def_function(srna, "co_hair", "rna_ParticleSystem_co_hair"); | func = RNA_def_function(srna, "co_hair", "rna_ParticleSystem_co_hair"); | ||||
| RNA_def_function_ui_description(func, "Obtain cache hair data"); | RNA_def_function_ui_description(func, "Obtain cache hair data"); | ||||
| parm = RNA_def_pointer(func, "object", "Object", "", "Object"); | parm = RNA_def_pointer(func, "object", "Object", "", "Object"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||