Materials.current on OS X

13 views
Skip to first unread message

locksmithdon

unread,
Aug 24, 2010, 2:12:44 AM8/24/10
to Google SketchUp Developers - SketchUp Ruby API
I can't seem to get Materials.current to return the material selected
in the Materials window on OS X Snow Leopard (10.6.4) using SketchUp 7
(7.1.6859). It always returns the last material in the active_model's
materials property.

Sketchup.active_model.materials[Sketchup.active_model.materials.count-1]

independent of the currently selected material.

Is it just me or something I'm doing wrong?

Thanks,
Don

TIG

unread,
Aug 24, 2010, 2:43:35 PM8/24/10
to Google SketchUp Developers - SketchUp Ruby API
Sketchup.active_model.materials.current SHOULD return the currently
selected material in the Browser - it might be the last one =
materials[-1] BUT it might not ??

Dan Rathbun

unread,
Aug 24, 2010, 7:48:52 PM8/24/10
to Google SketchUp Developers - SketchUp Ruby API
On Aug 24, 2:12 am, locksmithdon wrote:
>
> Is it just me or something I'm doing wrong?

NO. It's not you. It is an internal API bug on the Mac edition.

The GSUDT has a bug number filed for this. (Can't say when an update
might be released, as I don't know.)

You will not see the current "selected" material returned (on the
Mac,) UNTIL a user actually does the first Paint with the selected
material. On the PC, the selected material is returned as soon as the
user, selects it in the browser.

Sorry...

locksmithdon

unread,
Aug 28, 2010, 12:00:16 PM8/28/10
to Google SketchUp Developers - SketchUp Ruby API
Gotcha. Thanks for the responses.

Don
Reply all
Reply to author
Forward
0 new messages