Notifications
Clear all

[Closed] Looping Create Variable to store in array, each variable an array

Hey can someone help me figure this out?

					rollout rWNGenerate "Group Uv Tool"
						(
							local totgroups=#()
							local goa=#()
							button theCopyUVButton "Copy" width:80 align:#left offset:[0,0]
							on theCopyUVButton pressed do
							(
								print "begarraytsgood"
								goa = selection[1].modifiers[1].groupName ArrayParameter default: #()
								print "group of arrays good"
								for g in goa do
								(
									--append [g] selection[1].modifiers[1].groupName ArrayParameter default: #()
									for i = 1 to totgroups do
									(
										print "beginning sort good"
										selection[1].modifiers[1].GroupSelect g
										totgroups[i] = selection[1].modifiers[1].getSelectedFaces()
										print "end sort good"
									)
									print totgroups
								)
							)

According to my debugger it breaks at :
goa = selection[1].modifiers[1].groupName ArrayParameter default: #()

That doesn’t make sense though? If anyone could explain I would be appreciative.

4 Replies

This is directly from Maxscript help file. See how the .groupName is used.

EXAMPLE 
 
 --Assuming there are already 3 Groups created using the UI,
$.modifiers[#Unwrap_UVW].groupName --See what the names are...
--> #("__INTERNALCLUSTER_0", "__INTERNALCLUSTER_1", "__INTERNALCLUSTER_2")
$.modifiers[#Unwrap_UVW].groupName[2] = "Test" --Replace second name
-->OK
$.modifiers[#Unwrap_UVW].groupName --Check to see the result
--> #("__INTERNALCLUSTER_0", "Test", "__INTERNALCLUSTER_2")
$.modifiers[#Unwrap_UVW].groupDensity --Look at the Density array
--> #(1.0, 1.0, 1.0)
$.modifiers[#Unwrap_UVW].groupDensity = #(0.8, 0.9, 0.95) --Replace all
--> OK
$.modifiers[#Unwrap_UVW].groupDensity --Look again...
--> #(0.8, 0.9, 0.95)

Oh okay, I fixed that I will go ahead and try to debug the rest. Thank you so much!

Dearest @miauu,

THANK YOU. You know why I’m thanking you. We all know why I am thanking you. Because you are on polycount.

On scriptspot:
http://www.scriptspot.com/forums/3ds-max/general-scripting/array-problem
And on here just solving all my problems. Thank you thank you thank you my dude!

You are the best I got the entire script working thank you so much For every question I had you had an answer.

Thank you. The most important is that you have solved your problems.