Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_particle.c
| Show First 20 Lines • Show All 1,289 Lines • ▼ Show 20 Lines | |||||
| #else | #else | ||||
| static void rna_def_particle_hair_key(BlenderRNA *brna) | static void rna_def_particle_hair_key(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| srna = RNA_def_struct(brna, "ParticleHairKey", NULL); | srna = RNA_def_struct(brna, "ParticleHairKey", NULL); | ||||
| RNA_def_struct_sdna(srna, "HairKey"); | RNA_def_struct_sdna(srna, "HairKey"); | ||||
| RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system"); | RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system"); | ||||
| prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); | ||||
| RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length"); | RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length"); | ||||
| Show All 11 Lines | static void rna_def_particle_hair_key(BlenderRNA *brna) | ||||
| RNA_def_property_float_sdna(prop, NULL, "co"); | RNA_def_property_float_sdna(prop, NULL, "co"); | ||||
| RNA_def_property_ui_text(prop, "Location", | RNA_def_property_ui_text(prop, "Location", | ||||
| "Location of the hair key in its local coordinate system, " | "Location of the hair key in its local coordinate system, " | ||||
| "relative to the emitting face"); | "relative to the emitting face"); | ||||
| /* Aided co func */ | /* Aided co func */ | ||||
| func = RNA_def_function(srna, "co_object", "rna_ParticleHairKey_co_object"); | func = RNA_def_function(srna, "co_object", "rna_ParticleHairKey_co_object"); | ||||
| RNA_def_function_ui_description(func, "Obtain hairkey location with particle and modifier data"); | RNA_def_function_ui_description(func, "Obtain hairkey location with particle and modifier data"); | ||||
| parm = RNA_def_pointer(func, "object", "Object", "", "Object"); | |||||
| prop = RNA_def_pointer(func, "object", "Object", "", "Object"); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | ||||
| prop = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | parm = RNA_def_pointer(func, "particle", "Particle", "", "hair particle"); | ||||
| prop = RNA_def_pointer(func, "particle", "Particle", "", "hair particle"); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | parm = RNA_def_float_vector(func, "co", 3, NULL, -FLT_MAX, FLT_MAX, "Co", | ||||
| prop = RNA_def_float_vector(func, "co", 3, NULL, -FLT_MAX, FLT_MAX, "Co", | |||||
| "Exported hairkey location", -1e4, 1e4); | "Exported hairkey location", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| } | } | ||||
| static void rna_def_particle_key(BlenderRNA *brna) | static void rna_def_particle_key(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "ParticleKey", NULL); | srna = RNA_def_struct(brna, "ParticleKey", NULL); | ||||
| Show All 35 Lines | |||||
| /* float fuv[4], foffset; *//* face vertex weights and offset */ | /* float fuv[4], foffset; *//* face vertex weights and offset */ | ||||
| /* float rand[3]; */ | /* float rand[3]; */ | ||||
| } | } | ||||
| static void rna_def_particle(BlenderRNA *brna) | static void rna_def_particle(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| static EnumPropertyItem alive_items[] = { | static EnumPropertyItem alive_items[] = { | ||||
| /*{PARS_KILLED, "KILLED", 0, "Killed", ""}, */ | /*{PARS_KILLED, "KILLED", 0, "Killed", ""}, */ | ||||
| {PARS_DEAD, "DEAD", 0, "Dead", ""}, | {PARS_DEAD, "DEAD", 0, "Dead", ""}, | ||||
| {PARS_UNBORN, "UNBORN", 0, "Unborn", ""}, | {PARS_UNBORN, "UNBORN", 0, "Unborn", ""}, | ||||
| {PARS_ALIVE, "ALIVE", 0, "Alive", ""}, | {PARS_ALIVE, "ALIVE", 0, "Alive", ""}, | ||||
| {PARS_DYING, "DYING", 0, "Dying", ""}, | {PARS_DYING, "DYING", 0, "Dying", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | /* int totkey; */ | ||||
| RNA_def_property_ui_text(prop, "Alive State", ""); | RNA_def_property_ui_text(prop, "Alive State", ""); | ||||
| /* short rt2; */ | /* short rt2; */ | ||||
| /* UVs */ | /* UVs */ | ||||
| func = RNA_def_function(srna, "uv_on_emitter", "rna_Particle_uv_on_emitter"); | func = RNA_def_function(srna, "uv_on_emitter", "rna_Particle_uv_on_emitter"); | ||||
| RNA_def_function_ui_description(func, "Obtain uv for particle on derived mesh"); | RNA_def_function_ui_description(func, "Obtain uv for particle on derived mesh"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| prop = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| prop = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS); | parm = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS); | ||||
| RNA_def_property_array(prop, 2); | RNA_def_property_array(parm, 2); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| } | } | ||||
| static void rna_def_particle_dupliweight(BlenderRNA *brna) | static void rna_def_particle_dupliweight(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "ParticleDupliWeight", NULL); | srna = RNA_def_struct(brna, "ParticleDupliWeight", NULL); | ||||
| ▲ Show 20 Lines • Show All 1,676 Lines • ▼ Show 20 Lines | static void rna_def_particle_target(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Mode", ""); | RNA_def_property_ui_text(prop, "Mode", ""); | ||||
| RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); | RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); | ||||
| } | } | ||||
| static void rna_def_particle_system(BlenderRNA *brna) | static void rna_def_particle_system(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | |||||
| static EnumPropertyItem resolution_items[] = { | static EnumPropertyItem resolution_items[] = { | ||||
| {eModifierMode_Realtime, "PREVIEW", 0, "Preview", "Apply modifier preview settings"}, | {eModifierMode_Realtime, "PREVIEW", 0, "Preview", "Apply modifier preview settings"}, | ||||
| {eModifierMode_Render, "RENDER", 0, "Render", "Apply modifier render settings"}, | {eModifierMode_Render, "RENDER", 0, "Render", "Apply modifier render settings"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "ParticleSystem", NULL); | srna = RNA_def_struct(brna, "ParticleSystem", NULL); | ||||
| ▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | #endif | ||||
| RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame"); | RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame"); | ||||
| 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"); | ||||
| prop = RNA_def_pointer(func, "scene", "Scene", "", "Scene"); | RNA_def_pointer(func, "scene", "Scene", "", "Scene"); | ||||
| prop = RNA_def_pointer(func, "object", "Object", "", "Object"); | RNA_def_pointer(func, "object", "Object", "", "Object"); | ||||
| prop = 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"); | |||||
| prop = RNA_def_pointer(func, "object", "Object", "", "Object"); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); | ||||
| prop = RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); | RNA_def_int(func, "step", 0, INT_MIN, INT_MAX, "step no", "", INT_MIN, INT_MAX); | ||||
| prop = RNA_def_int(func, "step", 0, INT_MIN, INT_MAX, "step no", "", INT_MIN, INT_MAX); | parm = RNA_def_float_vector(func, "co", 3, NULL, -FLT_MAX, FLT_MAX, "Co", | ||||
| prop = RNA_def_float_vector(func, "co", 3, NULL, -FLT_MAX, FLT_MAX, "Co", | |||||
| "Exported hairkey location", -1e4, 1e4); | "Exported hairkey location", -1e4, 1e4); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| /* extract hair UVs */ | /* extract hair UVs */ | ||||
| func = RNA_def_function(srna, "uv_on_emitter", "rna_ParticleSystem_uv_on_emitter"); | func = RNA_def_function(srna, "uv_on_emitter", "rna_ParticleSystem_uv_on_emitter"); | ||||
| RNA_def_function_ui_description(func, "Obtain uv for all particles"); | RNA_def_function_ui_description(func, "Obtain uv for all particles"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| prop = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| prop = RNA_def_pointer(func, "particle", "Particle", "", "Particle"); | prop = RNA_def_pointer(func, "particle", "Particle", "", "Particle"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); | RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); | ||||
| prop = RNA_def_int(func, "uv_no", 0, INT_MIN, INT_MAX, "UV no", "", INT_MIN, INT_MAX); | RNA_def_int(func, "uv_no", 0, INT_MIN, INT_MAX, "UV no", "", INT_MIN, INT_MAX); | ||||
| prop = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS); | parm = RNA_def_property(func, "uv", PROP_FLOAT, PROP_COORDS); | ||||
| RNA_def_property_array(prop, 2); | RNA_def_property_array(parm, 2); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| /* extract hair mcols */ | /* extract hair mcols */ | ||||
| func = RNA_def_function(srna, "mcol_on_emitter", "rna_ParticleSystem_mcol_on_emitter"); | func = RNA_def_function(srna, "mcol_on_emitter", "rna_ParticleSystem_mcol_on_emitter"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Obtain mcol for all particles"); | RNA_def_function_ui_description(func, "Obtain mcol for all particles"); | ||||
| prop = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | parm = RNA_def_pointer(func, "modifier", "ParticleSystemModifier", "", "Particle modifier"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| prop = RNA_def_pointer(func, "particle", "Particle", "", "Particle"); | parm = RNA_def_pointer(func, "particle", "Particle", "", "Particle"); | ||||
| RNA_def_property_flag(prop, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| prop = RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); | RNA_def_int(func, "particle_no", 0, INT_MIN, INT_MAX, "Particle no", "", INT_MIN, INT_MAX); | ||||
| prop = RNA_def_int(func, "vcol_no", 0, INT_MIN, INT_MAX, "vcol no", "", INT_MIN, INT_MAX); | RNA_def_int(func, "vcol_no", 0, INT_MIN, INT_MAX, "vcol no", "", INT_MIN, INT_MAX); | ||||
| prop = RNA_def_property(func, "mcol", PROP_FLOAT, PROP_COLOR); | parm = RNA_def_property(func, "mcol", PROP_FLOAT, PROP_COLOR); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(parm, 3); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, prop); | RNA_def_function_output(func, parm); | ||||
| } | } | ||||
| void RNA_def_particle(BlenderRNA *brna) | void RNA_def_particle(BlenderRNA *brna) | ||||
| { | { | ||||
| rna_def_particle_target(brna); | rna_def_particle_target(brna); | ||||
| rna_def_fluid_settings(brna); | rna_def_fluid_settings(brna); | ||||
| rna_def_particle_hair_key(brna); | rna_def_particle_hair_key(brna); | ||||
| Show All 11 Lines | |||||