Css3drenderer and css2drenderer exist at the same time. Click events can only detect one layer with higher level - pythreejs

I have a problem. When I use css2drenderer and css3drenderer at the same time, when adding click events to the instantiated css2dobject and css3dobject tag elements, because the dom of css2drenderer and css3drenderer have levels, click events can only detect one of them; Is there a raycaster method to detect css3dobject / css2dobject objects to add click events; Or there's a better wayenter image description here

Related

How to webgl detach transform control when click another range not transform control

I'm developing webgl graphics with three.js
While I developing, I'm facing something stuck.
I'm trying to detach transform control when I click another range(ex, grid or another objects) not transform control.
I implemented it by checking clicked position.
For example, I set event handler with mouse down and in there, I store that mouse position. Also I set event handler with mouse up and in there, I compare mouse positions both mouse down and mouse up. If two positions are same, I detach the transform controller. However with this implementation, transform controller was disappeared though I clicked transform controller.
I just wanna detach transform control when I click another position not transform control
Does anyone help me please with this issue?
Thank you in advance.

Selection box is dragged, but not the object

I'm using FabricJS for some project, and my goal now is to save the new coordinates when the user drag an object. My issue is that when I select an object and move it, the selection box moves but not the object.
Image there:
I have some code which deal with object selection and mouse click and move events, so I tried to remove them but the issue persists.
Edit: looks like it's only a graphical issue, because the object:moved event is well triggered.
Edit 2 : after some progress in the development, this bug has mutated: now the object and the selection box move together, but I have to click two times on the object to make the selection box appear (while the selection events are triggered on the first click).

Stopping clicks on object on one stage going through to the nextStage in EaselJS / CreateJS

I have two canvases and two stages in CreateJS / EaselJS. The first stage has autoClear set to false and I am doing dynamic drawing on it starting with a stagemousedown event. The second stage uses nextStage to send mouse events to the first stage. The second stage has interface such as a Bitmap that I want to press on to go to another page. When I click on the Bitmap, the stage beneath does the dynamic drawing. I want the click on the Bitmap not to go through to the first stage but stopImmediatePropagation does not work, nor does putting a clone of the Bitmap with mouseEnabled false on it underneath. I can just use mousedown on the Bitmap so the user does not notice as much, but was wondering if there is a way to disable mouse events from passing through the top stage if they are acting on an object with an event set to capture? Thanks in advance.
The stagemousedown and other stage events are decoupled from the EaselJS object event model. They are catch-all events, which basically represent mouse interaction with the . Because of this, catching and stopping these events won't interrupt the display list hierarchy.
Typically if you want to block other events in the same stage, you can create a canvas-size box (Shape, etc) that will block the interaction. When dealing with nextStage, this is especially true, since we are passing on events that are unhandled by objects in the EaselJS display list.
A better approach might be to toggle the nextStage on stagemousedown, so it is null during the click event. Not sure if this will work, but its a start.

Is there a way to add multiple properties in the Unity 3d animation window at once?

In Unity you can animate an object (such as a character) with the animation window:
And you can select properties of the object that you want to animate:
My problem is that it seems you can only add a single property at a time and then the whole list closes:
This causes a big problem when you want to animate every part of a full human (or any type of complex) 3d model:
My Question: Is there some way I can add more than one property at the same time? Or atleast not have the window of properties close, that way I can just keep choosing them?
Worth mentioning as well that if you right click on the transform instead of hitting the plus sign you can just add an entire group of transforms and the menu does not close. Should speed things up
The animation window will close after adding the property but their is a way to do this . Open animation window and inspector in separate tabs so that both can be seen at same time and animation must be in recording mode . After that select your game object in hirarchy and you can directly change its properties from inspector for each selected frame for example you can set position rotation and scale directly from inspector and this will make your animation in a fly :) Reference to unity documentation http://docs.unity3d.com/Manual/animeditor-MultipleParts.html
Yes! I've tested this method on Unity 2020.3.29f1, but it may work in earlier versions too.
In your hierarchy tab, select which bones you want to add properties for*. If you want to include all bones, select the parent bone and right click -> Select Children.
In your inspector tab, go to the Transform component and right click on Position, then select Add Key
Repeat step 2 for Rotation and Scale, if desired.
*: If you want to select multiple bones but not every bone, you can expand your list of bones and the use shift-click and ctrl-click (cmd-click) to select various bones.

Discard mouse events on NSWindow based on click position

Let's say I have a floating, borderless, circular NSWindow.
It is circular because the content view simply draws a red circle.
That content view needs to be layer-backed ([contentView setWantsLayer:YES]), because I'm applying CoreAnimations on it, e.g., animated scaling.
Usually, the clickable area of a NSWindow is defined by the transparency of the pixels of the content view. However, once the content view of a NSWindow becomes layer-backed, transparent areas will also receive clicks, unfortunately.
In my case, this is a serious problem, because I only want to receive clicks within the radius. But now, a click within the rect of the window, but beyond the circle radius, will activate the window (and thus, the entire app), which it shouldn't. Also the window is draggable via the corner of its content view.
My initial thought was to implement [NSWindow sendEvent:] in a subclass and check whether the click was performed within the radius, using [theEvent locationInWindow]. I thought I could simply discard the event, if it's beyond the radius, by not calling [super sendEvent:theEvent] then. This however did not work: I noticed, that the mouseDown:; window method is called even before the sendEvent:; method.
I've search a lot but the only idea I found, was to have a proxy like non-layer backed NSWindow on top of the window, which delegates clicks conditionally, but this led to unpredictable UI behavior.
Do you guys have any idea, how to solve it?
So after a few weeks, I came to the following results:
A) Proxy window:
Make use of a non layer-backed proxy window, which is placed on top of the target window as a child window. The proxy window has the same shape, as the target window, and since it is not layer-backed, it will properly receive and ignore events. The proxy window delegates all events to the target window by overwriting sendEvent:. The target window is set to ignore all mouse events.
B) Global Mouse Pointer observation:
Install both a global and local event monitor for NSMouseMovedMask|NSLeftMouseDraggedMask events using addGlobalMonitorForEventsMatchingMask and addLocalMonitorForEventsMatchingMask. The event monitors disable and enable ignoring mouse events on all registered target windows based on the current global mouse position. In the case of circular windows, the distance between the mouse pointer and every target window must be calculated.
Both approaches work well in generally, but I've been experiencing some unpredictable misbehaviors of the child window approach (where the child window is 'out-of-sync' of its parent's position).
UPDATE: Both approaches have some significant disadvantages:
In A), the proxy window sometimes may be out of sync and may be placed slightly off the actual window.
In B), the event monitor has a big impact on battery life while moving the mouse, even if the app is not the front-most application.
If you want to Discard mouseDown event based on position you can use the:
CGPathContainsPoint(path,transform,point,eoFill):Bool
Setup your path to match your graphics. Circles, ellipses, rectangles, triangles or paths and even compositional paths (paths with holes in them).

Resources