OLD | NEW |
1 /* | 1 /* |
2 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
6 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
7 * of the License, or (at your option) any later version. | 7 * of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #include "DNA_dynamicpaint_types.h" | 64 #include "DNA_dynamicpaint_types.h" |
65 #include "DNA_effect_types.h" | 65 #include "DNA_effect_types.h" |
66 #include "DNA_fileglobal_types.h" | 66 #include "DNA_fileglobal_types.h" |
67 #include "DNA_genfile.h" | 67 #include "DNA_genfile.h" |
68 #include "DNA_group_types.h" | 68 #include "DNA_group_types.h" |
69 #include "DNA_gpencil_types.h" | 69 #include "DNA_gpencil_types.h" |
70 #include "DNA_ipo_types.h" | 70 #include "DNA_ipo_types.h" |
71 #include "DNA_key_types.h" | 71 #include "DNA_key_types.h" |
72 #include "DNA_lattice_types.h" | 72 #include "DNA_lattice_types.h" |
73 #include "DNA_lamp_types.h" | 73 #include "DNA_lamp_types.h" |
| 74 #ifdef WITH_FREESTYLE |
| 75 # include "DNA_linestyle_types.h" |
| 76 #endif |
74 #include "DNA_meta_types.h" | 77 #include "DNA_meta_types.h" |
75 #include "DNA_material_types.h" | 78 #include "DNA_material_types.h" |
76 #include "DNA_mesh_types.h" | 79 #include "DNA_mesh_types.h" |
77 #include "DNA_meshdata_types.h" | 80 #include "DNA_meshdata_types.h" |
78 #include "DNA_nla_types.h" | 81 #include "DNA_nla_types.h" |
79 #include "DNA_node_types.h" | 82 #include "DNA_node_types.h" |
80 #include "DNA_object_fluidsim.h" // NT | 83 #include "DNA_object_fluidsim.h" // NT |
81 #include "DNA_object_types.h" | 84 #include "DNA_object_types.h" |
82 #include "DNA_packedFile_types.h" | 85 #include "DNA_packedFile_types.h" |
83 #include "DNA_particle_types.h" | 86 #include "DNA_particle_types.h" |
(...skipping 4955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5039 } | 5042 } |
5040 ························ | 5043 ························ |
5041 if (sce->nodetree) { | 5044 if (sce->nodetree) { |
5042 lib_link_ntree(fd, &sce->id, sce->nodetree); | 5045 lib_link_ntree(fd, &sce->id, sce->nodetree); |
5043 composite_patch(sce->nodetree, sce); | 5046 composite_patch(sce->nodetree, sce); |
5044 } | 5047 } |
5045 ························ | 5048 ························ |
5046 for (srl = sce->r.layers.first; srl; srl = srl->next) { | 5049 for (srl = sce->r.layers.first; srl; srl = srl->next) { |
5047 srl->mat_override = newlibadr_us(fd, sce->id.lib
, srl->mat_override); | 5050 srl->mat_override = newlibadr_us(fd, sce->id.lib
, srl->mat_override); |
5048 srl->light_override = newlibadr_us(fd, sce->id.l
ib, srl->light_override); | 5051 srl->light_override = newlibadr_us(fd, sce->id.l
ib, srl->light_override); |
| 5052 #ifdef WITH_FREESTYLE |
| 5053 { |
| 5054 FreestyleLineSet *fls; |
| 5055 |
| 5056 for (fls = srl->freestyleConfig.linesets
.first; fls; fls = fls->next) { |
| 5057 fls->linestyle = newlibadr_us(fd
, sce->id.lib, fls->linestyle); |
| 5058 fls->group = newlibadr_us(fd, sc
e->id.lib, fls->group); |
| 5059 } |
| 5060 } |
| 5061 #endif |
5049 } | 5062 } |
5050 /*Game Settings: Dome Warp Text*/ | 5063 /*Game Settings: Dome Warp Text*/ |
5051 sce->gm.dome.warptext = newlibadr(fd, sce->id.lib, sce->
gm.dome.warptext); | 5064 sce->gm.dome.warptext = newlibadr(fd, sce->id.lib, sce->
gm.dome.warptext); |
5052 ························ | 5065 ························ |
5053 /* Motion Tracking */ | 5066 /* Motion Tracking */ |
5054 sce->clip = newlibadr_us(fd, sce->id.lib, sce->clip); | 5067 sce->clip = newlibadr_us(fd, sce->id.lib, sce->clip); |
5055 ························ | 5068 ························ |
5056 sce->id.flag -= LIB_NEED_LINK; | 5069 sce->id.flag -= LIB_NEED_LINK; |
5057 } | 5070 } |
5058 } | 5071 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5286 if (sce->r.ffcodecdata.properties) { | 5299 if (sce->r.ffcodecdata.properties) { |
5287 IDP_DirectLinkProperty(sce->r.ffcodecdata.properties,· | 5300 IDP_DirectLinkProperty(sce->r.ffcodecdata.properties,· |
5288 (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); | 5301 (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); |
5289 } | 5302 } |
5290 } | 5303 } |
5291 ········ | 5304 ········ |
5292 link_list(fd, &(sce->markers)); | 5305 link_list(fd, &(sce->markers)); |
5293 link_list(fd, &(sce->transform_spaces)); | 5306 link_list(fd, &(sce->transform_spaces)); |
5294 link_list(fd, &(sce->r.layers)); | 5307 link_list(fd, &(sce->r.layers)); |
5295 ········ | 5308 ········ |
| 5309 #ifdef WITH_FREESTYLE |
| 5310 { |
| 5311 SceneRenderLayer *srl; |
| 5312 |
| 5313 for(srl = sce->r.layers.first; srl; srl = srl->next) { |
| 5314 link_list(fd, &(srl->freestyleConfig.modules)); |
| 5315 } |
| 5316 for(srl = sce->r.layers.first; srl; srl = srl->next) { |
| 5317 link_list(fd, &(srl->freestyleConfig.linesets)); |
| 5318 } |
| 5319 } |
| 5320 #endif |
| 5321 ········ |
5296 sce->nodetree = newdataadr(fd, sce->nodetree); | 5322 sce->nodetree = newdataadr(fd, sce->nodetree); |
5297 if (sce->nodetree) { | 5323 if (sce->nodetree) { |
5298 direct_link_id(fd, &sce->nodetree->id); | 5324 direct_link_id(fd, &sce->nodetree->id); |
5299 direct_link_nodetree(fd, sce->nodetree); | 5325 direct_link_nodetree(fd, sce->nodetree); |
5300 } | 5326 } |
5301 | 5327 |
5302 direct_link_view_settings(fd, &sce->view_settings); | 5328 direct_link_view_settings(fd, &sce->view_settings); |
5303 ········ | 5329 ········ |
5304 sce->rigidbody_world = newdataadr(fd, sce->rigidbody_world); | 5330 sce->rigidbody_world = newdataadr(fd, sce->rigidbody_world); |
5305 rbw = sce->rigidbody_world; | 5331 rbw = sce->rigidbody_world; |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6578 spline = spline->next; | 6604 spline = spline->next; |
6579 } | 6605 } |
6580 } | 6606 } |
6581 | 6607 |
6582 mask->id.flag -= LIB_NEED_LINK; | 6608 mask->id.flag -= LIB_NEED_LINK; |
6583 } | 6609 } |
6584 mask = mask->id.next; | 6610 mask = mask->id.next; |
6585 } | 6611 } |
6586 } | 6612 } |
6587 | 6613 |
| 6614 #ifdef WITH_FREESTYLE |
| 6615 /* ************ READ LINE STYLE ***************** */ |
| 6616 |
| 6617 static void lib_link_linestyle(FileData *fd, Main *main) |
| 6618 { |
| 6619 FreestyleLineStyle *linestyle; |
| 6620 LineStyleModifier *m; |
| 6621 |
| 6622 linestyle = main->linestyle.first; |
| 6623 while (linestyle) { |
| 6624 if (linestyle->id.flag & LIB_NEED_LINK) { |
| 6625 linestyle->id.flag -= LIB_NEED_LINK; |
| 6626 |
| 6627 if (linestyle->id.properties) |
| 6628 IDP_LibLinkProperty(linestyle->id.properties, (f
d->flags & FD_FLAGS_SWITCH_ENDIAN), fd); |
| 6629 if (linestyle->adt) |
| 6630 lib_link_animdata(fd, &linestyle->id, linestyle-
>adt); |
| 6631 for (m = linestyle->color_modifiers.first; m; m = m->nex
t) { |
| 6632 switch (m->type) { |
| 6633 case LS_MODIFIER_DISTANCE_FROM_OBJECT: |
| 6634 { |
| 6635 LineStyleColorModifier_DistanceF
romObject *cm = (LineStyleColorModifier_DistanceFromObject *)m; |
| 6636 cm->target = newlibadr(fd, lines
tyle->id.lib, cm->target); |
| 6637 } |
| 6638 break; |
| 6639 } |
| 6640 } |
| 6641 for (m = linestyle->alpha_modifiers.first; m; m = m->nex
t){ |
| 6642 switch (m->type) { |
| 6643 case LS_MODIFIER_DISTANCE_FROM_OBJECT: |
| 6644 { |
| 6645 LineStyleAlphaModifier_DistanceF
romObject *am = (LineStyleAlphaModifier_DistanceFromObject *)m; |
| 6646 am->target = newlibadr(fd, lines
tyle->id.lib, am->target); |
| 6647 } |
| 6648 break; |
| 6649 } |
| 6650 } |
| 6651 for (m = linestyle->thickness_modifiers.first; m; m = m-
>next){ |
| 6652 switch (m->type) { |
| 6653 case LS_MODIFIER_DISTANCE_FROM_OBJECT: |
| 6654 { |
| 6655 LineStyleThicknessModifier_Dista
nceFromObject *tm = (LineStyleThicknessModifier_DistanceFromObject *)m; |
| 6656 tm->target = newlibadr(fd, lines
tyle->id.lib, tm->target); |
| 6657 } |
| 6658 break; |
| 6659 } |
| 6660 } |
| 6661 } |
| 6662 linestyle = linestyle->id.next; |
| 6663 } |
| 6664 } |
| 6665 |
| 6666 static void direct_link_linestyle_color_modifier(FileData *fd, LineStyleModifier
*modifier) |
| 6667 { |
| 6668 switch (modifier->type) { |
| 6669 case LS_MODIFIER_ALONG_STROKE: |
| 6670 { |
| 6671 LineStyleColorModifier_AlongStroke *m = (LineStyleColorM
odifier_AlongStroke *)modifier; |
| 6672 m->color_ramp = newdataadr(fd, m->color_ramp); |
| 6673 } |
| 6674 break; |
| 6675 case LS_MODIFIER_DISTANCE_FROM_CAMERA: |
| 6676 { |
| 6677 LineStyleColorModifier_DistanceFromCamera *m = (LineStyl
eColorModifier_DistanceFromCamera *)modifier; |
| 6678 m->color_ramp = newdataadr(fd, m->color_ramp); |
| 6679 } |
| 6680 break; |
| 6681 case LS_MODIFIER_DISTANCE_FROM_OBJECT: |
| 6682 { |
| 6683 LineStyleColorModifier_DistanceFromObject *m = (LineStyl
eColorModifier_DistanceFromObject *)modifier; |
| 6684 m->color_ramp = newdataadr(fd, m->color_ramp); |
| 6685 } |
| 6686 break; |
| 6687 case LS_MODIFIER_MATERIAL: |
| 6688 { |
| 6689 LineStyleColorModifier_Material *m = (LineStyleColorModi
fier_Material *)modifier; |
| 6690 m->color_ramp = newdataadr(fd, m->color_ramp); |
| 6691 } |
| 6692 break; |
| 6693 } |
| 6694 } |
| 6695 |
| 6696 static void direct_link_linestyle_alpha_modifier(FileData *fd, LineStyleModifier
*modifier) |
| 6697 { |
| 6698 switch (modifier->type) { |
| 6699 case LS_MODIFIER_ALONG_STROKE: |
| 6700 { |
| 6701 LineStyleAlphaModifier_AlongStroke *m = (LineStyleAlphaM
odifier_AlongStroke *)modifier; |
| 6702 m->curve = newdataadr(fd, m->curve); |
| 6703 direct_link_curvemapping(fd, m->curve); |
| 6704 } |
| 6705 break; |
| 6706 case LS_MODIFIER_DISTANCE_FROM_CAMERA: |
| 6707 { |
| 6708 LineStyleAlphaModifier_DistanceFromCamera *m = (LineStyl
eAlphaModifier_DistanceFromCamera *)modifier; |
| 6709 m->curve = newdataadr(fd, m->curve); |
| 6710 direct_link_curvemapping(fd, m->curve); |
| 6711 } |
| 6712 break; |
| 6713 case LS_MODIFIER_DISTANCE_FROM_OBJECT: |
| 6714 { |
| 6715 LineStyleAlphaModifier_DistanceFromObject *m = (LineStyl
eAlphaModifier_DistanceFromObject *)modifier; |
| 6716 m->curve = newdataadr(fd, m->curve); |
| 6717 direct_link_curvemapping(fd, m->curve); |
| 6718 } |
| 6719 break; |
| 6720 case LS_MODIFIER_MATERIAL: |
| 6721 { |
| 6722 LineStyleAlphaModifier_Material *m = (LineStyleAlphaModi
fier_Material *)modifier; |
| 6723 m->curve = newdataadr(fd, m->curve); |
| 6724 direct_link_curvemapping(fd, m->curve); |
| 6725 } |
| 6726 break; |
| 6727 } |
| 6728 } |
| 6729 |
| 6730 static void direct_link_linestyle_thickness_modifier(FileData *fd, LineStyleModi
fier *modifier) |
| 6731 { |
| 6732 switch (modifier->type) { |
| 6733 case LS_MODIFIER_ALONG_STROKE: |
| 6734 { |
| 6735 LineStyleThicknessModifier_AlongStroke *m = (LineStyleTh
icknessModifier_AlongStroke *)modifier; |
| 6736 m->curve = newdataadr(fd, m->curve); |
| 6737 direct_link_curvemapping(fd, m->curve); |
| 6738 } |
| 6739 break; |
| 6740 case LS_MODIFIER_DISTANCE_FROM_CAMERA: |
| 6741 { |
| 6742 LineStyleThicknessModifier_DistanceFromCamera *m = (Line
StyleThicknessModifier_DistanceFromCamera *)modifier; |
| 6743 m->curve = newdataadr(fd, m->curve); |
| 6744 direct_link_curvemapping(fd, m->curve); |
| 6745 } |
| 6746 break; |
| 6747 case LS_MODIFIER_DISTANCE_FROM_OBJECT: |
| 6748 { |
| 6749 LineStyleThicknessModifier_DistanceFromObject *m = (Line
StyleThicknessModifier_DistanceFromObject *)modifier; |
| 6750 m->curve = newdataadr(fd, m->curve); |
| 6751 direct_link_curvemapping(fd, m->curve); |
| 6752 } |
| 6753 break; |
| 6754 case LS_MODIFIER_MATERIAL: |
| 6755 { |
| 6756 LineStyleThicknessModifier_Material *m = (LineStyleThick
nessModifier_Material *)modifier; |
| 6757 m->curve = newdataadr(fd, m->curve); |
| 6758 direct_link_curvemapping(fd, m->curve); |
| 6759 } |
| 6760 break; |
| 6761 } |
| 6762 } |
| 6763 |
| 6764 static void direct_link_linestyle_geometry_modifier(FileData *UNUSED(fd), LineSt
yleModifier *UNUSED(modifier)) |
| 6765 { |
| 6766 } |
| 6767 |
| 6768 static void direct_link_linestyle(FileData *fd, FreestyleLineStyle *linestyle) |
| 6769 { |
| 6770 LineStyleModifier *modifier; |
| 6771 |
| 6772 linestyle->adt= newdataadr(fd, linestyle->adt); |
| 6773 direct_link_animdata(fd, linestyle->adt); |
| 6774 link_list(fd, &linestyle->color_modifiers); |
| 6775 for(modifier = linestyle->color_modifiers.first; modifier; modifier = mo
difier->next) |
| 6776 direct_link_linestyle_color_modifier(fd, modifier); |
| 6777 link_list(fd, &linestyle->alpha_modifiers); |
| 6778 for(modifier = linestyle->alpha_modifiers.first; modifier; modifier = mo
difier->next) |
| 6779 direct_link_linestyle_alpha_modifier(fd, modifier); |
| 6780 link_list(fd, &linestyle->thickness_modifiers); |
| 6781 for(modifier = linestyle->thickness_modifiers.first; modifier; modifier
= modifier->next) |
| 6782 direct_link_linestyle_thickness_modifier(fd, modifier); |
| 6783 link_list(fd, &linestyle->geometry_modifiers); |
| 6784 for(modifier = linestyle->geometry_modifiers.first; modifier; modifier =
modifier->next) |
| 6785 direct_link_linestyle_geometry_modifier(fd, modifier); |
| 6786 } |
| 6787 #endif |
| 6788 |
6588 /* ************** GENERAL & MAIN ******************** */ | 6789 /* ************** GENERAL & MAIN ******************** */ |
6589 | 6790 |
6590 | 6791 |
6591 static const char *dataname(short id_code) | 6792 static const char *dataname(short id_code) |
6592 { | 6793 { |
6593 switch (id_code) { | 6794 switch (id_code) { |
6594 case ID_OB: return "Data from OB"; | 6795 case ID_OB: return "Data from OB"; |
6595 case ID_ME: return "Data from ME"; | 6796 case ID_ME: return "Data from ME"; |
6596 case ID_IP: return "Data from IP"; | 6797 case ID_IP: return "Data from IP"; |
6597 case ID_SCE: return "Data from SCE"; | 6798 case ID_SCE: return "Data from SCE"; |
(...skipping 14 matching lines...) Expand all Loading... |
6612 case ID_SCR: return "Data from SCR"; | 6813 case ID_SCR: return "Data from SCR"; |
6613 case ID_VF: return "Data from VF"; | 6814 case ID_VF: return "Data from VF"; |
6614 case ID_TXT : return "Data from TXT"; | 6815 case ID_TXT : return "Data from TXT"; |
6615 case ID_SPK: return "Data from SPK"; | 6816 case ID_SPK: return "Data from SPK"; |
6616 case ID_SO: return "Data from SO"; | 6817 case ID_SO: return "Data from SO"; |
6617 case ID_NT: return "Data from NT"; | 6818 case ID_NT: return "Data from NT"; |
6618 case ID_BR: return "Data from BR"; | 6819 case ID_BR: return "Data from BR"; |
6619 case ID_PA: return "Data from PA"; | 6820 case ID_PA: return "Data from PA"; |
6620 case ID_GD: return "Data from GD"; | 6821 case ID_GD: return "Data from GD"; |
6621 case ID_MC: return "Data from MC"; | 6822 case ID_MC: return "Data from MC"; |
| 6823 #ifdef WITH_FREESTYLE |
| 6824 case ID_LS: return "Data from LS"; |
| 6825 #endif |
6622 } | 6826 } |
6623 return "Data from Lib Block"; | 6827 return "Data from Lib Block"; |
6624 ········ | 6828 ········ |
6625 } | 6829 } |
6626 | 6830 |
6627 static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, const char *a
llocname) | 6831 static BHead *read_data_into_oldnewmap(FileData *fd, BHead *bhead, const char *a
llocname) |
6628 { | 6832 { |
6629 bhead = blo_nextbhead(fd, bhead); | 6833 bhead = blo_nextbhead(fd, bhead); |
6630 ········ | 6834 ········ |
6631 while (bhead && bhead->code==DATA) { | 6835 while (bhead && bhead->code==DATA) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6788 break; | 6992 break; |
6789 case ID_GD: | 6993 case ID_GD: |
6790 direct_link_gpencil(fd, (bGPdata *)id); | 6994 direct_link_gpencil(fd, (bGPdata *)id); |
6791 break; | 6995 break; |
6792 case ID_MC: | 6996 case ID_MC: |
6793 direct_link_movieclip(fd, (MovieClip *)id); | 6997 direct_link_movieclip(fd, (MovieClip *)id); |
6794 break; | 6998 break; |
6795 case ID_MSK: | 6999 case ID_MSK: |
6796 direct_link_mask(fd, (Mask *)id); | 7000 direct_link_mask(fd, (Mask *)id); |
6797 break; | 7001 break; |
| 7002 #ifdef WITH_FREESTYLE |
| 7003 case ID_LS: |
| 7004 direct_link_linestyle(fd, (FreestyleLineStyle *)id); |
| 7005 break; |
| 7006 #endif |
6798 } | 7007 } |
6799 ········ | 7008 ········ |
6800 oldnewmap_free_unused(fd->datamap); | 7009 oldnewmap_free_unused(fd->datamap); |
6801 oldnewmap_clear(fd->datamap); | 7010 oldnewmap_clear(fd->datamap); |
6802 ········ | 7011 ········ |
6803 return (bhead); | 7012 return (bhead); |
6804 } | 7013 } |
6805 | 7014 |
6806 /* note, this has to be kept for reading older files... */ | 7015 /* note, this has to be kept for reading older files... */ |
6807 /* also version info is written here */ | 7016 /* also version info is written here */ |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8813 ntreetype = ntreeGetType(NTREE_COMPOSIT); | 9022 ntreetype = ntreeGetType(NTREE_COMPOSIT); |
8814 if (ntreetype && ntreetype->foreach_nodetree) | 9023 if (ntreetype && ntreetype->foreach_nodetree) |
8815 ntreetype->foreach_nodetree(main, NULL, do_version_node_
fix_translate_wrapping); | 9024 ntreetype->foreach_nodetree(main, NULL, do_version_node_
fix_translate_wrapping); |
8816 | 9025 |
8817 for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next
) | 9026 for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next
) |
8818 do_version_node_fix_translate_wrapping(NULL, NULL, ntree
); | 9027 do_version_node_fix_translate_wrapping(NULL, NULL, ntree
); |
8819 } | 9028 } |
8820 | 9029 |
8821 // if (main->versionfile < 265 || (main->versionfile == 265 && main->sub
versionfile < 7)) { | 9030 // if (main->versionfile < 265 || (main->versionfile == 265 && main->sub
versionfile < 7)) { |
8822 | 9031 |
| 9032 #ifdef WITH_FREESTYLE |
| 9033 /* default values in Freestyle settings */ |
| 9034 { |
| 9035 Scene *sce; |
| 9036 SceneRenderLayer *srl; |
| 9037 FreestyleLineStyle *linestyle; |
| 9038 |
| 9039 for(sce = main->scene.first; sce; sce = sce->id.next) { |
| 9040 if (sce->r.line_thickness_mode == 0) { |
| 9041 sce->r.line_thickness_mode = R_LINE_THICKNESS_AB
SOLUTE; |
| 9042 sce->r.unit_line_thickness = 1.0f; |
| 9043 } |
| 9044 for(srl = sce->r.layers.first; srl; srl = srl->next) { |
| 9045 if (srl->freestyleConfig.mode == 0) |
| 9046 srl->freestyleConfig.mode = FREESTYLE_CO
NTROL_EDITOR_MODE; |
| 9047 if (srl->freestyleConfig.raycasting_algorithm ==
FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE || |
| 9048 srl->freestyleConfig.raycasting_algorithm ==
FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL) { |
| 9049 srl->freestyleConfig.raycasting_algorith
m = 0; /* deprecated */ |
| 9050 srl->freestyleConfig.flags |= FREESTYLE_
CULLING; |
| 9051 } |
| 9052 } |
| 9053 } |
| 9054 for(linestyle = main->linestyle.first; linestyle; linestyle = li
nestyle->id.next) { |
| 9055 #if 1 |
| 9056 /* disable the Misc panel for now */ |
| 9057 if (linestyle->panel == LS_PANEL_MISC) { |
| 9058 linestyle->panel = LS_PANEL_STROKES; |
| 9059 } |
| 9060 #endif |
| 9061 if (linestyle->thickness_position == 0) { |
| 9062 linestyle->thickness_position = LS_THICKNESS_CEN
TER; |
| 9063 linestyle->thickness_ratio = 0.5f; |
| 9064 } |
| 9065 if (linestyle->chaining == 0) |
| 9066 linestyle->chaining = LS_CHAINING_PLAIN; |
| 9067 if (linestyle->rounds == 0) |
| 9068 linestyle->rounds = 3; |
| 9069 } |
| 9070 } |
| 9071 #endif |
| 9072 |
8823 /* WATCH IT!!!: pointers from libdata have not been converted yet here!
*/ | 9073 /* WATCH IT!!!: pointers from libdata have not been converted yet here!
*/ |
8824 /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resou
rces.c! */ | 9074 /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resou
rces.c! */ |
8825 | 9075 |
8826 /* don't forget to set version number in blender.c! */ | 9076 /* don't forget to set version number in blender.c! */ |
8827 } | 9077 } |
8828 | 9078 |
8829 #if 0 // XXX: disabled for now... we still don't have this in the right place in
the loading code for it to work | 9079 #if 0 // XXX: disabled for now... we still don't have this in the right place in
the loading code for it to work |
8830 static void do_versions_after_linking(FileData *fd, Library *lib, Main *main) | 9080 static void do_versions_after_linking(FileData *fd, Library *lib, Main *main) |
8831 { | 9081 { |
8832 /* old Animation System (using IPO's) needs to be converted to the new A
nimato system */ | 9082 /* old Animation System (using IPO's) needs to be converted to the new A
nimato system */ |
(...skipping 29 matching lines...) Expand all Loading... |
8862 lib_link_sound(fd, main); | 9112 lib_link_sound(fd, main); |
8863 lib_link_group(fd, main); | 9113 lib_link_group(fd, main); |
8864 lib_link_armature(fd, main); | 9114 lib_link_armature(fd, main); |
8865 lib_link_action(fd, main); | 9115 lib_link_action(fd, main); |
8866 lib_link_vfont(fd, main); | 9116 lib_link_vfont(fd, main); |
8867 lib_link_nodetree(fd, main); /* has to be done after scene/materials,
this will verify group nodes */ | 9117 lib_link_nodetree(fd, main); /* has to be done after scene/materials,
this will verify group nodes */ |
8868 lib_link_brush(fd, main); | 9118 lib_link_brush(fd, main); |
8869 lib_link_particlesettings(fd, main); | 9119 lib_link_particlesettings(fd, main); |
8870 lib_link_movieclip(fd, main); | 9120 lib_link_movieclip(fd, main); |
8871 lib_link_mask(fd, main); | 9121 lib_link_mask(fd, main); |
| 9122 #ifdef WITH_FREESTYLE |
| 9123 lib_link_linestyle(fd, main); |
| 9124 #endif |
8872 | 9125 |
8873 lib_link_mesh(fd, main); /* as last: tpage images with us
ers at zero */ | 9126 lib_link_mesh(fd, main); /* as last: tpage images with us
ers at zero */ |
8874 ········ | 9127 ········ |
8875 lib_link_library(fd, main); /* only init users */ | 9128 lib_link_library(fd, main); /* only init users */ |
8876 } | 9129 } |
8877 | 9130 |
8878 static void direct_link_keymapitem(FileData *fd, wmKeyMapItem *kmi) | 9131 static void direct_link_keymapitem(FileData *fd, wmKeyMapItem *kmi) |
8879 { | 9132 { |
8880 kmi->properties = newdataadr(fd, kmi->properties); | 9133 kmi->properties = newdataadr(fd, kmi->properties); |
8881 if (kmi->properties) | 9134 if (kmi->properties) |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9822 ········ | 10075 ········ |
9823 if (sce->set) | 10076 if (sce->set) |
9824 expand_doit(fd, mainvar, sce->set); | 10077 expand_doit(fd, mainvar, sce->set); |
9825 ········ | 10078 ········ |
9826 if (sce->nodetree) | 10079 if (sce->nodetree) |
9827 expand_nodetree(fd, mainvar, sce->nodetree); | 10080 expand_nodetree(fd, mainvar, sce->nodetree); |
9828 ········ | 10081 ········ |
9829 for (srl = sce->r.layers.first; srl; srl = srl->next) { | 10082 for (srl = sce->r.layers.first; srl; srl = srl->next) { |
9830 expand_doit(fd, mainvar, srl->mat_override); | 10083 expand_doit(fd, mainvar, srl->mat_override); |
9831 expand_doit(fd, mainvar, srl->light_override); | 10084 expand_doit(fd, mainvar, srl->light_override); |
| 10085 |
| 10086 #ifdef WITH_FREESTYLE |
| 10087 { |
| 10088 FreestyleLineSet *lineset; |
| 10089 |
| 10090 for (lineset = srl->freestyleConfig.linesets.first; line
set; lineset = lineset->next) { |
| 10091 if (lineset->group) |
| 10092 expand_doit(fd, mainvar, lineset->group)
; |
| 10093 expand_doit(fd, mainvar, lineset->linestyle); |
| 10094 } |
| 10095 } |
| 10096 #endif |
9832 } | 10097 } |
9833 ········ | 10098 ········ |
9834 if (sce->r.dometext) | 10099 if (sce->r.dometext) |
9835 expand_doit(fd, mainvar, sce->gm.dome.warptext); | 10100 expand_doit(fd, mainvar, sce->gm.dome.warptext); |
9836 ········ | 10101 ········ |
9837 if (sce->gpd) | 10102 if (sce->gpd) |
9838 expand_doit(fd, mainvar, sce->gpd); | 10103 expand_doit(fd, mainvar, sce->gpd); |
9839 ················ | 10104 ················ |
9840 if (sce->ed) { | 10105 if (sce->ed) { |
9841 Sequence *seq; | 10106 Sequence *seq; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9920 MaskSplinePoint *point = &spline->points[i]; | 10185 MaskSplinePoint *point = &spline->points[i]; |
9921 | 10186 |
9922 expand_mask_parent(fd, mainvar, &point->parent); | 10187 expand_mask_parent(fd, mainvar, &point->parent); |
9923 } | 10188 } |
9924 | 10189 |
9925 expand_mask_parent(fd, mainvar, &spline->parent); | 10190 expand_mask_parent(fd, mainvar, &spline->parent); |
9926 } | 10191 } |
9927 } | 10192 } |
9928 } | 10193 } |
9929 | 10194 |
| 10195 #ifdef WITH_FREESTYLE |
| 10196 static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *li
nestyle) |
| 10197 { |
| 10198 LineStyleModifier *m; |
| 10199 |
| 10200 if (linestyle->adt) |
| 10201 expand_animdata(fd, mainvar, linestyle->adt); |
| 10202 for (m = linestyle->color_modifiers.first; m; m = m->next) { |
| 10203 if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) |
| 10204 expand_doit(fd, mainvar, ((LineStyleColorModifier_Distan
ceFromObject *)m)->target); |
| 10205 } |
| 10206 for (m = linestyle->alpha_modifiers.first; m; m = m->next){ |
| 10207 if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) |
| 10208 expand_doit(fd, mainvar, ((LineStyleAlphaModifier_Distan
ceFromObject *)m)->target); |
| 10209 } |
| 10210 for (m = linestyle->thickness_modifiers.first; m; m = m->next){ |
| 10211 if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) |
| 10212 expand_doit(fd, mainvar, ((LineStyleThicknessModifier_Di
stanceFromObject *)m)->target); |
| 10213 } |
| 10214 } |
| 10215 #endif |
| 10216 |
9930 void BLO_main_expander(void (*expand_doit_func)(void *, Main *, void *)) | 10217 void BLO_main_expander(void (*expand_doit_func)(void *, Main *, void *)) |
9931 { | 10218 { |
9932 expand_doit = expand_doit_func; | 10219 expand_doit = expand_doit_func; |
9933 } | 10220 } |
9934 | 10221 |
9935 void BLO_expand_main(void *fdhandle, Main *mainvar) | 10222 void BLO_expand_main(void *fdhandle, Main *mainvar) |
9936 { | 10223 { |
9937 ListBase *lbarray[MAX_LIBARRAY]; | 10224 ListBase *lbarray[MAX_LIBARRAY]; |
9938 FileData *fd = fdhandle; | 10225 FileData *fd = fdhandle; |
9939 ID *id; | 10226 ID *id; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10010 break; | 10297 break; |
10011 case ID_PA: | 10298 case ID_PA: |
10012 expand_particlesettings(fd, main
var, (ParticleSettings *)id); | 10299 expand_particlesettings(fd, main
var, (ParticleSettings *)id); |
10013 break; | 10300 break; |
10014 case ID_MC: | 10301 case ID_MC: |
10015 expand_movieclip(fd, mainvar, (M
ovieClip *)id); | 10302 expand_movieclip(fd, mainvar, (M
ovieClip *)id); |
10016 break; | 10303 break; |
10017 case ID_MSK: | 10304 case ID_MSK: |
10018 expand_mask(fd, mainvar, (Mask *
)id); | 10305 expand_mask(fd, mainvar, (Mask *
)id); |
10019 break; | 10306 break; |
| 10307 #ifdef WITH_FREESTYLE |
| 10308 case ID_LS: |
| 10309 expand_linestyle(fd, mainvar, (F
reestyleLineStyle *)id); |
| 10310 break; |
| 10311 #endif |
10020 } | 10312 } |
10021 ········································ | 10313 ········································ |
10022 do_it = TRUE; | 10314 do_it = TRUE; |
10023 id->flag -= LIB_NEED_EXPAND; | 10315 id->flag -= LIB_NEED_EXPAND; |
10024 ········································ | 10316 ········································ |
10025 } | 10317 } |
10026 id = id->next; | 10318 id = id->next; |
10027 } | 10319 } |
10028 } | 10320 } |
10029 } | 10321 } |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10586 fd = blo_decode_and_check(fd, reports); | 10878 fd = blo_decode_and_check(fd, reports); |
10587 if (!fd) | 10879 if (!fd) |
10588 return NULL; | 10880 return NULL; |
10589 ········ | 10881 ········ |
10590 fd->reports = reports; | 10882 fd->reports = reports; |
10591 bfd = blo_read_file_internal(fd, ""); | 10883 bfd = blo_read_file_internal(fd, ""); |
10592 blo_freefiledata(fd); | 10884 blo_freefiledata(fd); |
10593 ········ | 10885 ········ |
10594 return bfd; | 10886 return bfd; |
10595 } | 10887 } |
OLD | NEW |