can I cut SWF files?

Discussion in 'Programming' started by Mr Errorz, Jan 3, 2018.

  1. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    I am starting a new project using vector graphics, and it's a first for me.
    The artist I am working with prefers to export ALL of a character's animations
    in one SWF file. Problem is, when I import it into GM, I can't see the different frames,
    and than "cut" the SWF to a few multiple sprites, like a sprite per action.

    I wanted to ask, does anyone know of a way to "cut" SWFs into multiple SWFs or multiple sprites, where you can decide which frames will be included?
    Maybe it can be done not through GM, but some other app?

    Thanks!
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    7,070
    Why not just tell your artist to stop exporting all the character animations together and instead export them on a "per action" basis?
     
    Mr Errorz likes this.
  3. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    Because he is being fussy, and claims it's very inconvenient to export in that way from flash..
    So I am checking for alternatives.
     
  4. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,885
    Sounds like you need to check for an alternative artist, how ridiculous.
     
    Ephemeral likes this.
  5. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    While that will be an option I will look into,
    I would still like to know if there is a way to do it..

    So, anyone?
     
    rIKmAN likes this.
  6. Ziphold

    Ziphold Member

    Joined:
    Jun 22, 2016
    Posts:
    103
  7. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    No,
    I am looking for a solution to help me cut one SWF to multiple SWFs,
    not convert it to bitmap.

    But thanks anyway.
     
  8. Ephemeral

    Ephemeral Member

    Joined:
    Mar 1, 2017
    Posts:
    185
    It really isn't your responsibility to do your artist's job for them. It is quite unprofessional to accidentally turn in art assets in an incorrect or incompatible format. Doing it on purpose, just because they don't feel like doing it right, is the kind of thing that can get an artist blacklisted. You might want to explain that to your artist.
     
    Nocturne, Desix and rIKmAN like this.
  9. Dupletor

    Dupletor Member

    Joined:
    Apr 22, 2017
    Posts:
    339
    Excuse me, but what is the problem with putting all the frames for all the animations in a single file? Undertale had it like that with no problem.
    In GM you can get sprites from nth position to n+mth position with no problem for an animation, so putting them all together in a single file shouldn't bother that much.
    Is the problem related to some property specific to SWF?
     
  10. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    Yes, I agree with all the comments about my / his responsibility.
    But let's put that a side for a moment, because that is not the question I am asking, ok?

    For example,
    If I was working w/ a pixel artist who would give me all the frames in a single file,
    and would tell me that the idle animation is in frames 0-9, walk animation in frames 10-22, jump animation is in 23-36 and so on,
    I would have no problem to create multiple sprites out of that file using GM's sprite editor.
    And what I am trying to figure out is whether I can or cannot do that
    while working with SWF files in GM instead of bitmap files.
    (could be with with an extension, or an external program / editor, if not directly in GM's sprite editor.)

    Whether I decide to work with that artist is or not is besides the point.
     
  11. Dupletor

    Dupletor Member

    Joined:
    Apr 22, 2017
    Posts:
    339
    This is why I posted. It is easily done by importing PNG and BMP files to GMS. I just don't know if you can on SWF or why you would not, so the converter someone brought can solve your problem. :p
     
    Last edited: Jan 3, 2018
  12. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,885
    Gamemaker doesn't support this no, so you would looking at preparing the swf files in the correct manner before importing them - the easiest way to do this is of course using Flash / Animate / whatever vector program you use at the point of creation (ie. your artist).

    You can find the list of caveats when using SWF files here: http://docs2.yoyogames.com/source/_...information/importing_non_bitmap_sprites.html

    As much as you don't want to hear it, you are going to busy enough coding, to have to take on the work of converting files and prepping artwork into a usable state because the artist is too lazy or can't be bothered to do it himself would be a massive red flag for me.

    Good luck.
     
    Mr Errorz and Desix like this.
  13. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    No dude it's fine,
    it's not that I don't want to hear it, it's just that I feel the same way about this specific situation with the artist, so it is a bit redundant to turn this thread into that.
    I just wanted to find out if there is a way to do it or not, since it is so easy to do the same thing with bitmap graphics.

    So I guess I got my answer.
     
    rIKmAN likes this.
  14. Ephemeral

    Ephemeral Member

    Joined:
    Mar 1, 2017
    Posts:
    185
    Well, in theory, vector sprites support and respond to the subimage variable image_index, apparently? I have a hard time imagining how that works, but unless the manual's wrong you could do that and trial-and-error it until you found the right values? I suspect that won't work, though, since with vector sprites there's no reason to assume the image_index matches up with the keyframes in the animation?

    Maybe you could test that. Set up an object with your SWF file, not animating, and set up some key press events to manually increment image_index by 1 and 0.25 and 0.1 while drawing that variable to the screen so you can see if the SWF's keyframes reliably fall on integer values. Or if that works at all.
     
  15. jb skaggs

    jb skaggs Member

    Joined:
    Feb 27, 2017
    Posts:
    160
    you could use a swf to gif coverter then just load the gif and have all the images separate.
     
  16. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    But would it still be vector that way or will it convert to bitmap?
     
  17. Bingdom

    Bingdom Googledom

    Joined:
    Jul 1, 2016
    Posts:
    1,680
    I think I might be wrong, but I think the way how the artist is doing it is the way that works for a flash game.

    I have no experience in flash, but I remember seeing somewhere that a lot of the assets were grouped into one file (E.g. All character animations). It might be just flash compiling all the assets into one file. My memory could be wrong though.

    Gamemaker doesn't have a .swf editor or any code to help with editing it (afaik). I think your best bet would be to use a vector editor to split the vector images. This, however, should be the artist's job.

    No, it would be converted into a raster image.
     
    Last edited: Jan 4, 2018
    Mr Errorz likes this.
  18. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    cool,
    can you give me a name of an editor or two?
     
  19. Bingdom

    Bingdom Googledom

    Joined:
    Jul 1, 2016
    Posts:
    1,680
    Adobe Illustrator
    Adobe Animate
    Inkscape (I think you might need a plugin to support .swf)

    There might be a few more.
     
  20. sylvain_l

    sylvain_l Member

    Joined:
    Sep 18, 2016
    Posts:
    706
    my memories of flash are most gone, but even with the .fla in CS5-6 it was a hassle of dumb work to split animation, as I remember if you have your anim in movieclip(not sure name of component :p) well you couldn't export the anim seprately with a single select->export to swf. (depending also how you build your animation into components)... ( even worse, to merge)

    If I'm not wrong Animate has replaced flash, hope they made a lot of progress for handling that, else wouldn't say the artist is plain fussy if you didn't bother to ask as a constraint for splitted animations in the first place. (^^ well as you didn't work with .swf before not the thing you would as know :p; and I suspect your artist never worked for a GMS dev so he doesn't have a clue neither of the limitation from your side )

    if you want to make the job yourself you should ask for the source file (.fla or whatever your artist used) not the output .swf

    only tried static .swf with GMS2 (as I only have corelDRAW at hand that is able to export .swf and it can't make animation) so I don't know how it works for animated one.
    But I guess for an animation you should at least get a screenshot of the timeline keyframe for each animation from your artist.
     
    Mr Errorz likes this.
  21. Mr Errorz

    Mr Errorz Member

    Joined:
    Jun 21, 2016
    Posts:
    224
    Cool, thank you for your answer.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice