Clone Element Within Studio
I did some searching and it seems that it is possible to clone and element using code (c++/c#). However, I have not seen a way to do it from within Studio itself. My use case is, I want to click/tap on and element, clone it and be able to drag the clone and then place the clone somewhere else. Is this possible from within the Studio? I am using Meta Horizon Worlds engine and do not have full access like I would using Unreal or Unity. Thanks!
Re: Clone Element Within Studio
Hi Gausroth,
Happy new year!
Just to ensure we understand what you're looking for here:
1) As an editor/creator, how to click-and-drag to clone an Element within Studio.
If so, this can be done by holding [Alt] on the keyboard, and clicking and dragging an Element in the Stage or in the Navigator.
2) As an end-user, how to click-and-drag an instance of an Element in the running product.
If so, this can be achieved via our MouseDragElementBehavior, which can be added to an Element from the Interactivity Panel, under the 'Behaviors' tab.
More information on the technical aspects of Drag-and-Drop Behaviors in Noesis can be found here: Drag-and-Drop Overview
Let's start here!
- Dorian
Happy new year!
Just to ensure we understand what you're looking for here:
1) As an editor/creator, how to click-and-drag to clone an Element within Studio.
If so, this can be done by holding [Alt] on the keyboard, and clicking and dragging an Element in the Stage or in the Navigator.
2) As an end-user, how to click-and-drag an instance of an Element in the running product.
If so, this can be achieved via our MouseDragElementBehavior, which can be added to an Element from the Interactivity Panel, under the 'Behaviors' tab.
More information on the technical aspects of Drag-and-Drop Behaviors in Noesis can be found here: Drag-and-Drop Overview
Let's start here!
- Dorian
Re: Clone Element Within Studio
I was able to achieve that but I do not want the origonal element to move. I want to achieve something like this: https://youtu.be/taUoRO9m2hw
Re: Clone Element Within Studio
Hi Gausroth,
Thanks for this video, this was great to illustrate the desired functionality.
In this case, the best way to approach this at a conceptual level, would be to have two superimposed instances of each 'draggable' object in each 'slot'; one which gets physically dragged-and-dropped as you've achieved, and one which stays fixed in its 'slot' of origin.
This, from a user's perspective, then gives the visual illusion of dragging out a clone, without moving, and still maintaining access to the 'original' in its initial position.
Let us know if this solution works for you.
- Dorian
Thanks for this video, this was great to illustrate the desired functionality.
In this case, the best way to approach this at a conceptual level, would be to have two superimposed instances of each 'draggable' object in each 'slot'; one which gets physically dragged-and-dropped as you've achieved, and one which stays fixed in its 'slot' of origin.
This, from a user's perspective, then gives the visual illusion of dragging out a clone, without moving, and still maintaining access to the 'original' in its initial position.
Let us know if this solution works for you.
- Dorian
Re: Clone Element Within Studio
I'll give it a try. Though I might be possible to require multiple of one element. Though I should be able to set the selected elements data (size, color, text) on the dragged one. I'll play with it, Thanks!
Re: Clone Element Within Studio
I was able to recreate the pickup and drag but when I drop it into a stack panel with allowDrop true nothing happens. I would assume it would reparent. I event tried triggering a command when dropped on both the dragged element and the element I dropped in on and nothing. I looked at the drag and drop docs and it says there should be a DragItemBehavior and a DropItemBehavior but they must be custom behaviors as they are not in Studio. Not sure how to create these behaviors.
Re: Clone Element Within Studio
Hi Gausroth,
In terms of the DragItemBehavior and the DropItemBehavior, I've created a Ticket for us to add these to Noesis Studio. This can be followed at #4680.
In terms of an immediate solution for you however, our recommendation would essentially be to make the target of the drag-and-drop an ItemsControl Element that is bound to a (Data) Collection.
Then, mechanically, what would be set up, is that when an Element is dropped into this ItemsControl, a Command is triggered that adds the dragged item into the Collection.
Let us know if this works as a solution for you,
Thanks!
- Dorian
In terms of the DragItemBehavior and the DropItemBehavior, I've created a Ticket for us to add these to Noesis Studio. This can be followed at #4680.
In terms of an immediate solution for you however, our recommendation would essentially be to make the target of the drag-and-drop an ItemsControl Element that is bound to a (Data) Collection.
Then, mechanically, what would be set up, is that when an Element is dropped into this ItemsControl, a Command is triggered that adds the dragged item into the Collection.
Let us know if this works as a solution for you,
Thanks!
- Dorian
Who is online
Users browsing this forum: No registered users and 1 guest