Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mitigations for #423. #432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions korman/exporter/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def _export_camera_modifier(self, so, bo, props, trans):
continue
cam_trans = plCameraModifier.CamTrans()
if manual_trans.camera:
# Don't even bother if a disabled camera is referenced. If we export camera modifier
# for a disabled camera, then it won't get a brain, and the client will crash.
if not manual_trans.camera.plasma_object.enabled:
continue
cam_trans.transTo = self._mgr.find_create_key(plCameraModifier, bl=manual_trans.camera)
cam_trans.ignore = manual_trans.mode == "ignore"

Expand Down
2 changes: 2 additions & 0 deletions korman/exporter/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ def export_dynamic_env(self, bo, layer, texture, pl_class):
# least a SceneObject and CoordInterface so that we can touch it...
# NOTE: that harvest_actor makes sure everyone alread knows we're going to have a CI
if isinstance(viewpt.data, bpy.types.Camera):
if not viewpt.plasma_object.enabled:
raise ExportError(f"DynamicCamMap '{texture.name} wants to use the camera '{viewpt.name}', but it is not a Plasma Object!")
pl_env.camera = self._mgr.find_create_key(plCameraModifier, bl=viewpt)
else:
pl_env.rootNode = self._mgr.find_create_key(plSceneObject, bl=viewpt)
Expand Down