How to pick a group object?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  06 June 2013
Originally Posted by gazybara: I give up. Please show me what you have

i will make you a test scene... wait a little
 
  06 June 2013
Originally Posted by denisT: the third mistake in the way how you collect geometry objects

I agree about that.
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by denisT: i will make you a test scene... wait a little

here is it:

 delete objects
 
 b0 = box pos:[40,0,0] wirecolor:orange
 b1 = box pos:[80,0,0] wirecolor:orange
 
 g0 = group #(b0,b1)
 
 b2 = box pos:[40,40,0] wirecolor:green
 b3 = box pos:[80,40,0] wirecolor:green
 
 g1 = group #(b2,b3)
 g2 = group #(g0,g1)
 
 in (box pos:[0,0,40] wirecolor:blue) (g2.parent = box pos:[0,0,80] wirecolor:red)
 for g in #(g0,g1,g2) do setGroupOpen g on
 
 
  06 June 2013
you have to provide two methods - getRootGroupHead and getGeometryGroupMembers
to get this work:

(
	if (node = pickObject()) != undefined do
	(
		if (head = getRootGroupHead node) != undefined do nodes = getGeometryGroupMembers head
		format "head:%\n\tnodes:%\n" head nodes 
	)
)
/*
head:$Dummy:Group003 @ [60.000000,20.000000,12.500000]
	nodes:#($Box:Box001 @ [40.000000,0.000000,0.000000], $Box:Box002 @ [80.000000,0.000000,0.000000], $Box:Box003 @ [40.000000,40.000000,0.000000], $Box:Box004 @ [80.000000,40.000000,0.000000])
*/
 
  06 June 2013
From schematic view

I run this
getGrandParentGroup $Box004
--$Box:Box005 @ [0.000000,0.000000,40.000000]

Why function ignore opened groups?
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by denisT: you have to provide two methods - getRootGroupHead and getGeometryGroupMembers
to get this work:

  (
  	if (node = pickObject()) != undefined do
  	(
  		if (head = getRootGroupHead node) != undefined do nodes = getGeometryGroupMembers head
  		format "head:%\n\tnodes:%\n" head nodes 
  	)
  )
  /*
  head:$Dummy:Group003 @ [60.000000,20.000000,12.500000]
  	nodes:#($Box:Box001 @ [40.000000,0.000000,0.000000], $Box:Box002 @ [80.000000,0.000000,0.000000], $Box:Box003 @ [40.000000,40.000000,0.000000], $Box:Box004 @ [80.000000,40.000000,0.000000])
  */
  

Wow Denis. I never doupted that your solution will not be the best.
First time I see theses two methods getRootGroupHead and getGeometryGroupMembers .
MXS HELP not have explained theses badass methods?
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: Wow Denis. I never doupted that your solution will not be the best.
First time I see theses two methods getRootGroupHead and getGeometryGroupMembers .
MXS HELP not have explained theses badass methods?

THESE ARE MY FUNCTIONS!!! ha-ha... you have to write your own. that what i was asking you
 
  06 June 2013
do you know how many geometry classes in standard max system are not really geometries?
11 (you check only 1 - TargetObject)

so you need another function to do - isRealGeometry
 
  06 June 2013
Originally Posted by denisT: THESE ARE MY FUNCTIONS!!! ha-ha... you have to write your own. that what i was asking you

Now you could have fooled me
I already wrote my but ... . Anyway thanks. This was fun.
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: I already wrote my but ...

do they work correct now?
 
  06 June 2013
btw... all three my functions are only one line of code... so they are simple if you know what to do
 
  06 June 2013
here is improved test:

delete objects
(
	b0 = box pos:[40,0,0] wirecolor:orange
	b1 = box pos:[80,0,0] wirecolor:orange
	sn = snow()

	g0 = group #(b0,b1,sn)

	b2 = box pos:[40,40,0] wirecolor:green
	b3 = box pos:[80,40,0] wirecolor:green
	mr = mr_Proxy pos:[0,40,0]

	g1 = group #(b2,b3,mr)
	g2 = group #(g0,g1)

	in (box pos:[0,0,40] wirecolor:blue) (g2.parent = box pos:[0,0,80] wirecolor:red)
	for g in #(g0,g1,g2) do setGroupOpen g on
)
 
  06 June 2013
Can I use this to find out isRealGeomtry?(I add only two classes for check)

 for o in geometry where canConvertTo o editable_mesh and canConvertTo o editable_poly collect o
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: Can I use this to find out isRealGeomtry?(I add only two classes for check)

   for o in geometry where canConvertTo o editable_mesh and canConvertTo o editable_poly collect o

that's the right idea... but it's absolutely enough to check only conversion to editable_mesh
search in geometry is too long... there is a better way
 
  06 June 2013
Can you tell me why:
> this works

b0 = box pos:[40,0,0] wirecolor:orange
b1 = box pos:[80,0,0] wirecolor:orange
in (g0 = group #(b0,b1)) (box pos:[0,0,40] wirecolor:blue) 

> and this not

b0 = box pos:[40,0,0] wirecolor:orange
b1 = box pos:[80,0,0] wirecolor:orange
in (box pos:[0,0,40] wirecolor:blue) (g0 = group #(b0,b1)) 
__________________
Looking in the right side. [bgaTools]
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:54 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.