Sanity check please

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
Old 06 June 2012   #1
Sanity check please

Could someone run this code and tell me what happens please?

I would expect there to be two boxes and both should be selected.

It appears to not matter which Max version is used (I've tried 2009 x64 and 2012 x64).

resetMaxFile()
    
   b1 = box position:[-15, 0, 0]
   b2 = box position:[15, 0, 0]
   
   ids = for geom in geometry collect geom.inode.handle
   
   for id in ids do
  (
  	local obj = maxOps.getNodeByHandle id
  	obj.isSelected = true
  )

Cheers,

Drea
 
Old 06 June 2012   #2
This:
obj.isSelected = true

deselects all selected objects and select the obj.
Use this:
selectMore obj

insetead of
obj.isSelected = true
 
Old 06 June 2012   #3
What is better is to collect the nodes in an array and then select the array.
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 06 June 2012   #4
Quote: What is better is to collect the nodes in an array and then select the array.

Normally I'd agree, but for my actual use case I need to deselect as well. I also need to leave already selected nodes unchanged.

I don't see anything in the docs to suggest that setting isSelected on a node would deselect another node(s?). isHidden and isFrozen don't work like that.

I'm not sure why I haven't come across this before, but it seems to be a long standing bug/feature.
 
Old 06 June 2012   #5
Originally Posted by DreaTawn: I don't see anything in the docs to suggest that setting isSelected on a node would deselect another node(s?). isHidden and isFrozen don't work like that.

I'm not sure why I haven't come across this before, but it seems to be a long standing bug/feature.


i don't use the setting of .isselected property often. but i was not too much surprised that the setting it to ON for one node deselects all other. Well... it might make sense. For example when you create a new node. But the funnier thing is to set it to OFF for one node deselects all!

Last edited by denisT : 06 June 2012 at 12:06 AM.
 
Old 06 June 2012   #6
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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:39 PM.


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