annotate tools/editor/plugins/LightEdit.py @ 684:4f36c890b1dd

* Merged the 0.3.3dev branche changes to the trunk.
author helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 06 Dec 2010 19:25:27 +0000
parents 60621d858548
children
rev   line source
680
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 # -*- coding: utf-8 -*-
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 # ####################################################################
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 # Copyright (C) 2005-2010 by the FIFE team
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
5 # http://www.fifengine.de
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
6 # This file is part of FIFE.
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
7 #
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
8 # FIFE is free software; you can redistribute it and/or
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
9 # modify it under the terms of the GNU Lesser General Public
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 # License as published by the Free Software Foundation; either
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
11 # version 2.1 of the License, or (at your option) any later version.
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 #
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
13 # This library is distributed in the hope that it will be useful,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
16 # Lesser General Public License for more details.
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
17 #
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18 # You should have received a copy of the GNU Lesser General Public
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
19 # License along with this library; if not, write to the
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 # Free Software Foundation, Inc.,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 # ####################################################################
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24 """ a tool for FIFEdit to test and set lighting """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26 from fife import fife
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27 from fife.extensions import pychan
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28 from fife.extensions.pychan import widgets as widgets
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
29 from fife.extensions.pychan.tools import callbackWithArguments as cbwa
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 from fife.extensions.fife_timer import Timer
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
32
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 import scripts
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
34 import scripts.plugin as plugin
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35 from scripts.events import *
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
36 from scripts.gui.action import Action
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
38 import os
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
39 try:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40 import xml.etree.cElementTree as ET
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41 except:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
42 import xml.etree.ElementTree as ET
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
43
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
44 import math
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 import random
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
46
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
47 WHITE = {
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
48 "r" : 205,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
49 "g" : 205,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
50 "b" : 205
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
51 }
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52 OUTLINE_SIZE = 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
54 DEFAULT_GLOBAL_LIGHT = {
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 "R" : 1.0,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 "G" : 1.0,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
57 "B" : 1.0,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 "A" : 1.0,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59 }
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 class LightEdit(plugin.Plugin):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62 """ The B{LightEdit} module is a plugin for FIFedit and allows to use Lighting
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64 current features:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 - click instance to add SimpleLight, LightImage, LightAnimation
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 - outline highlighting of the selected object
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67 - changeing all SimpleLigh values and Image, Animation source
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
68
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
69
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
70 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
71 def __init__(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
72 self.active = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73 self._camera = None
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 self._layer = None
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 self._enabled = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 self._light = {}
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 self._color = {}
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79 self._color.update(DEFAULT_GLOBAL_LIGHT)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81 random.seed()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83 def _reset(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85 resets all dynamic vars, but leaves out static ones (e.g. camera, layer)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
87 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
88 self._instances = None
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
89 self._light["stencil"] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 self._light["alpha"] = 0.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
91 self._light["src"] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
92 self._light["dst"] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
93
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 self._light["intensity"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
95 self._light["red"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
96 self._light["green"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
97 self._light["blue"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 self._light["radius"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 self._light["subdivisions"] = 32
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
100 self._light["xstretch"] = 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
101 self._light["ystretch"] = 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
102
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
103 self._light["image"] = ""
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
104 self._light["animation"] = ""
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
105
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106 self._simple_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 self._image_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 self._animation_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
109 self._global_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
110
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
111 if self._camera is not None:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
112 self.renderer.removeAllOutlines()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 self._widgets["group"].text = unicode(str(""))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
114 self._widgets["image"].text = unicode(str(""))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
115 self._widgets["animation"].text = unicode(str(""))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
116
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
117 def enable(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
118 """ plugin method """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
119 if self._enabled is True:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
120 return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
121
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
122 self._editor = scripts.editor.getEditor()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
123 self.engine = self._editor.getEngine()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 self.imagepool = self.engine.getImagePool()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 self._animationpool = self.engine.getAnimationPool()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 self._showAction = Action(unicode(self.getName(),"utf-8"), checkable=True)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
129 scripts.gui.action.activated.connect(self.toggle_gui, sender=self._showAction)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
130
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
131 self._editor._tools_menu.addAction(self._showAction)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133 events.onInstancesSelected.connect(self.input)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 self._reset()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136 self.create_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
137
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
138 def disable(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
139 """ plugin method """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
140 if self._enabled is False:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
141 return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
142
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
143 self._reset()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
144 self.container.hide()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
145 self.removeAllChildren()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
146
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
147 events.onInstancesSelected.disconnect(self.input)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
148
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
149 self._editor._toolsMenu.removeAction(self._showAction)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
150
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
151 def isEnabled(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
152 """ plugin method """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
153 return self._enabled;
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
154
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
155 def getName(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
156 """ plugin method """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
157 return "Light editor"
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
158
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
159 def create_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
160 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
161 - creates the gui skeleton by loading the xml file
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
162
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
163 FIXME:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
164 - move all dynamic widgets to dict
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
165 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
166 self.container = pychan.loadXML('gui/lightedit.xml')
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
167 self.container.mapEvents({
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
168 "reset" : self.reset_light,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
169 "use" : self.use_light,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
170 "simple_but" : self.toggle_simple_gui,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
171 "image_but" : self.toggle_image_gui,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
172 "animation_but" : self.toggle_animation_gui,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
173 "global_but" : self.toggle_global_gui,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
174 "selec_image" : self.change_image,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
175 "selec_animation" : self.change_animation,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
176
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
177 "stencil_up" : cbwa(self.change_light, value=1, option="stencil"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
178 "stencil_dn" : cbwa(self.change_light, value=-1, option="stencil"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
179 "stencil/mouseWheelMovedUp" : cbwa(self.change_light, value=10, option="stencil"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
180 "stencil/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="stencil"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
181
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
182 "alpha_up" : cbwa(self.change_light, value=0.01, option="alpha"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
183 "alpha_dn" : cbwa(self.change_light, value=-0.01, option="alpha"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
184 "alpha/mouseWheelMovedUp" : cbwa(self.change_light, value=0.1, option="alpha"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
185 "alpha/mouseWheelMovedDown" : cbwa(self.change_light, value=-0.1, option="alpha"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
186
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
187 "intensity_up" : cbwa(self.change_light, value=1, option="intensity"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
188 "intensity_dn" : cbwa(self.change_light, value=-1, option="intensity"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
189 "intensity/mouseWheelMovedUp" : cbwa(self.change_light, value=10, option="intensity"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
190 "intensity/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="intensity"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
191
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
192 "radius_up" : cbwa(self.change_light, value= 1, option="radius"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
193 "radius_dn" : cbwa(self.change_light, value=-1, option="radius"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
194 "radius/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="radius"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
195 "radius/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="radius"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
196
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
197 "subdivisions_up" : cbwa(self.change_light, value= 1, option="subdivisions"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
198 "subdivisions_dn" : cbwa(self.change_light, value=-1, option="subdivisions"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
199 "subdivisions/mouseWheelMovedUp" : cbwa(self.change_light, value= 1, option="subdivisions"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
200 "subdivisions/mouseWheelMovedDown" : cbwa(self.change_light, value=-1, option="subdivisions"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
201
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
202 "xstretch_up" : cbwa(self.change_light, value= 0.01, option="xstretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
203 "xstretch_dn" : cbwa(self.change_light, value=-0.01, option="xstretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
204 "xstretch/mouseWheelMovedUp" : cbwa(self.change_light, value= 0.1, option="xstretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
205 "xstretch/mouseWheelMovedDown" : cbwa(self.change_light, value=-0.1, option="xstretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
206
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
207 "ystretch_up" : cbwa(self.change_light, value= 0.01, option="ystretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
208 "ystretch_dn" : cbwa(self.change_light, value=-0.01, option="ystretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
209 "ystretch/mouseWheelMovedUp" : cbwa(self.change_light, value= 0.1, option="ystretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
210 "ystretch/mouseWheelMovedDown" : cbwa(self.change_light, value=-0.1, option="ystretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
211
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
212 "red_up" : cbwa(self.change_light, value= 1, option="red"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
213 "red_dn" : cbwa(self.change_light, value=-1, option="red"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
214 "red/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="red"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
215 "red/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="red"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
216
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
217 "green_up" : cbwa(self.change_light, value= 1, option="green"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
218 "green_dn" : cbwa(self.change_light, value=-1, option="green"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
219 "green/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="green"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
220 "green/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="green"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
221
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
222 "blue_up" : cbwa(self.change_light, value= 1, option="blue"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
223 "blue_dn" : cbwa(self.change_light, value=-1, option="blue"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
224 "blue/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="blue"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
225 "blue/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="blue"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
226
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
227 "src_up" : cbwa(self.change_light, value= 1, option="src"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
228 "src_dn" : cbwa(self.change_light, value=-1, option="src"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
229 "src/mouseWheelMovedUp" : cbwa(self.change_light, value= 1, option="src"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
230 "src/mouseWheelMovedDown" : cbwa(self.change_light, value=-1, option="src"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
231
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
232 "dst_up" : cbwa(self.change_light, value= 1, option="dst"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
233 "dst_dn" : cbwa(self.change_light, value=-1, option="dst"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
234 "dst/mouseWheelMovedUp" : cbwa(self.change_light, value= 1, option="dst"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
235 "dst/mouseWheelMovedDown" : cbwa(self.change_light, value=-1, option="dst"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
236
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
237 "random_global_light" : self.random_color,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
238 "reset_global_light" : self.reset_global_light,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
239
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
240 "increase_R" : cbwa(self.increase_color, r=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
241 "decrease_R" : cbwa(self.decrease_color, r=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
242 "value_R/mouseWheelMovedUp" : cbwa(self.increase_color, step=0.1, r=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
243 "value_R/mouseWheelMovedDown" : cbwa(self.decrease_color, step=0.1, r=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
244
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
245 "increase_G" : cbwa(self.increase_color, g=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
246 "decrease_G" : cbwa(self.decrease_color, g=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
247 "value_G/mouseWheelMovedUp" : cbwa(self.increase_color, step=0.1, g=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
248 "value_G/mouseWheelMovedDown" : cbwa(self.decrease_color, step=0.1, g=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
249
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
250 "increase_B" : cbwa(self.increase_color, b=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
251 "decrease_B" : cbwa(self.decrease_color, b=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
252 "value_B/mouseWheelMovedUp" : cbwa(self.increase_color, step=0.1, b=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
253 "value_B/mouseWheelMovedDown" : cbwa(self.decrease_color, step=0.1, b=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
254
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
255 "increase_A" : cbwa(self.increase_color, a=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
256 "decrease_A" : cbwa(self.decrease_color, a=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
257 "value_A/mouseWheelMovedUp" : cbwa(self.increase_color, step=0.1, a=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
258 "value_A/mouseWheelMovedDown" : cbwa(self.decrease_color, step=0.1, a=True),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
259 })
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
260
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
261 self._widgets = {
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
262 "group" : self.container.findChild(name="group"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
263 "ins_id" : self.container.findChild(name="ins_id"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
264 "obj_id" : self.container.findChild(name="obj_id"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
265 "stencil" : self.container.findChild(name="stencil"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
266 "alpha" : self.container.findChild(name="alpha"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
267
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
268 "intensity" : self.container.findChild(name="intensity"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
269 "red" : self.container.findChild(name="red"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
270 "green" : self.container.findChild(name="green"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
271 "blue" : self.container.findChild(name="blue"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
272 "radius" : self.container.findChild(name="radius"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
273 "subdivisions" : self.container.findChild(name="subdivisions"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
274 "xstretch" : self.container.findChild(name="xstretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
275 "ystretch" : self.container.findChild(name="ystretch"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
276 "src" : self.container.findChild(name="src"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
277 "dst" : self.container.findChild(name="dst"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
278
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
279 "image" : self.container.findChild(name="image"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
280 "animation" : self.container.findChild(name="animation"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
281
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
282 "value_R" : self.container.findChild(name="value_R"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
283 "value_G" : self.container.findChild(name="value_G"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
284 "value_B" : self.container.findChild(name="value_B"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
285 "value_A" : self.container.findChild(name="value_A"),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
286 }
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
287
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
288 self._gui_simple_panel_wrapper = self.container.findChild(name="simple_panel_wrapper")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
289 self._gui_simple_panel = self._gui_simple_panel_wrapper.findChild(name="simple_panel")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
290 self._gui_image_panel_wrapper = self.container.findChild(name="image_panel_wrapper")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
291 self._gui_image_panel = self._gui_image_panel_wrapper.findChild(name="image_panel")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
292 self._gui_animation_panel_wrapper = self.container.findChild(name="animation_panel_wrapper")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
293 self._gui_animation_panel = self._gui_animation_panel_wrapper.findChild(name="animation_panel")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
294 self._gui_global_panel_wrapper = self.container.findChild(name="global_panel_wrapper")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
295 self._gui_global_panel = self._gui_global_panel_wrapper.findChild(name="global_panel")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
296
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
297 def update_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
298 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
299 updates the gui
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
300
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
301 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
302
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
303 self._widgets["ins_id"].text = unicode(str(self._instances[0].getId()))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
304 self._widgets["obj_id"].text = unicode(str(self._instances[0].getObject().getId()))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
305 self._widgets["stencil"].text = unicode(str(self._light["stencil"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
306 self._widgets["alpha"].text = unicode(str(self._light["alpha"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
307 self._widgets["src"].text = unicode(str(self._light["src"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
308 self._widgets["dst"].text = unicode(str(self._light["dst"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
309
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
310 self._widgets["intensity"].text = unicode(str(self._light["intensity"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
311 self._widgets["red"].text = unicode(str(self._light["red"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
312 self._widgets["green"].text = unicode(str(self._light["green"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
313 self._widgets["blue"].text = unicode(str(self._light["blue"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
314 self._widgets["radius"].text = unicode(str(self._light["radius"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
315 self._widgets["subdivisions"].text = unicode(str(self._light["subdivisions"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
316 self._widgets["xstretch"].text = unicode(str(self._light["xstretch"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
317 self._widgets["ystretch"].text = unicode(str(self._light["ystretch"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
318
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
319 self._widgets["value_R"].text = unicode(str(self._color["R"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
320 self._widgets["value_G"].text = unicode(str(self._color["G"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
321 self._widgets["value_B"].text = unicode(str(self._color["B"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
322 self._widgets["value_A"].text = unicode(str(self._color["A"]))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
323
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
324 if self._simple_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
325 if not self._gui_simple_panel_wrapper.findChild(name="simple_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
326 self._gui_simple_panel_wrapper.addChild(self._gui_simple_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
327 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
328 if self._gui_simple_panel_wrapper.findChild(name="simple_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
329 self._gui_simple_panel_wrapper.removeChild(self._gui_simple_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
330 if self._image_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
331 if not self._gui_image_panel_wrapper.findChild(name="image_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
332 self._gui_image_panel_wrapper.addChild(self._gui_image_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
333 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
334 if self._gui_image_panel_wrapper.findChild(name="image_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
335 self._gui_image_panel_wrapper.removeChild(self._gui_image_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
336 if self._animation_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
337 if not self._gui_animation_panel_wrapper.findChild(name="animation_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
338 self._gui_animation_panel_wrapper.addChild(self._gui_animation_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
339 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
340 if self._gui_animation_panel_wrapper.findChild(name="animation_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
341 self._gui_animation_panel_wrapper.removeChild(self._gui_animation_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
342 if self._global_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
343 if not self._gui_global_panel_wrapper.findChild(name="global_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
344 self._gui_global_panel_wrapper.addChild(self._gui_global_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
345 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
346 if self._gui_global_panel_wrapper.findChild(name="global_panel"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
347 self._gui_global_panel_wrapper.removeChild(self._gui_global_panel)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
348
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
349 self.container.adaptLayout(False)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
350
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
351 def toggle_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
352 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
353 show / hide the gui
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
354 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
355 if self.active is True:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
356 self.active = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
357 if self.container.isVisible() or self.container.isDocked():
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
358 self.container.setDocked(False)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
359 self.container.hide()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
360 self._showAction.setChecked(False)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
361 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
362 self.active = True
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
363 self._showAction.setChecked(True)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
364
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
365 def toggle_simple_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
366 if self._simple_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
367 self._simple_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
368 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
369 self._simple_l = True
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
370 self._image_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
371 self._animation_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
372 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
373
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
374 def toggle_image_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
375 if self._image_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
376 self._image_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
377 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
378 self._simple_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
379 self._image_l = True
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
380 self._animation_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
381 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
382
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
383 def toggle_animation_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
384 if self._animation_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
385 self._animation_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
386 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
387 self._simple_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
388 self._image_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
389 self._animation_l = True
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
390 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
391
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
392 def toggle_global_gui(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
393 if self._global_l:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
394 self._global_l = False
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
395 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
396 self._global_l = True
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
397 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
398
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
399 def init_data(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
400 color = self._camera.getLightingColor()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
401 self._color["R"] = color[0]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
402 self._color["G"] = color[1]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
403 self._color["B"] = color[2]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
404 self._color["A"] = color[3]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
405
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
406 groups = self.lightrenderer.getGroups()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
407 for group in groups:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
408 infos = self.lightrenderer.getLightInfo(group)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
409 for info in infos:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
410 node = info.getNode()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
411 if node.getInstance() is None: continue
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
412 if node.getInstance().getId() == self._instances[0].getId():
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
413 self._widgets["group"].text = unicode(str(group))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
414 self._light["stencil"] = info.getStencil()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
415 self._light["alpha"] = info.getAlpha()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
416 self._light["src"] = info.getSrcBlend()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
417 self._light["dst"] = info.getDstBlend()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
418 if str(info.getName()) == "simple":
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
419 self._light["red"] = info.getColor()[0]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
420 self._light["green"] = info.getColor()[1]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
421 self._light["blue"] = info.getColor()[2]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
422 self._light["intensity"] = info.getColor()[3]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
423 self._light["radius"] = info.getRadius()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
424 self._light["subdivisions"] = info.getSubdivisions()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
425 self._light["xstretch"] = info.getXStretch()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
426 self._light["ystretch"] = info.getYStretch()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
427 self.toggle_simple_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
428 elif str(info.getName()) == "image":
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
429 if info.getId() == -1: continue
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
430 img = self.imagepool.getImage(info.getId());
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
431 name = img.getResourceFile()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
432 self._widgets["image"].text = unicode(str(name))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
433 self._light["image"] = info.getId()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
434 self.toggle_image_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
435 elif str(info.getName()) == "animation":
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
436 if info.getId() == -1: continue
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
437 ani = self._animationpool.getAnimation(info.getId());
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
438 count = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
439 newstr = ''
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
440 image = ani.getFrame(ani.getActionFrame())
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
441 fname = image.getResourceFile()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
442 strings = ([str(s) for s in fname.split('/')])
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
443 leng = len(strings) -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
444 while count < leng:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
445 newstr = str(newstr + strings[count] + '/')
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
446 count += 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
447 self._widgets["animation"].text = unicode(str(newstr + 'animation.xml'))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
448 self._light["animation"] = info.getId()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
449 self.toggle_animation_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
450
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
451 def change_image(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
452 file = self._editor.getObject().getResourceFile()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
453 tree = ET.parse(file)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
454 img_lst = tree.findall("image")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
455 for image in img_lst:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
456 source = image.get('source')
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
457 path = file.split('/')
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
458 path.pop()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
459 path.append(str(source))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
460 self._widgets["image"].text = unicode(str('/'.join(path)))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
461 break
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
462
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
463 def change_animation(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
464 file = self._editor.getObject().getResourceFile()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
465 tree = ET.parse(file)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
466 ani_lst = tree.findall("animation")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
467 if not ani_lst:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
468 act_lst = tree.findall("action")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
469 if not act_lst: return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
470 for act in act_lst:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
471 ani_lst = act.findall("animation")
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
472 if ani_lst: break
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
473
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
474 for animation in ani_lst:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
475 source = animation.get('source')
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
476 path = file.split('/')
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
477 path.pop()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
478 path.append(str(source))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
479 self._widgets["animation"].text = unicode(str('/'.join(path)))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
480 break
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
481
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
482 def reset_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
483 self._light["stencil"] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
484 self._light["alpha"] = 0.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
485 self._light["src"] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
486 self._light["dst"] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
487
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
488 self._light["intensity"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
489 self._light["red"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
490 self._light["green"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
491 self._light["blue"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
492 self._light["radius"] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
493 self._light["subdivisions"] = 32
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
494 self._light["xstretch"] = 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
495 self._light["ystretch"] = 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
496
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
497 self._light["image"] = ""
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
498 self._light["animation"] = ""
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
499
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
500 self.lightrenderer.removeAll(str(self._widgets["group"]._getText()))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
501 self._widgets["group"].text = unicode(str(""))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
502 self._widgets["image"].text = unicode(str(""))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
503 self._widgets["animation"].text = unicode(str(""))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
504 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
505
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
506 def use_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
507 if not self._instances[0]: return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
508 counter = 1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
509 if self._widgets["ins_id"]._getText() == "":
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
510 objid = self._instances[0].getObject().getId()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
511 insid = str(objid + str(counter))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
512 while bool(self._layer.getInstance(insid)):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
513 counter = int(counter+1)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
514 insid = str(objid + str(counter))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
515 self._instances[0].setId(insid)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
516
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
517 if self._light["stencil"] is not -1 and self._light["alpha"] is not 0.0: self.stencil_test()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
518 if self._simple_l: self.simple_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
519 if self._image_l: self.image_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
520 if self._animation_l: self.animation_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
521
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
522 def highlight_selected_instance(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
523 """ highlights selected instance """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
524 self.renderer.removeAllOutlines()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
525 self.renderer.addOutlined(self._instances[0], WHITE["r"], WHITE["g"], WHITE["b"], OUTLINE_SIZE)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
526
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
527 def change_light(self, value=0.01, option=None):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
528 self._light[option] = self._light[option] + value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
529 if self._light[option]+ value < -1 and (option == "src" or option == "dst" or option == "stencil"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
530 self._light[option] = -1
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
531 if self._light[option]+ value < 0 and option != "src" and option != "dst" and option != "stencil":
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
532 self._light[option] = 0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
533 if self._light[option]+ value > 7 and (option == "src" or option == "dst"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
534 self._light[option] = 7
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
535 if self._light[option]+ value > 255 and (option == "intensity"
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
536 or option == "red"
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
537 or option == "green"
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
538 or option == "blue"
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
539 or option == "stencil"):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
540 self._light[option] = 255
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
541 if self._light[option]+ value > 1 and option == "alpha":
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
542 self._light[option] = 1.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
543
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
544 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
545
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
546 def stencil_test(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
547 self.lightrenderer.addStencilTest(str(self._widgets["group"]._getText()), self._light["stencil"], self._light["alpha"])
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
548
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
549 def simple_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
550 if not self._instances[0]: return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
551 self.lightrenderer.removeAll(str(self._widgets["group"]._getText()))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
552
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
553 node = fife.LightRendererNode(self._instances[0])
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
554 self.lightrenderer.addSimpleLight(str(self._widgets["group"]._getText()),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
555 node,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
556 self._light["intensity"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
557 self._light["radius"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
558 self._light["subdivisions"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
559 self._light["xstretch"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
560 self._light["ystretch"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
561 self._light["red"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
562 self._light["green"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
563 self._light["blue"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
564 self._light["src"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
565 self._light["dst"],)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
566
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
567 def image_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
568 if not self._instances[0]: return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
569 self.lightrenderer.removeAll(str(self._widgets["group"]._getText()))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
570
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
571 image = str(self._widgets["image"]._getText())
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
572 if image == "": return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
573 img_id = self.imagepool.addResourceFromFile(image)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
574 self._light["image"] = int(img_id)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
575 node = fife.LightRendererNode(self._instances[0])
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
576 self.lightrenderer.addImage(str(self._widgets["group"]._getText()),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
577 node,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
578 self._light["image"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
579 self._light["src"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
580 self._light["dst"],)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
581
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
582 def animation_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
583 if not self._instances[0]: return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
584 self.lightrenderer.removeAll(str(self._widgets["group"]._getText()))
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
585
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
586 animation = str(self._widgets["animation"]._getText())
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
587 if animation == "": return
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
588 rloc = fife.ResourceLocation(animation)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
589 ani_id = self._animationpool.addResourceFromLocation(rloc)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
590 self._light["animation"] = int(ani_id)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
591 node = fife.LightRendererNode(self._instances[0])
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
592 self.lightrenderer.addAnimation(str(self._widgets["group"]._getText()),
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
593 node,
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
594 self._light["animation"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
595 self._light["src"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
596 self._light["dst"],)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
597
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
598 def reset_global_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
599 """ reset global light to default values (1.0) """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
600 self._color.update(DEFAULT_GLOBAL_LIGHT)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
601 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
602 self.set_global_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
603
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
604 def increase_color(self, step=0.1, r=None, g=None, b=None, a=None):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
605 """ increase a given color value by step value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
606
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
607 @type step float
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
608 @param step the step for changing the color channel
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
609 @type r bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
610 @param r flag to alter red color value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
611 @type g bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
612 @param g flag to alter green color value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
613 @type b bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
614 @param b flag to alter blue color value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
615 @type a bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
616 @type a flag to alter alpha channel value (no effect atm)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
617 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
618 if r:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
619 if self._color["R"] + step > 1.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
620 self._color["R"] = 1.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
621 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
622 self._color["R"] += step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
623 if g:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
624 if self._color["G"] + step > 1.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
625 self._color["G"] = 1.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
626 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
627 self._color["G"] += step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
628 if b:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
629 if self._color["B"] + step > 1.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
630 self._color["B"] = 1.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
631 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
632 self._color["B"] += step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
633 if a:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
634 if self._color["A"] + step > 1.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
635 self._color["A"] = 1.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
636 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
637 self._color["A"] += step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
638
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
639 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
640 self.set_global_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
641
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
642 def decrease_color(self, step=0.1, r=None, g=None, b=None, a=None):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
643 """ decrease a given color value by step value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
644
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
645 @type step float
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
646 @param step the step for changing the color channel
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
647 @type r bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
648 @param r flag to alter red color value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
649 @type g bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
650 @param g flag to alter green color value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
651 @type b bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
652 @param b flag to alter blue color value
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
653 @type a bool
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
654 @type a flag to alter alpha channel value (no effect atm)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
655 """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
656 if r:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
657 if self._color["R"] - step < 0.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
658 self._color["R"] = 0.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
659 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
660 self._color["R"] -= step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
661 if g:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
662 if self._color["G"] - step < 0.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
663 self._color["G"] = 0.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
664 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
665 self._color["G"] -= step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
666 if b:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
667 if self._color["B"] - step < 0.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
668 self._color["B"] = 0.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
669 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
670 self._color["B"] -= step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
671 if a:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
672 if self._color["A"] - step < 0.0:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
673 self._color["A"] = 0.0
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
674 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
675 self._color["A"] -= step
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
676
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
677 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
678 self.set_global_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
679
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
680 def random_color(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
681 """ generate random values for color channels """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
682 self._color["R"] = random.uniform(0,1)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
683 self._color["G"] = random.uniform(0,1)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
684 self._color["B"] = random.uniform(0,1)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
685 self._color["A"] = random.uniform(0,1)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
686
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
687 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
688 self.set_global_light()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
689
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
690 def set_global_light(self):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
691 """ update the global light with the current set colors """
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
692 self._camera.setLightingColor(self._color["R"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
693 self._color["G"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
694 self._color["B"],
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
695 self._color["A"]
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
696 )
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
697
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
698 def input(self, instances):
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
699 if instances != self._instances:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
700 if self.active is True:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
701 self._reset()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
702 self._instances = instances
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
703
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
704 if self._camera is None:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
705 self._camera = self._editor.getActiveMapView().getCamera()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
706 self.renderer = fife.InstanceRenderer.getInstance(self._camera)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
707 self.lightrenderer = fife.LightRenderer.getInstance(self._camera)
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
708
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
709 self._layer = self._editor.getActiveMapView().getController()._layer
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
710
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
711 if self._instances != ():
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
712 self.init_data()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
713 self.highlight_selected_instance()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
714 self.update_gui()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
715 self.container.show()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
716 else:
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
717 self._reset()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
718 self.container.hide()
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
719
60621d858548 * Fixed the image/animation functions in GenericRenderer and LightRenderer. The functions now consider the camera zoom level.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
720 self.container.adaptLayout(False)