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 denisT: and to find a root group head we really need only one line:

  while <condition> do <iteration>
  

Always mystery with Denis.
whether the recursive function bad solution or one of many?
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: Always mystery with Denis.
whether the recursive function bad solution or one of many?

it doesn't need recursion
 
  06 June 2013
Is this correct?
(
	obj = $Box001

	while obj.parent != undefined and (isGroupHead obj.parent) do obj = obj.parent

	print obj	
)
 
  06 June 2013
Originally Posted by miauu: Is this correct?
(
  	obj = $Box001
  
  	while obj.parent != undefined and (isGroupHead obj.parent) do obj = obj.parent
  
  	print obj	
  )

no need for print but that's it. One line code
fn getRootGroupHead obj = (while obj.parent != undefined and (isGroupHead obj.parent) do obj = obj.parent)


Now we need one line for getGeometryGroupMembers function
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by miauu: Is this correct?
(
 	obj = $Box001
 
 	while obj.parent != undefined and (isGroupHead obj.parent) do obj = obj.parent
 
 	print obj	
 )

no... i give a clue... condition looks like

node != undefined and (not isgrouphed node or ...)
 
  06 June 2013
Originally Posted by gazybara: no need for print but that's it. One line code
fn getRootGroupHead obj = (while obj.parent != undefined and (isGroupHead obj.parent) do obj = obj.parent)


nope... one most important condition is missed
 
  06 June 2013
Originally Posted by denisT: no... i give a clue... condition looks like

 node != undefined and (not isgrouphed node or ...)
 

Second 1st condition "not isgrouphed node"is killing me. Are we talk about rootGroup or not?
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: Second 1st condition "not isgrouphed node"is killing me. Are we talk about rootGroup or not?

trust me... the function looks as:

fn getRootGroupHead node = if ... node do
(
	while node != undefined and (not isgrouphead node and ... node) do node = ...
	node
)
 
  06 June 2013
Originally Posted by denisT: trust me... the function looks as:

 fn getRootGroupHead node = if ... node do
 (
 	while node != undefined and (not isgrouphead node and ... node) do node = ...
 	node
 )
 

First try
fn getRootGroupHead node = if isgroupMember node do
(
	while node != undefined and (not isgrouphead node and not isKindOf node Dummy) do node = node.parent
	node
)

Returns first parent group. Second[2nd] condition is wrong or whole code
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: [CODE]... not isKindOf node Dummy ...

LOL... you are killing me... what are two BASE group related functions?
 
  06 June 2013
Originally Posted by denisT: LOL... you are killing me... what are two BASE group related functions?

Me? You are melting my brain with your tricky fn's.
isGroupHead and isGroupMember.
Or I wrong again.
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Originally Posted by gazybara: isGroupHead and isGroupMember.

yes, yes, yes!!! it's hot... only these two!
 
  06 June 2013
Originally Posted by denisT: yes, yes, yes!!! it's hot... only these two!

My mxs editor is hot. Even worse I freeze max 50 times. Only Task Manager helps me now
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
Kostadin where are you now? Help me bud, this is not easy
__________________
Looking in the right side. [bgaTools]
 
  06 June 2013
My son have 39.5 deg body temperature. I don't have much time, but
Denis, can you tell me(us) when this will not works?

while obj.parent != undefined and (isGroupHead obj.parent) do obj = obj.parent
 
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 07:32 PM.


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