seamless_pattern.py revision 029a2f1aa166de8ba4ecf9418f41afb089019ec5
# Written by Jabiertxof
# V.03
import inkex
import re
import os
self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="desktop_width", default="100", help="Custom width")
self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="desktop_height", default="100", help="Custom height")
xpathStr = '//svg:use[@id="sampleTile"]'
if sampleTile != []:
xpathStr = '//svg:use[@id="clipPathRect"]'
if clipPathRect != []:
xpathStr = '//svg:tspan[@id="infoText"]'
if infoText != []:
xpathStr = '//svg:use[@id="backgroundPattern"]'
if backgroundPattern != []:
xpathStr = '//svg:rect[@id="cuadroPattern"]'
if cuadroPattern != []:
xpathStr = '//svg:use[@id="cuadroPatternDisenador"]'
if cuadroPatternDisenador != []:
xpathStr = '//svg:g[@id="designZone"]'
if designZone != []:
designZone[0].set("transform", "translate(" + str((width*5)) + ",0)scale(" + str(((width+height)/2)/100.) + ")")
xpathStr = '//svg:g[@id="patternResult"]'
if patternResult != []:
xpathStr = '//svg:use[@id="patternTileBackground"]'
if patternTileBackground != []:
patternTileBackground[0].set("transform", "matrix(3,0,0,3," + str((width * 2)) + "," + str(height * 4) + ")")
xpathStr = '//svg:use[@id="patternGenerated"]'
if patternGenerated != []:
xpathStr = '//svg:use[@id="pattern1"]'
if pattern1 != []:
xpathStr = '//svg:use[@id="pattern2"]'
if pattern2 != []:
xpathStr = '//svg:use[@id="pattern3"]'
if pattern3 != []:
xpathStr = '//svg:use[@id="pattern4"]'
if pattern4 != []:
xpathStr = '//svg:use[@id="pattern5"]'
if pattern5 != []:
xpathStr = '//svg:use[@id="pattern6"]'
if pattern6 != []:
xpathStr = '//svg:use[@id="pattern7"]'
if pattern7 != []:
xpathStr = '//svg:use[@id="pattern8"]'
if pattern8 != []:
xpathStr = '//svg:use[@id="pattern9"]'
if pattern9 != []:
xpathStr = '//svg:use[@id="samplePattern1"]'
if samplePattern1 != []:
xpathStr = '//svg:use[@id="samplePattern2"]'
if samplePattern2 != []:
xpathStr = '//svg:use[@id="samplePattern3"]'
if samplePattern3 != []:
xpathStr = '//svg:use[@id="samplePattern4"]'
if samplePattern4 != []:
xpathStr = '//svg:use[@id="samplePattern5"]'
if samplePattern5 != []:
xpathStr = '//svg:use[@id="samplePattern6"]'
if samplePattern6 != []:
xpathStr = '//svg:use[@id="samplePattern7"]'
if samplePattern7 != []:
xpathStr = '//svg:use[@id="samplePattern8"]'
if samplePattern8 != []:
xpathStr = '//svg:use[@id="samplePattern9"]'
if samplePattern9 != []:
xpathStr = '//svg:g[@id="patternPreview"]'
if patternPreview != []:
xpathStr = '//svg:g[@id="helperLayer"]'
if helperLayer != []:
xpathStr = '//svg:rect[@id="fondoGris"]'
if fondoGris != []:
xpathStr = '//svg:use[@id="patternGenerator" or id="patternPreviewFast"]'
if patternGenerator != []:
if namedview is None:
c = C()
c.affect()