How can you apply the mod individually?
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
try this one instead (Anubis
try this one instead (Anubis has probably a much better solution) ;o)
This keeps other modifiers in the stack and remove uvw map only.
/ Raymond
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 --
for i in selection do (deleteModifier i i.UVW_Mapping)
my recent MAXScripts RSS (archive here)
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.
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
Thank you for the info Anubis :)
/ Raymond
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:
for obj in selection where (validModifier obj uvwMap) do (addModifier obj (uvwMap maptype:4))
Cheers!
my recent MAXScripts RSS (archive here)
A small question since this
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:
/ Raymond
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
my recent MAXScripts RSS (archive here)
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):
for obj in selection do addModifier obj (uvwMap maptype:4)
(all gizmos Fit their owner objs just fine)
my recent MAXScripts RSS (archive here)