Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / wire on selected toggle
  RSS 2.0 ATOM  

wire on selected toggle
Rate this thread
 
37127
 
Permlink of this thread  
avatar
  • dj
  • Posted: 26 November 2009 03:00 AM
  • Location: Munich
  • Total Posts: 50
  • Joined: 27 April 2009 12:03 PM

Hi guys
i’d love to have a shortcut (toggle) that can turn the wire=on on selected object…
same like Display as See-Through Toggle but not with transparent material, i’d like to see wire only
any ideas?



http://djordjejovanovic.com/blog/

Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

Wireframe is a Viewport Rendering mode, not a per-object property. I don’t think what you’re asking for is possible.

You could just press F3 to toggle the Viewport between shaded/wireframe.

Did you mean this to be posted in the Wishlist forum? Because that’s where it ought to be, I think. If you want it moved, just ask (don’t create a duplicate thread please).



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 0
avatar
  • dj
  • Posted: 26 November 2009 03:32 AM

Yeah i was afraid it was not per-object property…
but i created a workaround like this:

i apply Standard material to desired object and than run these scripts to turn the wire

(
meditMaterials[1].wire = on
)

and

(
meditMaterials[1].wire = off
)

this way i can have wire on desired object only… but its painful because I have to apply the material each time…
so if, maybe, someone who knows the maxscript cold put the script to apply the material first and then to turn on the wire… all in one… and toggle would be great....
is this possible?

and second thing… is it maybe possible to edit “see-through” to be completly transparent....

i was hoping that this could be resolved fast by someone who knows maxScript, but if not, then you can put it in Wishlist :))

big thanks
cheers
Djordje



http://djordjejovanovic.com/blog/

Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

I nearly mentioned a Material but thought it would be too much of a pain to do every time. It would be scriptable though - an extension of what you have already.

(
if $.material == undefined then
   
$.material standard diffuse:(colour 255 255 255) wire:true
else
   $.
material.wire not $.material.wire
)

Change the color values to something suitable.
If the object has no material, apply one, otherwise toggle the wire parameter. Will obviously go wrong on any other than a “standard” material type! Could be expanded to test the material class to exclude that possibility.

To remove it

$.material undefined

You can change the see-through colour (Customise | Customise User Interface) but I don’t know if you can change the transparency.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 0
avatar
  • dj
  • Posted: 26 November 2009 04:59 AM

thanks for helping me out!

I’m not sure that i’m doing something right here?

i have few objects, all with the same default A&D material
i select one object, run your code = -- Unknown property: “wire” in Arch & Design (mi)_1:Arch___Design__mi

But, when i apply standard material manually it works great!

so is there a way to skip that step of applying standard material manually?

thanks



http://djordjejovanovic.com/blog/

Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

Well - I did warn you it probably wouldn’t work if the object already had a non-Standard material applied.

The only way for this to work is for the script to automatically remove any non-Standard material and replace it with the Standard one.

(
if $.material == undefined then
   
$.material standard diffuse:(color 255 200 150) wire:true
else
   if 
((classof $.material) != Standardmaterial) then
      
$.material standard diffuse:(color 255 200 150) wire:true
   
else
      $.
material.wire not $.material.wire
)


Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 0
avatar
  • dj
  • Posted: 26 November 2009 06:39 AM

Thanks man!
Works perfect :)
I owe you one!

all the best
Djordje



http://djordjejovanovic.com/blog/

Replies: 0