- This topic has 7 replies, 4 voices, and was last updated 5 years, 3 months ago by GLiFTeK.
-
AuthorPosts
-
2019-09-03 at 8:39 pm #18399GLiFTeKCustomer
i can’t seem to find where i read about it before, but there was something in the manual talking about how you could designate whatever object’s child or parent.
could you direct me to where that info is plz?
thnxVisit 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!2019-09-04 at 6:07 am #18400Mikhail LuzyaninStaffYou mean directly in the application. You need to use Parent Puzzle.
Co-founder and lead graphics specialist at Soft8Soft.
2019-09-04 at 9:50 pm #18428GLiFTeKCustomerright.. but more precisely i’m looking to return the name of a certain child of an object.
ie: if foo does something, then give a variable’s value the name of it’s (only) child.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!2019-09-05 at 6:41 am #18429Mikhail LuzyaninStaffright.. but more precisely i’m looking to return the name of a certain child of an object.
ie: if foo does something, then give a variable’s value the name of it’s (only) child.Unfortunally there’s no way to do it using Puzzles.
Co-founder and lead graphics specialist at Soft8Soft.
2019-09-05 at 6:48 am #18430Yuri KovelenovStaffHi,
You can do it with JavaScript the following way:
var object = app.scene.getObjectByName("myObjectName"); var firstChildName = object.children[0].name;
see also https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html
2019-09-05 at 3:05 pm #18437jemCustomer@gliftek, I often need this sort of helper function in my applications. When I do need this sort of solution, I use the technique that Yuri has described. I write JS code, wrap it in a function, and call that function from my puzzles. This technique is the #2 method from the documentation. https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html#Method_2_Versatile
However, I think the example from the documentation can be improved. We have a newer JS puzzle that takes parameters accepts a return value from a JS helper function. Here is Yuri’s code using this technique:
function prepareExternalInterface(app) { app.ExternalInterface.getFirstChild = function(parentObjectName) { var object = app.scene.getObjectByName(parentObjectName); return object.children[0].name; } }
Jeremy Wernick
2019-09-06 at 6:36 am #18465Yuri KovelenovStaff2019-09-06 at 7:35 am #18470GLiFTeKCustomerwow.
thank you very much for pointing me in that direction.
very appreciative of that help.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.