- May 6, 2020 at 13:28 #27762j.a.bParticipantPosts: 2Threads: 3Joined: Apr 2020::
Hello!
I’m very new to Project manager and am loving it so far. Great job!
I have a very specific layer structure I use for projects, and it would be very handy to be able to select a layer, and then drag-and-drop merge objects and have them automatically be moved to that layer. This could possibly be an option
- May 6, 2020 at 13:58 #27764Oleksandr KramerModeratorPosts: 257Threads: 1133Joined: Aug 2009
You can do this using Project Manager API
Save the next script to file “MovetoCurrentLayer.ms” and place it to the startup scripts directory.
Restart 3ds max.
fn MovetoCurrentLayer &PostMergeStruct = ( local layer = layermanager.Current for obj in PostMergeStruct.Nodes where isValidNode obj and not isDeleted obj do layer.addNode obj ) if (superClassOf PmCallbacks == structDef) do ( PmCallbacks.removeScripts CallbackID:#MovetoCurrentLayer PmCallbacks.addScript #postFileMerge MovetoCurrentLayer CallbackID:#MovetoCurrentLayer )
For details see the example about callback #postFileMerge on the page
https://3d-kstudio.com/faq-cat/maxscript-api/
Have a good day!
- May 6, 2020 at 15:03 #27765j.a.bParticipantPosts: 2Threads: 3Joined: Apr 2020
Fantastic! Thank you :)
Is there a spot where your examples such as this are saved? I’m sure there are a lot of handy scripts like this you’ve made…
- January 18, 2021 at 15:15 #30854KARIM HASSAYOUNEParticipantPosts: 3Threads: 5Joined: Sep 2014
Hey,
Did this script work for you ?
I saved it to the startup scripts folder as instructed but it does seem to work.
I tried running this command :
PmCallbacks.Show()
and it returns this :
#postFileMerge:
CallbackId:#MovetoCurrentLayer, MovetoCurrentLayer()So the callback seems to be added properly right ?
- January 18, 2021 at 16:23 #30856Oleksandr KramerModeratorPosts: 257Threads: 1133Joined: Aug 2009
- January 18, 2021 at 16:41 #30857KARIM HASSAYOUNEParticipantPosts: 3Threads: 5Joined: Sep 2014
Ah yes, ok perfect.
Thank you.
You must be logged in to reply to this topic.