- This topic has 24 replies, 4 voices, and was last updated 3 years, 11 months ago by GLiFTeK.
-
AuthorPosts
-
2020-12-24 at 8:22 am #36866Yuri KovelenovStaff
We checked our git logs, and it appears we did not change this specifically in version 3.5. I don’t know why is that. Looks pretty strange.
Anyway, in our opinion, the behavior is correct for the following case: if nothing is picked then the picked object global variable is set to empty string.
Still, I think you can easily reproduce the desired behavior by creating a variable puzzle and setting it to some object that you want to be saved as picked (or some object that was actually picked by the user). Then you can just update this variable only if the picked object puzzle returns not empty string.
2021-01-11 at 11:26 pm #37252scalareCustomerHi Yuri,
I noticed the same thing with 3.5 today (not the actual code in visual_logic.js) but the behavior. We used to have a functioning set of puzzles that used to have the clicked object stored in “picked_object” even if we did not use the “when_clicked” event, and now it does not, making our solution stop from working. We were using this for a configurator and we were monitoring if users clicked on an object to make the e-commerce solution to jump to the step associated with that object. Now that jump is not working after updating/saving the puzzles.
Please help! Thank you.
Andrés2021-01-12 at 7:36 am #37270Yuri KovelenovStaff2021-01-12 at 3:13 pm #37310scalareCustomerNot necessarily a bug, but certainly something that works differently from earlier versions. I have to admit I’m not sure if this changed from 3.5 on, or it was already present in previous versions. I have been working on projects that did not involve verge3D for a long while (most of past year). I decided with the new year that it was about time to update older projects (locally first, of course) to the latest stable version and after updating I noticed that this functionality had ceased to work, and when looking for related issues I found this post.
I’ll create a reduced project that instead of calling our external javascript functions associated with the configurator steps will just print some messages to console, so you can test that with 3.5 and earlier versions. The whole thing is also related to my old post related to dragging and clicking: https://www.soft8soft.com/topic/clicking-vs-dragging/#post-27750
Stay tuned, thank you.
Andrés2021-01-12 at 7:50 pm #37320scalareCustomerOK, here is the reduced project. As you can see, the coding is able to differentiate dragging from clicking, and it also is aware of clicks that are released with a delay. The puzzles used to call the (currently disabled in the puzzles) external “move_to_step” javascript function when the picked object matched one of the objects in the two collections listed (BEDS and MATTRESSES), but now, since picked_object is always null nothing happens. It just logs to the console that a click was identified, and it was different from a camera drag, but then it cannot identify which collection was clicked on.
I hope this helps. Thanks a lot in advance!
2021-01-12 at 7:53 pm #37321scalareCustomerOops, sorry about that. It seems the zipped file is slightly larger than 4MB. I just uploaded it to our server: http://normalcreatures.com/picked_object/click-drag.zip
Thank you!
Andrés2021-01-18 at 10:26 pm #37468jdockCustomerYuri,
Is there an issue if you added the functionality to the ‘when clicked’ event to return the mesh object name in PickedObject even if it is not the target of the When Clicked event? I know it is not the intent of the When Clicked, but it was how it worked prior to 3.5.
If this is not possible, maybe some help developing a ‘Get Picked’ puzzle. The issue is really for projects like mine where a lot of cloning is involved and an elegant way of interacting with the cloned objects is needed. Basically I need a puzzle to just return PickedObject no matter what mesh is picked. This avoids creating a bunch of When Clicked events for each clone. I used conditions based on the mesh name to determine actions. If you are careful with the mesh names (like using a . at the end of the name) the clone name is predictable.
Thanks,
Jon2021-01-19 at 1:50 am #37471GLiFTeKCustomerHi,
So let me get this straight Jon.
You want to return only the “name”, not the actual js object of ANY object you click? Is that correct?Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2021-01-19 at 2:09 am #37473jdockCustomerCorrect – I believe just the object name will work. A few post in this thread I show how I modified the visual_logic.js to get it to work. I believe what I did there just returns the name, not the actual js object. This workaround works, but I want to avoid editing the visual_logic code if possible.
Thanks,
Jon2021-01-19 at 8:45 pm #37508GLiFTeKCustomertry using the “create text with” puzzle in the text section.
go into the gear setting and remove one block so there’s only one input then put it between a set variable and picked object.
then print to console the variable.that’s an easy trick. if you want you can always just go get it …
you could set the picked object to a variable pickedObj then toss that variable into the exec code puzzle and get it’s name there. ie:VARS[‘pickedObjName’] = VARS[‘pickedObj’].name;
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature! -
AuthorPosts
- You must be logged in to reply to this topic.