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

model_matrix not updated when using manipulators #426

Open
wmalara opened this issue Jun 7, 2023 · 0 comments
Open

model_matrix not updated when using manipulators #426

wmalara opened this issue Jun 7, 2023 · 0 comments
Assignees

Comments

@wmalara
Copy link

wmalara commented Jun 7, 2023

  • K3D version: 2.15.2
  • Python version: 3.8.13
  • Operating System: Ubuntu 20.04 (backend), Windows 10 Pro (frontend)

Description

When manipulating an object in plot "manipulate" mode the object's model matrix doesn't get updated and also "observe" callback is not fired.
I found that it's probably because of this commented out code: https://github.com/K3D-tools/K3D-jupyter/blob/main/js/src/providers/threejs/initializers/Manipulate.js#L18
and could probably simply create a PR reversing this, but I guess there is some broader context of this change I don't know :) (46d508b#diff-6863658dc28ee81ff40444d18191cad7547592119a5f4a302ecee062b6bb428f).

Simple example

import k3d
import k3d.platonic

plot = k3d.plot()
cube = k3d.platonic.Cube().mesh
plot += cube
plot
plot.mode = "manipulate"
plot.manipulate_mode = "rotate"
cube.observe(print)

When manipulating the object the callback is not fired and when checking the model_matrix directly:

cube.model_matrix

it's still an identity matrix:

array([[1., 0., 0., 0.],
       [0., 1., 0., 0.],
       [0., 0., 1., 0.],
       [0., 0., 0., 1.]], dtype=float32)
@artur-trzesiok artur-trzesiok self-assigned this Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants