Browse Source

Merge pull request #278 from Hoikas/movable_lamps

Don't mark lights in a group as `kLPMovable`.
pull/282/head
Adam Johnson 3 years ago committed by GitHub
parent
commit
ccc921b4dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      korman/exporter/rtlight.py
  2. 7
      korman/nodes/node_python.py

2
korman/exporter/rtlight.py

@ -193,7 +193,7 @@ class LightConverter:
# If the lamp has any sort of animation attached, then it needs to be marked movable. # If the lamp has any sort of animation attached, then it needs to be marked movable.
# Otherwise, Plasma may not use it for lighting. # Otherwise, Plasma may not use it for lighting.
if bo.plasma_object.has_animation_data: if bo.plasma_object.has_animation_data and not has_lg:
pl_light.setProperty(plLightInfo.kLPMovable, True) pl_light.setProperty(plLightInfo.kLPMovable, True)
# *Sigh* # *Sigh*

7
korman/nodes/node_python.py

@ -260,7 +260,7 @@ class PlasmaPythonFileNode(PlasmaVersionedNode, bpy.types.Node):
# Special PFM-SO handling ahoy - be sure to do it for all objects this PFM is attached to. # Special PFM-SO handling ahoy - be sure to do it for all objects this PFM is attached to.
# Otherwise, you get non-determinant behavior. # Otherwise, you get non-determinant behavior.
self._export_ancillary_sceneobject(exporter, so) self._export_ancillary_sceneobject(exporter, bo, so)
# No need to continue if the PFM was already generated. # No need to continue if the PFM was already generated.
if pfm.filename: if pfm.filename:
@ -297,11 +297,12 @@ class PlasmaPythonFileNode(PlasmaVersionedNode, bpy.types.Node):
self._export_key_attrib(exporter, bo, so, i, socket) self._export_key_attrib(exporter, bo, so, i, socket)
pfm.addParameter(param) pfm.addParameter(param)
def _export_ancillary_sceneobject(self, exporter, so : plSceneObject) -> None: def _export_ancillary_sceneobject(self, exporter, bo, so: plSceneObject) -> None:
# Danger: Special case evil ahoy... # Danger: Special case evil ahoy...
# If the key is an object that represents a lamp, we have to assume that the reason it's # If the key is an object that represents a lamp, we have to assume that the reason it's
# being passed to Python is so it can be turned on/off at will. That means it's technically # being passed to Python is so it can be turned on/off at will. That means it's technically
# an animated lamp. # an animated lamp.
if not bool(bo.users_group):
for light in exporter.mgr.find_interfaces(plLightInfo, so): for light in exporter.mgr.find_interfaces(plLightInfo, so):
exporter.report.msg("Marking RT light '{}' as animated due to usage in a Python File node", exporter.report.msg("Marking RT light '{}' as animated due to usage in a Python File node",
so.key.name, indent=3) so.key.name, indent=3)
@ -324,7 +325,7 @@ class PlasmaPythonFileNode(PlasmaVersionedNode, bpy.types.Node):
plFactory.ClassName(key.type), indent=3) plFactory.ClassName(key.type), indent=3)
if isinstance(key.object, plSceneObject): if isinstance(key.object, plSceneObject):
self._export_ancillary_sceneobject(exporter, key.object) self._export_ancillary_sceneobject(exporter, bo, key.object)
def _get_attrib_sockets(self, idx): def _get_attrib_sockets(self, idx):
for i in self.inputs: for i in self.inputs:

Loading…
Cancel
Save