Find linked objects
			3 posts			 • Page 1 of 1		
	
Find linked objects
Sometimes in complex scenes with lots of overlapping objects you need to select related. 
For example the axis attached to this geom. This can be done, though it's difficult.
So:
1) Select desired shape and in the script menu find it's geomID
2) From the console create a variable
scene.my.selected = []
3) Select all the axes in area and in script menu add two variables:
_geom0 = {(readable(entity)).Geom0}
and
_geom1 = {(readable(entity)).Geom1}
4) In the same menu, enter the command scripts (instead of ID use geomID from desired geom)
(_geom0 == ID) | | (_geom1 == ID) ? {scene.my.selected = scene.my.selected + + [entityID]} : {}
5) In the console, type the command
scene.addGroup {name = "selected"; entityIDs = scene.my.selected}
Voila, we have selected axes, which are attached to the geom.
Similarly, you can look for other related objects ...
			For example the axis attached to this geom. This can be done, though it's difficult.
So:
1) Select desired shape and in the script menu find it's geomID
2) From the console create a variable
scene.my.selected = []
3) Select all the axes in area and in script menu add two variables:
_geom0 = {(readable(entity)).Geom0}
and
_geom1 = {(readable(entity)).Geom1}
4) In the same menu, enter the command scripts (instead of ID use geomID from desired geom)
(_geom0 == ID) | | (_geom1 == ID) ? {scene.my.selected = scene.my.selected + + [entityID]} : {}
5) In the console, type the command
scene.addGroup {name = "selected"; entityIDs = scene.my.selected}
Voila, we have selected axes, which are attached to the geom.
Similarly, you can look for other related objects ...
Dream of Algodoo as game development engine...
		- 
				

Kilinich - [Best bug reporter 2010]
 - Posts: 2098
 - Joined: Mon Aug 31, 2009 8:27 pm
 - Location: South Russia
 
Re: Find linked objects
I've re-discover script window for myself.   
 
You can do some batch operation like increase density of white objects
... just by selecting all and enter in script window:
color == [1,1,1,1] ? {density = density * 2} : {}
 
			You can do some batch operation like increase density of white objects
... just by selecting all and enter in script window:
color == [1,1,1,1] ? {density = density * 2} : {}
Dream of Algodoo as game development engine...
		- 
				

Kilinich - [Best bug reporter 2010]
 - Posts: 2098
 - Joined: Mon Aug 31, 2009 8:27 pm
 - Location: South Russia
 
Re: Find linked objects
Kilinich wrote:Sometimes in complex scenes with lots of overlapping objects you need to select related.
For example the axis attached to this geom.
Kilinich wrote:3) Select all the axes in area and in script menu add two variables:
Kilinich wrote:Voila, we have selected axes, which are attached to the geom.
In each of those quoted statements you refer to "axis" and "axes". I don't understand how an axis can be selected or attached to a geometry. An axis is either the X axis or the Y axis of a geometry. Did you mean to say something different, like maybe "axle"? Please explain. (A sample scene would be very helpful to understand this tutorial).
- 
				

Xray - Posts: 501
 - Joined: Sun Jun 17, 2012 6:12 am
 - Location: USA
 
			3 posts			 • Page 1 of 1		
	Who is online
Users browsing this forum: No registered users and 2 guests



