chatbubble sources
authorFruitieX <rasse@rasse-lappy.localdomain>
Sat, 10 Jul 2010 23:49:47 +0000 (02:49 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sat, 10 Jul 2010 23:49:47 +0000 (02:49 +0300)
models/misc/chatbubble/chatbubble.blend [new file with mode: 0644]
models/misc/chatbubble/create [new file with mode: 0755]
models/misc/chatbubble/keyface1.svg [new file with mode: 0644]
models/misc/chatbubble/keyface2.svg [new file with mode: 0644]
models/misc/chatbubble/keyface3.svg [new file with mode: 0644]
models/misc/chatbubble/whiteborder.scm [new file with mode: 0644]

diff --git a/models/misc/chatbubble/chatbubble.blend b/models/misc/chatbubble/chatbubble.blend
new file mode 100644 (file)
index 0000000..945fb80
Binary files /dev/null and b/models/misc/chatbubble/chatbubble.blend differ
diff --git a/models/misc/chatbubble/create b/models/misc/chatbubble/create
new file mode 100755 (executable)
index 0000000..8f557c4
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+#Uses Blender, Inkscape, Gimp and ~/.gimp*/scripts/whiteborder.scm
+#Renders the scene from this .blend file:
+file=chatbubble
+
+#Export png from all svg files
+for f in *.svg
+do
+    inkscape -f "$f" -e "`basename $f .svg`.png"
+done
+
+#Render single Blender scene
+render_scene()
+{
+    blender -b "$PWD/$file.blend" -S "$scene" -o "//$scene#" -f 1
+    rename "${scene}1" "$scene" "${scene}1".*
+}
+
+#Render the Blender scene
+scene=chatbubble
+render_scene
+
+#Add white border
+gimp -d -f -i -b '(whiteborder "chatbubble.tga" 1 5 12 0 4)' -b '(gimp-quit 0)'
diff --git a/models/misc/chatbubble/keyface1.svg b/models/misc/chatbubble/keyface1.svg
new file mode 100644 (file)
index 0000000..cd37abc
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="256"
+   height="256"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   version="1.0"
+   sodipodi:docname="keyface1.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#000000"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="144.96197"
+     inkscape:cy="144.20333"
+     inkscape:document-units="px"
+     inkscape:current-layer="svg2"
+     showgrid="true"
+     inkscape:showpageshadow="false"
+     inkscape:snap-bbox="true"
+     gridtolerance="8"
+     inkscape:window-width="1280"
+     inkscape:window-height="963"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     guidecolor="#00007f"
+     guideopacity="0.49803922"
+     guidehicolor="#ff0000"
+     guidehiopacity="0.49803922">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2389"
+       visible="true"
+       enabled="true"
+       empspacing="4"
+       color="#003fff"
+       opacity="0.1254902"
+       empcolor="#007eff"
+       empopacity="0.25098039"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Ebene 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="display:inline">
+    <text
+       xml:space="preserve"
+       style="font-size:192px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="34.28125"
+       y="179.96875"
+       id="text2815"><tspan
+         sodipodi:role="line"
+         id="tspan2817"
+         x="34.28125"
+         y="179.96875">X</tspan></text>
+  </g>
+</svg>
diff --git a/models/misc/chatbubble/keyface2.svg b/models/misc/chatbubble/keyface2.svg
new file mode 100644 (file)
index 0000000..6400471
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="256"
+   height="256"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   version="1.0"
+   sodipodi:docname="keyface2.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#000000"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="-108.03803"
+     inkscape:cy="136.20333"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:showpageshadow="false"
+     inkscape:snap-bbox="true"
+     gridtolerance="8"
+     inkscape:window-width="1280"
+     inkscape:window-height="963"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     guidecolor="#00007f"
+     guideopacity="0.49803922"
+     guidehicolor="#ff0000"
+     guidehiopacity="0.49803922">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2389"
+       visible="true"
+       enabled="true"
+       empspacing="4"
+       color="#003fff"
+       opacity="0.1254902"
+       empcolor="#007eff"
+       empopacity="0.25098039"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Ebene 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="display:inline">
+    <text
+       xml:space="preserve"
+       style="font-size:192px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="29.21875"
+       y="182.5"
+       id="text2815"><tspan
+         sodipodi:role="line"
+         id="tspan2817"
+         x="29.21875"
+         y="182.5">O</tspan></text>
+  </g>
+</svg>
diff --git a/models/misc/chatbubble/keyface3.svg b/models/misc/chatbubble/keyface3.svg
new file mode 100644 (file)
index 0000000..0693985
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="256"
+   height="256"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   version="1.0"
+   sodipodi:docname="keyface3.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#000000"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.5"
+     inkscape:cx="144.96197"
+     inkscape:cy="136.20333"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:showpageshadow="false"
+     inkscape:snap-bbox="true"
+     gridtolerance="8"
+     inkscape:window-width="1280"
+     inkscape:window-height="963"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     guidecolor="#00007f"
+     guideopacity="0.49803922"
+     guidehicolor="#ff0000"
+     guidehiopacity="0.49803922">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2389"
+       visible="true"
+       enabled="true"
+       empspacing="4"
+       color="#003fff"
+       opacity="0.1254902"
+       empcolor="#007eff"
+       empopacity="0.25098039"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Ebene 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="display:inline">
+    <text
+       xml:space="preserve"
+       style="font-size:192px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:Bitstream Vera Sans"
+       x="21.15625"
+       y="179.96875"
+       id="text2815"><tspan
+         sodipodi:role="line"
+         id="tspan2817"
+         x="21.15625"
+         y="179.96875">N</tspan></text>
+  </g>
+</svg>
diff --git a/models/misc/chatbubble/whiteborder.scm b/models/misc/chatbubble/whiteborder.scm
new file mode 100644 (file)
index 0000000..9369ccf
--- /dev/null
@@ -0,0 +1,63 @@
+;Adds a white border and a faint glow, based on the alpha channel
+;Input: filesIn (wildcard * possible) borderGrow borderFeather objectShrink objectFeather glowBlur
+;Output: RLE compressed .tga file(s) (overwrites existing tga files)
+
+(define (whiteborder filesIn glowBlur borderGrow borderFeather objectShrink objectFeather)
+       (let*
+        (
+            (fileList (cadr (file-glob filesIn 1)))
+            (borderColor '(255 255 255))
+            (borderGlow '(223 223 223))
+        )
+
+        (while (not (null? fileList))
+               (let*
+                       (
+                    (file (car fileList))
+                               (image (car (gimp-file-load 1 file file)))
+                               (bottomLayer (car (gimp-image-get-active-layer image)))
+                               (middleLayer (car (gimp-layer-new-from-drawable bottomLayer image)))
+                               (topLayer (car (gimp-layer-new-from-drawable bottomLayer image)))
+                       )
+
+                ;Add layers
+                       (gimp-image-add-layer image middleLayer -1)
+                       (gimp-image-add-layer image topLayer -1)
+
+                ;Bottom layer: create extended glow siluette of the object
+                (gimp-context-set-foreground borderGlow)
+                (gimp-selection-layer-alpha bottomLayer)
+                (gimp-selection-grow image (- borderGrow 1))
+                (gimp-selection-feather image borderFeather)
+                (gimp-edit-fill bottomLayer 0)
+                (gimp-selection-none image)
+                (plug-in-gauss-rle 1 image bottomLayer glowBlur 1 1)
+
+                ;Middle layer: create extended siluette of the object
+                (gimp-context-set-foreground borderColor)
+                (gimp-selection-layer-alpha middleLayer)
+                (gimp-selection-grow image borderGrow)
+                (gimp-selection-feather image borderFeather)
+                (gimp-edit-fill middleLayer 0)
+
+                ;Top layer: reduce border of the object on the top layer
+                (gimp-selection-layer-alpha topLayer)
+                (gimp-selection-shrink image objectShrink)
+                (gimp-selection-feather image objectFeather)
+                (gimp-selection-invert image)
+                (gimp-edit-clear topLayer)
+
+                ;Set extension to .tga
+                       (set! file (car (strbreakup file ".")))
+                       (set! file (string-append file ".tga")) 
+
+                ;Save image as RLE compressed tga
+                       (set! bottomLayer (car (gimp-image-merge-visible-layers image 1)))
+                       (file-tga-save 1 image bottomLayer file file 1 0)
+                (gimp-image-delete image)
+
+                (set! fileList (cdr fileList))
+            )
+           )
+    )
+)