-
Notifications
You must be signed in to change notification settings - Fork 127
SWFShape::export - conceptually wrong? #8
Comments
Hey Tim, that's a valid thought. However, i've never encountered any SWF that has overlapping edges - at least not those produced by Adobe tools. Theoretically though, i think it is possible (the SWF spec doesn't explicitly forbid that). Have you ever tried to create a SWF that has overlapping edges? What does the Flash Player do with it? |
Well, I assume the exporter works as it works now due to fillStyle0 / fillStyle1 (winding rules). To find clockwise / counter-clockwise paths. That in itself works perfect. Here's an example swf: https://dl-web.dropbox.com/get/Public/drumstel.swf?w=8368cbb9 |
Of course: this isn't a very common case. |
Here's a PNG showing the drumkit issue: https://dl-web.dropbox.com/get/Public/drumstel.png?w=9b8af18d |
Your Dropbox links don't work for me (?) |
hmmm, weird. |
Anyway: I'll do some more research on this. Let you know later this week what I find. Just feel it would be better if lineStyle and fillStyle are exported in the same loop: |
Hm. Did some reading (including your post http://wahlers.com.br/claus/blog/hacking-swf-1-shapes-in-flash/) Imported "drumstel.swf" into Flash CS5 and observed the drum-kit shapes are grouped. Question of course: is it possible to detect this grouping? Quest continues.... [edit] |
Hmm interesting. How did you create the drumkit swf? |
Unproved Theory: Investigating... |
drumkit is for sure Adobe output. |
Oh i thought that was home grown. Ok, then this absolutely deserves investigating. |
Interesting pattern while tracing out shape records of drum-kit swf : [...] The reset of ls, fs0 and fs1 to zero might indicate "end of group". |
This are subsequent records (note the state flags!): Don't believe this is coincidence: maybe fills and strokes should be "flushed" at this point to keep z-order? |
You might be on to something there. I was wondering about subsequent moveTo's myself, as that doesn't make sense (i ignore those when exporting). Maybe it's there for a good reason after all.. |
Tim, check this out: |
Ha! Will put a python-port on github (pyswf :) later this week or next week. |
Hi Claus,
I stumbled on a problem with SWFShape.export()
The problem being that "fills" are exported first and the "strokes" after that.
This gives z-sort problems between fill / stroke when the shape for example contains multiple overlapping filled and stroked rectangles. The current export seems to assume that a Shape contains only a single primitive.
Maybe better if DefaultShapeExporter would have a method like:
beginStyle ( lineStyle, fillStyle )
beginPath()
...
endPath()
So exporters know both lineStyle and fillStyle for the current path? (just thinking aloud)
=> with benefit of not needing SWFShape::exportLinePath() ;-)
Maybe I'm missing something, if so ignore.
Regards,
Tim
The text was updated successfully, but these errors were encountered: