- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by Yuri Kovelenov.
-
AuthorPosts
-
2019-10-20 at 2:44 am #20482GLiFTeKCustomer
hio
is it able to have a lone object become part of a collection using puzzles?
possibly javascript?is using group the same as collections?
ie://These cubes can now be rotated / scaled etc as a group var group = new THREE.Group(); group.add( cubeA ); group.add( cubeB ); scene.add( group );
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-10-20 at 10:14 am #20490Yuri KovelenovStaff2019-10-21 at 1:27 pm #20516GLiFTeKCustomerHi,
to add an object to a collection, you can use the following code:
myObj.groupNames.push('mycollectionName');
to discern the object and the group in puzzles i did this.. but not working.. any pointers?
app.ExternalInterface.addToGroup = function(myObj, mycollectionName) { myObj.groupNames.push(mycollectionName); }
then also
app.ExternalInterface.addToGroup = function(myObj, mycollectionName) { var object = myObj.groupNames.push(mycollectionName); }
no dice
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-10-21 at 1:50 pm #20517Yuri KovelenovStaff2019-10-21 at 2:59 pm #20520GLiFTeKCustomer2
var myObj = app.scene.getObjectByName(‘myObjectName’);
myObj.groupNames.push(‘mycollectionName’);kk.. soo liiiiike..
to wrap that in a JS call puzzle.. so i can use it in puzzles… and to designate those….
i useapp.ExternalInterface.addToGroup = function ()
before that right?
then designate the inputs the JScall puzzle piece has as inputs as function parameters right?trying like this..
app.ExternalInterface.addToGroup = function () { var myObj = app.scene.getObjectByName('Info_Glass'); myObj.groupNames.push('Fader Collection'); }
does the job perfect.
but i want to make the puzzle have inputs so i can plug in any items as the object and the array, IN the JS Puzzle…. like this..
app.ExternalInterface.addToGroup = function (objectToAdd,arrayToAddTo) { var myObj = app.scene.getObjectByName(objectToAdd); myObj.groupNames.push(arrayToAddTo); }
but not working. the JS call inputs should be named the function parameters right?
edit… this attempt here..
app.ExternalInterface.addToGroup = function (objectToAdd) { var myObj = app.scene.getObjectByName(objectToAdd); myObj.groupNames.push('Fader Collection'); }
works where i can plug in any object to the object to be added slot…
i think the last above version is satisfactory for what i’m doing.
if i need a different collection to add to, i’d just make a new js call with the different collection designated.but i’m curious.
is the “groupNames” distinct to v3d.js ?
if so, i’m guessing it’s what designates collections?
that in mind, i’m wondering how to format the above to receive a variable that would allow for dynamic naming of whichever list i want.do you use .filter() to REMOVE objects from collections?
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-10-22 at 1:50 pm #20587Yuri KovelenovStaffis the “groupNames” distinct to v3d.js ?
if so, i’m guessing it’s what designates collections?yes and yes!
that in mind, i’m wondering how to format the above to receive a variable that would allow for dynamic naming of whichever list i want.
I think this variant of yours should work
app.ExternalInterface.addToGroup = function (objectToAdd,arrayToAddTo) { var myObj = app.scene.getObjectByName(objectToAdd); myObj.groupNames.push(arrayToAddTo); }
do you use .filter() to REMOVE objects from collections?
yes this should work!
-
AuthorPosts
- You must be logged in to reply to this topic.