apply a file to an object in a scene


Is there a way to apply a file to an object in a scene via script?

Essentially dragging and dropping the file onto the object.


I think you lack detail to get a proper response.

You have a cube, you want to drag a file (what kind) onto it.
What should happen?


there is a special macroscript extension “.DS” it’s used with dropScript events. see mxs help (macroscript droppable and drop event for details)

 macroScript NodeDropEvent
 	on droppable window node: return (window == #viewport and node != undefined)
 	on drop window node: point: do 
 		format "window:% node:% point:%
" window node point

save the code above as a file (NodeDropEvent.ds for example) and try to drop it onto a node in max viewport


Denis, Thanks, I’ll take a look at the dropScript event!

Alexander, It basically custom properties/material file that comes from our game enginge.


Yet again, Dennis suggests something that I haven’t even heard of. So thanks Dennis!
And now that I know what you are trying to do, I can acknowledge that Dennis’ idea is far superior to what I might have otherwise suggested.


dropScript system is cool. but honestly for many years working in the max i couldn’t find any place for its useful utilization.


I’d tend to agree with you.
I think I’d be more inclined to either a call back, or a quick script/macro to apply the information needed. Easier to stay in max.

I have seen applications though where I think it would be useful. Like an asset browser that would let you drag/drop an old scene and populate your current scene with: the render settings, the light rig, the camera rig, or something to that effect.


that’s a different story… you can drop any .MS file in the viewport and it will be automatically evaluated… try :wink:


And I just started to think I was getting to know my precious 3DS max.
You sir, must have been playing this game for decades.
I don’t know how I ever missed that. :banghead:


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.