Compare commits

...

3 Commits

Author SHA1 Message Date
Adam Johnson 3939f6e642
Convert xSitCam.py to regular engine features. 4 months ago
Adam Johnson 1cf51e6828
Bump dependencies. 4 months ago
Adam Johnson 3f628efd14
Allow colliders to optionally block clickables. 4 months ago
  1. 14
      cmake/Dependencies.cmake
  2. 2
      korman/exporter/physics.py
  3. 25
      korman/properties/modifiers/avatar.py
  4. 31
      korman/properties/modifiers/base.py
  5. 3
      korman/properties/modifiers/physics.py
  6. 1
      korman/ui/modifiers/physics.py

14
cmake/Dependencies.cmake

@ -189,7 +189,7 @@ endfunction()
if(korman_BUILD_JPEG) if(korman_BUILD_JPEG)
korman_add_external_project(libjpeg-turbo korman_add_external_project(libjpeg-turbo
GIT_REPOSITORY "https://github.com/libjpeg-turbo/libjpeg-turbo.git" GIT_REPOSITORY "https://github.com/libjpeg-turbo/libjpeg-turbo.git"
GIT_TAG 3.0.3 GIT_TAG 3.1.0
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_SHARED:BOOL=FALSE -DENABLE_SHARED:BOOL=FALSE
@ -222,7 +222,7 @@ if(korman_BUILD_STRING_THEORY)
if(MSVC AND MSVC_VERSION LESS 1900) if(MSVC AND MSVC_VERSION LESS 1900)
set(_string_theory_tag 2.4) set(_string_theory_tag 2.4)
else() else()
set(_string_theory_tag 3.7) set(_string_theory_tag 3.8)
endif() endif()
korman_add_external_project(string_theory korman_add_external_project(string_theory
@ -247,7 +247,7 @@ if(korman_BUILD_ZLIB)
endif() endif()
korman_add_external_project(zlib korman_add_external_project(zlib
GIT_REPOSITORY "https://github.com/zlib-ng/zlib-ng.git" GIT_REPOSITORY "https://github.com/zlib-ng/zlib-ng.git"
GIT_TAG 2.1.7 GIT_TAG 2.2.4
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF
-DZLIB_COMPAT:BOOL=ON -DZLIB_COMPAT:BOOL=ON
@ -258,9 +258,9 @@ endif()
if(korman_BUILD_PNG) if(korman_BUILD_PNG)
korman_add_external_project(libpng korman_add_external_project(libpng
URL "https://sourceforge.net/projects/libpng/files/libpng16/1.6.43/libpng-1.6.43.tar.gz/download" URL "https://sourceforge.net/projects/libpng/files/libpng16/1.6.45/libpng-1.6.45.tar.gz/download"
DOWNLOAD_NAME "libpng-1.6.43.tar.gz" DOWNLOAD_NAME "libpng-1.6.45.tar.gz"
URL_HASH "SHA256=e804e465d4b109b5ad285a8fb71f0dd3f74f0068f91ce3cdfde618180c174925" URL_HASH "SHA256=7dee9e1ca8152bf52f919456f4190330aee48209887f2ec0b3d9f0ad571df11b"
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF
-DPNG_EXECUTABLES:BOOL=OFF -DPNG_EXECUTABLES:BOOL=OFF
@ -273,7 +273,7 @@ if(korman_BUILD_HSPLASMA)
korman_add_external_project(HSPlasma korman_add_external_project(HSPlasma
GIT_REPOSITORY "https://github.com/H-uru/libhsplasma.git" GIT_REPOSITORY "https://github.com/H-uru/libhsplasma.git"
# Be sure to increase this as the feature set used by Korman increases # Be sure to increase this as the feature set used by Korman increases
GIT_TAG f372a43a8ce78b056fe21c7ed372f04a88b20e98 GIT_TAG 93fb48b5ce0911e0f58b731f7d7b3e4e5ccabfd8
# We can only do shallow checkouts if the above is a branch or tag. # We can only do shallow checkouts if the above is a branch or tag.
GIT_SHALLOW FALSE GIT_SHALLOW FALSE
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS

2
korman/exporter/physics.py

@ -189,6 +189,8 @@ class PhysicsConverter:
if mod.camera_blocker: if mod.camera_blocker:
physical.LOSDBs |= plSimDefs.kLOSDBCameraBlockers physical.LOSDBs |= plSimDefs.kLOSDBCameraBlockers
_set_phys_prop(plSimulationInterface.kCameraAvoidObject, simIface, physical) _set_phys_prop(plSimulationInterface.kCameraAvoidObject, simIface, physical)
if mod.clickable_blocker:
physical.LOSDBs |= plSimDefs.kLOSDBUIBlockers
if mod.terrain: if mod.terrain:
physical.LOSDBs |= plSimDefs.kLOSDBAvatarWalkable physical.LOSDBs |= plSimDefs.kLOSDBAvatarWalkable

25
korman/properties/modifiers/avatar.py

@ -128,15 +128,24 @@ class PlasmaSittingBehavior(idprops.IDPropObjectMixin, PlasmaModifierProperties,
sittingmod = nodes.new("PlasmaSittingBehaviorNode") sittingmod = nodes.new("PlasmaSittingBehaviorNode")
sittingmod.approach = self.approach sittingmod.approach = self.approach
sittingmod.name = "SittingBeh" sittingmod.name = "SittingBeh"
# xSitCam.py PythonFileMod
if self.sitting_camera is not None:
sittingpynode = self._create_python_standard_file_node(tree, "xSitCam.py")
sittingmod.link_output(sittingpynode, "satisfies", "sitAct")
# Camera Object # Sitting Camera handling
cameraobj = nodes.new("PlasmaAttribObjectNode") if self.sitting_camera is not None:
cameraobj.link_output(sittingpynode, "pfm", "sitCam") sitDownRespNode = self._create_responder_nodes(
cameraobj.target_object = self.sitting_camera tree,
("PlasmaCameraMsgNode", { "camera": self.sitting_camera, "cmd": "push" }),
detect_trigger=True, detect_untrigger=False,
name="SitDown"
)
standUpRespNode = self._create_responder_nodes(
tree,
("PlasmaCameraMsgNode", { "camera": self.sitting_camera, "cmd": "pop" }),
detect_trigger=False, detect_untrigger=True,
name="StandUp"
)
sittingmod.link_output(sitDownRespNode, "satisfies", "condition")
sittingmod.link_output(standUpRespNode, "satisfies", "condition")
# Clickable # Clickable
clickable = nodes.new("PlasmaClickableNode") clickable = nodes.new("PlasmaClickableNode")

31
korman/properties/modifiers/base.py

@ -24,6 +24,7 @@ from typing import *
if TYPE_CHECKING: if TYPE_CHECKING:
from ...nodes.node_python import * from ...nodes.node_python import *
from ...nodes.node_responder import *
from ... import helpers from ... import helpers
from ... import plasma_api from ... import plasma_api
@ -237,6 +238,36 @@ class PlasmaModifierLogicWiz:
setattr(node, i, j) setattr(node, i, j)
return node return node
def _create_responder_nodes(
self, tree: bpy.types.NodeGroup,
*messages: Tuple[str, Dict[str, Any]],
**responder_settings
) -> PlasmaResponderNode:
"""Creates and links together a Responder node tree. Each message sould be specified by a tuple
of string message type and a dict of attributes to set on the message node. Messages will be
created and linked in the order they are specified, including any callback waits if needed.
Attributes on the responder node can be set by passing them in as keyword arguments.
"""
nodes = tree.nodes
respNode = nodes.new("PlasmaResponderNode")
for attr, value in responder_settings.items():
setattr(respNode, attr, value)
respStateNode = nodes.new("PlasmaResponderStateNode")
respNode.link_output(respStateNode, "state_refs", "resp")
linkMsgTo = respStateNode
for msgNodeType, msgNodeAttrs in messages:
msgNode = nodes.new(msgNodeType)
for attr, value in msgNodeAttrs.items():
setattr(msgNode, attr, value)
linkMsgTo.link_output(msgNode, "msgs", "sender")
if msgNode.has_callbacks and msgNode.can_link_callbacks:
linkMsgTo = msgNode
return respNode
@abc.abstractmethod @abc.abstractmethod
def logicwiz(self, bo, tree): def logicwiz(self, bo, tree):
pass pass

3
korman/properties/modifiers/physics.py

@ -73,6 +73,9 @@ class PlasmaCollider(PlasmaModifierProperties):
camera_blocker = BoolProperty(name="Blocks Camera LOS", camera_blocker = BoolProperty(name="Blocks Camera LOS",
description="Object blocks camera line-of-sight", description="Object blocks camera line-of-sight",
default=True) default=True)
clickable_blocker = BoolProperty(name="Blocks Clickables",
description="Object blocks clickables, including avatar name hotspots",
default=True)
dynamic_blocker = BoolProperty(name="Blocks Dynamics", dynamic_blocker = BoolProperty(name="Blocks Dynamics",
description="Object blocks dynamic objects (kickables)", description="Object blocks dynamic objects (kickables)",
default=True) default=True)

1
korman/ui/modifiers/physics.py

@ -22,6 +22,7 @@ def collision(modifier, layout, context):
col = split.column() col = split.column()
col.prop(modifier, "avatar_blocker") col.prop(modifier, "avatar_blocker")
col.prop(modifier, "camera_blocker") col.prop(modifier, "camera_blocker")
col.prop(modifier, "clickable_blocker")
col.prop(modifier, "dynamic_blocker") col.prop(modifier, "dynamic_blocker")
col.prop(modifier, "terrain") col.prop(modifier, "terrain")

Loading…
Cancel
Save