View Full Version : script for assigning objects to current layer
sketchbook 02-06-2010, 04:16 PM I have a layer i have solo'd and selected in the layer manager, and i'd love it if any new objects i create would either be added to that layer or if i could press a shortcut key or run a script that would assign the object to the current layer.
thanks
|
|
bandini
02-06-2010, 04:32 PM
Can't be done in COFFEE. COFFEE just does not have access to the layer manager. You can try py4d or do a c++ plugin.
Don't know if you're aware, but you can right-click on the object and do layer assignments there. Works great when you have a bunch of objects you want to assign to one layer.
Scott Ayers
02-06-2010, 06:50 PM
This will add selected objects to a selected Layer. But it won't work if the layer is in solo mode.
You'll have to jump out of solo mode to use it.
CallCommand(100004736); // Add object/s to currently selected Layer
-ScottA
bandini
02-07-2010, 05:11 PM
Ah, yes... the CallCommand functions would work as expected. But for advanced controls you would need C++ or Py4D. Say, for instance if the layer you want to add to is not the selected layer.
For sketchbook's case CallCommand sounds like a pretty good solution.
bandini
02-07-2010, 05:14 PM
You could also throw in the command the unsolo the layer first, then add to layer, then resolo to resolve the problem scott is talking about.
Solo command is 100004726
sketchbook
02-08-2010, 06:44 AM
Thanks all! I'll give this a try
CGTalk Moderation
02-08-2010, 06:44 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.