Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/writefile.c
| Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | |||||
| #include "DNA_cachefile_types.h" | #include "DNA_cachefile_types.h" | ||||
| #include "DNA_camera_types.h" | #include "DNA_camera_types.h" | ||||
| #include "DNA_cloth_types.h" | #include "DNA_cloth_types.h" | ||||
| #include "DNA_constraint_types.h" | #include "DNA_constraint_types.h" | ||||
| #include "DNA_dynamicpaint_types.h" | #include "DNA_dynamicpaint_types.h" | ||||
| #include "DNA_genfile.h" | #include "DNA_genfile.h" | ||||
| #include "DNA_group_types.h" | #include "DNA_group_types.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_gpencil_modifier_types.h" | |||||
| #include "DNA_fileglobal_types.h" | #include "DNA_fileglobal_types.h" | ||||
| #include "DNA_key_types.h" | #include "DNA_key_types.h" | ||||
| #include "DNA_lattice_types.h" | #include "DNA_lattice_types.h" | ||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_layer_types.h" | #include "DNA_layer_types.h" | ||||
| #include "DNA_linestyle_types.h" | #include "DNA_linestyle_types.h" | ||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| Show All 31 Lines | |||||
| #include "BKE_action.h" | #include "BKE_action.h" | ||||
| #include "BKE_blender_version.h" | #include "BKE_blender_version.h" | ||||
| #include "BKE_bpath.h" | #include "BKE_bpath.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_constraint.h" | #include "BKE_constraint.h" | ||||
| #include "BKE_global.h" // for G | #include "BKE_global.h" // for G | ||||
| #include "BKE_gpencil_modifier.h" | |||||
| #include "BKE_idcode.h" | #include "BKE_idcode.h" | ||||
| #include "BKE_library.h" // for set_listbasepointers | #include "BKE_library.h" // for set_listbasepointers | ||||
| #include "BKE_library_override.h" | #include "BKE_library_override.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_sequencer.h" | #include "BKE_sequencer.h" | ||||
| #include "BKE_subsurf.h" | #include "BKE_subsurf.h" | ||||
| ▲ Show 20 Lines • Show All 1,432 Lines • ▼ Show 20 Lines | if (md->type == eModifierType_Hook) { | ||||
| HookModifierData *hmd = (HookModifierData *)md; | HookModifierData *hmd = (HookModifierData *)md; | ||||
| if (hmd->curfalloff) { | if (hmd->curfalloff) { | ||||
| write_curvemapping(wd, hmd->curfalloff); | write_curvemapping(wd, hmd->curfalloff); | ||||
| } | } | ||||
| writedata(wd, DATA, sizeof(int) * hmd->totindex, hmd->indexar); | writedata(wd, DATA, sizeof(int) * hmd->totindex, hmd->indexar); | ||||
| } | } | ||||
| else if (md->type == eModifierType_Gpencil_Thick) { | |||||
| ThickGpencilModifierData *gpmd = (ThickGpencilModifierData *)md; | |||||
| if (gpmd->curve_thickness) { | |||||
| write_curvemapping(wd, gpmd->curve_thickness); | |||||
| } | |||||
| } | |||||
| else if (md->type == eModifierType_Gpencil_Hook) { | |||||
| HookGpencilModifierData *gpmd = (HookGpencilModifierData *)md; | |||||
| if (gpmd->curfalloff) { | |||||
| write_curvemapping(wd, gpmd->curfalloff); | |||||
| } | |||||
| } | |||||
| else if (md->type == eModifierType_Cloth) { | else if (md->type == eModifierType_Cloth) { | ||||
| ClothModifierData *clmd = (ClothModifierData *)md; | ClothModifierData *clmd = (ClothModifierData *)md; | ||||
| writestruct(wd, DATA, ClothSimSettings, 1, clmd->sim_parms); | writestruct(wd, DATA, ClothSimSettings, 1, clmd->sim_parms); | ||||
| writestruct(wd, DATA, ClothCollSettings, 1, clmd->coll_parms); | writestruct(wd, DATA, ClothCollSettings, 1, clmd->coll_parms); | ||||
| writestruct(wd, DATA, EffectorWeights, 1, clmd->sim_parms->effector_weights); | writestruct(wd, DATA, EffectorWeights, 1, clmd->sim_parms->effector_weights); | ||||
| write_pointcaches(wd, &clmd->ptcaches); | write_pointcaches(wd, &clmd->ptcaches); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | else if (md->type == eModifierType_SurfaceDeform) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void write_gpencil_modifiers(WriteData *wd, ListBase *modbase) | |||||
| { | |||||
| GpencilModifierData *md; | |||||
| if (modbase == NULL) { | |||||
| return; | |||||
| } | |||||
| for (md = modbase->first; md; md = md->next) { | |||||
| const GpencilModifierTypeInfo *mti = BKE_gpencil_modifierType_getInfo(md->type); | |||||
| if (mti == NULL) { | |||||
| return; | |||||
| } | |||||
| writestruct_id(wd, DATA, mti->struct_name, 1, md); | |||||
| if (md->type == eGpencilModifierType_Thick) { | |||||
| ThickGpencilModifierData *gpmd = (ThickGpencilModifierData *)md; | |||||
| if (gpmd->curve_thickness) { | |||||
| write_curvemapping(wd, gpmd->curve_thickness); | |||||
| } | |||||
| } | |||||
| else if (md->type == eGpencilModifierType_Hook) { | |||||
| HookGpencilModifierData *gpmd = (HookGpencilModifierData *)md; | |||||
| if (gpmd->curfalloff) { | |||||
| write_curvemapping(wd, gpmd->curfalloff); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| static void write_object(WriteData *wd, Object *ob) | static void write_object(WriteData *wd, Object *ob) | ||||
| { | { | ||||
| if (ob->id.us > 0 || wd->use_memfile) { | if (ob->id.us > 0 || wd->use_memfile) { | ||||
| /* write LibData */ | /* write LibData */ | ||||
| writestruct(wd, ID_OB, Object, 1, ob); | writestruct(wd, ID_OB, Object, 1, ob); | ||||
| write_iddata(wd, &ob->id); | write_iddata(wd, &ob->id); | ||||
| if (ob->adt) { | if (ob->adt) { | ||||
| Show All 34 Lines | if (ob->id.us > 0 || wd->use_memfile) { | ||||
| } | } | ||||
| if (ob->type == OB_EMPTY && ob->empty_drawtype == OB_EMPTY_IMAGE) { | if (ob->type == OB_EMPTY && ob->empty_drawtype == OB_EMPTY_IMAGE) { | ||||
| writestruct(wd, DATA, ImageUser, 1, ob->iuser); | writestruct(wd, DATA, ImageUser, 1, ob->iuser); | ||||
| } | } | ||||
| write_particlesystems(wd, &ob->particlesystem); | write_particlesystems(wd, &ob->particlesystem); | ||||
| write_modifiers(wd, &ob->modifiers); | write_modifiers(wd, &ob->modifiers); | ||||
| write_gpencil_modifiers(wd, &ob->greasepencil_modifiers); | |||||
| writelist(wd, DATA, LinkData, &ob->pc_ids); | writelist(wd, DATA, LinkData, &ob->pc_ids); | ||||
| writelist(wd, DATA, LodLevel, &ob->lodlevels); | writelist(wd, DATA, LodLevel, &ob->lodlevels); | ||||
| write_previews(wd, ob->preview); | write_previews(wd, ob->preview); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,352 Lines • Show Last 20 Lines | |||||