pendent changes -
authorCampbell Barton <ideasman42@gmail.com>
Tue, 19 Feb 2008 10:43:41 +0000 (10:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 19 Feb 2008 10:43:41 +0000 (10:43 +0000)
- Added a note that force fields only affect objects on same layers
- PLAY button would just play all frames and didnt respect the end frame which is very annoying at times.

source/blender/src/buttons_object.c
source/blender/src/buttons_scene.c
source/blender/src/playanim.c

index 2adf3209b5b15e4e0bf71f9254e5d72f7cdc350b..e67c9444c1fac0602675243e0738519e8d087d83 100644 (file)
@@ -3375,9 +3375,9 @@ static void object_panel_fields(Object *ob)
                        sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d", 
                                        PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC);
 
-                       if(pd->forcefield==PFIELD_FORCE) tipstr= "Particle attracts or repels particles";
-                       else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of particle Z axis";
-                       else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the particle";
+                       if(pd->forcefield==PFIELD_FORCE) tipstr= "Particle attracts or repels particles (On shared object layers)";
+                       else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of particle Z axis (On shared object layers)";
+                       else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the particle (On shared object layers)";
                }
                else{
                        if(ob->type==OB_CURVE)
@@ -3387,10 +3387,10 @@ static void object_panel_fields(Object *ob)
                                sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d", 
                                                PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE);
 
-                       if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles";
-                       else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis";
-                       else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the Object";
-                       else if(pd->forcefield==PFIELD_GUIDE) tipstr= "Use a Curve Path to guide particles";
+                       if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles (On shared object layers)";
+                       else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis (On shared object layers)";
+                       else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the Object (On shared object layers)";
+                       else if(pd->forcefield==PFIELD_GUIDE) tipstr= "Use a Curve Path to guide particles (On shared object layers)";
                }
                
                if(ob->particlesystem.first)
index a16f0e642d5e12bf596af516d6093d53091ef0f8..1290236a4ff87556de9469578e6fe41f717b8829 100644 (file)
@@ -1339,9 +1339,9 @@ static void run_playanim(char *file)
        calc_renderwin_rectangle((G.scene->r.xsch*G.scene->r.size)/100, 
                                                         (G.scene->r.ysch*G.scene->r.size)/100, G.winpos, pos, size);
 #ifdef WIN32
-       sprintf(str, "%s -a -p %d %d -f %d %g \"%s\"", bprogname, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file);
+       sprintf(str, "%s -a -s %d -e %d -p %d %d -f %d %g \"%s\"", bprogname, G.scene->r.sfra, G.scene->r.efra, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file);
 #else
-       sprintf(str, "\"%s\" -a -p %d %d -f %d %g \"%s\"", bprogname, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file);
+       sprintf(str, "\"%s\" -a -s %d -e %d  -p %d %d -f %d %g \"%s\"", bprogname, G.scene->r.sfra, G.scene->r.efra, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file);
 #endif
        system(str);
 }
index e94366571db386d74802beb9489428bb630a6d97..1c3e1d661481c66b1edd82591ddff20dce1d6657 100644 (file)
@@ -212,7 +212,7 @@ static void toscreen(Pict *picture, struct ImBuf *ibuf)
        window_swap_buffers(g_window);
 }
 
-static void build_pict_list(char * first)
+static void build_pict_list(char * first, int totframes)
 {
        int size,pic,file;
        char *mem, name[256];
@@ -261,7 +261,8 @@ static void build_pict_list(char * first)
             O_DIRECT is a Silicon Graphics extension and is only supported on
             local EFS and XFS file systems.
 */
-               while(IMB_ispic(name)){
+               
+               while(IMB_ispic(name) && totframes){
                        file = open(name, O_BINARY|O_RDONLY, 0);
                        if (file < 0) return;
                        picture = (struct pict*)MEM_callocN(sizeof(struct pict), "picture");
@@ -327,6 +328,7 @@ static void build_pict_list(char * first)
                                        break;
                                }
                        }
+                       totframes--;
                }
        }
        return;
@@ -344,8 +346,10 @@ void playanim(int argc, char **argv)
        int sizex, sizey, ofsx, ofsy, i;
        /* This was done to disambiguate the name for use under c++. */
        struct anim * anim = 0;
-       int start_x= 0, start_y= 0;
-
+       int start_x= 0, start_y= 0;
+       int sfra= -1;
+       int efra= -1;
+       
        while (argc > 1) {
                if (argv[1][0] == '-'){
                        switch(argv[1][1]) {
@@ -362,7 +366,7 @@ void playanim(int argc, char **argv)
                                                printf("too few arguments for -p (need 2): skipping\n");
                                        }
                                        break;
-                               case 'f':
+                               case 'f':
                                        if (argc>3) {
                                                double fps = atof(argv[2]);
                                                double fps_base= atof(argv[3]);
@@ -378,6 +382,16 @@ void playanim(int argc, char **argv)
                                                printf("too few arguments for -f (need 2): skipping\n");
                                        }
                                        break;
+                               case 's':
+                                       sfra= MIN2(MAXFRAME, MAX2(1, atoi(argv[2]) ));
+                                       argc--;
+                                       argv++;
+                                       break;
+                               case 'e':
+                                       efra= MIN2(MAXFRAME, MAX2(1, atoi(argv[2]) ));
+                                       argc--;
+                                       argv++;
+                                       break;
                                default:
                                        printf("unknown option '%c': skipping\n", argv[1][1]);
                                        break;
@@ -462,11 +476,17 @@ void playanim(int argc, char **argv)
        
        window_swap_buffers(g_window);
        
-       build_pict_list(name);
+       if (sfra == -1 || efra == -1) {
+               /* one of the frames was invalid, just use all images */
+               sfra = 1;
+               efra = MAXFRAME;
+       }
+       
+       build_pict_list(name, (efra - sfra) + 1);
        
        for (i = 2; i < argc; i++){
                strcpy(name, argv[i]);
-               build_pict_list(name);
+               build_pict_list(name, (efra - sfra) + 1);
        }
 
        IMB_freeImBuf(ibuf);