mieki256's diary



2015/02/09(月) [n年前の日記]

#1 [cg_tools] Windwos版 Inkscapeでxcf保存できないか試してたり

Inkscape 0.91 x64 Windows版から、GIMP Portable 2.8.10 を呼んでxcf保存できないか試していたり。

とりあえず、以下のファイルがxcf保存を担当してるようで。 両方バックアップを取ってから修正。

gimp_xcf.inx は、ファイル保存時のダイアログを定義してるっぽい。以下のように修正した。
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
    <_name>GIMP XCF</_name>
    <id>org.ekips.output.gimp_xcf</id>
    <dependency type="extension">org.inkscape.output.svg.inkscape</dependency>
    <dependency type="executable" location="extensions">gimp_xcf.py</dependency>
    <dependency type="executable" location="extensions">inkex.py</dependency>
    <!-- <dependency type="executable" location="path">gimp</dependency> -->
    <param name="tab" type="notebook">
        <page name="Options" _gui-text="Options">
        <param name="guides" type="boolean" _gui-text="Save Guides">false</param>
        <param name="grid" type="boolean" _gui-text="Save Grid">false</param>
        <param name="background" type="boolean" _gui-text="Save Background">false</param>
        <param name="dpi" type="int" min="1" max="3000" _gui-text="File Resolution:">90</param>
        <param name="gimp" type="string" _gui-text="GIMP path">gimp</param>
        <param name="clrtmp" type="boolean" _gui-text="Clear TempDir">false</param>
        </page>
        <page name="Help" _gui-text="Help">
            <_param name="instructions" type="description" xml:space="preserve">This extension exports the document to Gimp XCF format according to the following options:
    * Save Guides: convert all guides to Gimp guides.
    * Save Grid: convert the first rectangular grid to a Gimp grid (note that the default Inkscape grid is very narrow when shown in Gimp).
    * Save Background: add the document background to each converted layer.
    * File Resolution: XCF file resolution, in DPI.

Each first level layer is converted to a Gimp layer. Sublayers are concatenated and converted with their first level parent layer into a single Gimp layer.</_param>
        </page>
    </param>        
    <output>
                <extension>.xcf</extension>
                <mimetype>application/x-xcf</mimetype>
                <_filetypename>GIMP XCF maintaining layers (*.xcf)</_filetypename>
                <_filetypetooltip>GIMP XCF maintaining layers (*.xcf)</_filetypetooltip>
                <dataloss>true</dataloss>
    </output>
    <script>
        <command reldir="extensions" interpreter="python">gimp_xcf.py</command>
        <helper_extension>org.inkscape.output.svg.inkscape</helper_extension>
    </script>
</inkscape-extension>
<dependency type="executable" location="path">gimp</dependency> の部分で、環境変数PATHの中に gimp が居るか居ないかを調べてるっぽい。「このダイアログは gimp に依存してるよ」「だから gimp が見つからなかったら表示するなよ」てな動きになるのだと思う。コメントアウトしたので、gimp が PATH の中に見つからなくても、ファイル種類としてリストアップされるようになった。

また、以下の行を追加して、ダイアログ内で設定できる項目を増やした。
        <param name="gimp" type="string" _gui-text="GIMP path">gimp</param>
        <param name="clrtmp" type="boolean" _gui-text="Clear TempDir">false</param>
上が、GIMPのパス指定。下が、処理が終わったら作業フォルダを削除するか否か。動作に不具合が起きた際に作業フォルダが消されてしまうと原因が特定しづらいので、普段は残すようにしてみたり。

で、後は gimp_xcf.py を修正すればいいはずだけど、これがなかなか動いてくれず。

GIMP 2.6.12 インストーラ版を指定する分には動くのだけど、GIMP Portable 2.8.10 を呼び出そうとすると失敗する。GIMPPortable.exe を呼び出すべきなのか、gimp-2.8.exe を呼び出すべきなのか…。

以上です。

過去ログ表示

Prev - 2015/02 - Next
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28

カテゴリで表示

検索機能は Namazu for hns で提供されています。(詳細指定/ヘルプ


注意: 現在使用の日記自動生成システムは Version 2.19.6 です。
公開されている日記自動生成システムは Version 2.19.5 です。

Powered by hns-2.19.6, HyperNikkiSystem Project