You can select multiple objects and apply a material to them. How ever apply a UVWmap modifier to the same selected objects the mod is applied to the group as a whole not independently.
This applies a cylindrical UVWmap to one object.
macros.run "Modifiers" "UVWmap"
$.modifiers[#UVW_Mapping].maptype = 1
How could you apply the mod to a select group individually?
Comments (12)
Comment policy
try this one instead (Anubis has probably a much better solution) ;o)
This keeps other modifiers in the stack and remove uvw map only.
Doh
Good point. I didn't try it with other mods in the stack. How ever Now it adds two maps and will not delete ether.
about deleteModifier()
Yes, Tassel is right about deleting. Delete by index is not safe. Well, somehow ".uvw_Map" return error here, but ".UVW_Mapping" works fine --
Update
Thanks to Tassel and Anubis for there update's
I rolled in "check for modifier compatibility" from Anubis. I also added a delete button.
Thank you for the info Anubis :)
RE: small question
I see you done what you need, but as you ask about shapes - yes, they're separate category (not belong to Geometry).
Ah, and one more advise :)
GeometryClass is too large category that include standard and extended primitives, polys, meshes, compound and dynamics objects, targetObject, particles, patches, nurbs, bones, biped, CATs, conteiners, body, mr_Proxy, some DWG helpers ... etc.
In other words, more safety expression would be if you check for modifier compatibility, i.e. is concrete modifier applicable to selected object, something like:
Cheers!
A small question since this thread is about UV's:)
I tried to add a UVW map modifier to an spline object with this code (Dosn't work):
But this works:
Any idee why? I thought splines/Shapes belonged to geometryClass ?
I ended up with modifying othoap's script to this:
uvwMap maptype:1 cap:on
You has made syntax mistake for .cap property.
When you create new node, modifier, material... you call their Constructor and all properties are optional and passed with "propName:Value" syntax. Once remember this, you'll have zero problems in the future ;)
Meanwhile, I post a script to Fit the UVWmap gizmo on existing modifiers:
http://www.scriptspot.com/3ds-max/scripts/fit-the-uvw-mapping-gizmo
Regards,
Anubis
thanks you-all's
I got this to work with you-all's help - thanks Anubis
How ever # 3 cylinder capping dose not work.
Hi Othoap,
This works fine here (Max2009):
(all gizmos Fit their owner objs just fine)
Yes But
Tassel - thanks. BTW I loved "Back to the start" Every one go check out tassels website and the short "Back to the start"
Running your script puts uvwmaps on all the selected objects but dose not "Fit" them to the object. I removed the maptype l,h,w but it then put a uvwmap on all selected objects at the size of the whole group.
I looked in maxscript docs for a "Fit" function with no luck.
Wouldn't the dimensions of each selected node need to be found then applied to each of there l,w,h.
$Box01.modifiers[#UVW_Mapping].length = 39.0483
$Box01.modifiers[#UVW_Mapping].width = 83.6749
$Box01.modifiers[#UVW_Mapping].height = 94.8316
I think this is part of the puzzle http://www.scriptspot.com/bobo/mxs9/uvwgizmofit/index.html
Are you out afther something like this?