Notifications
Clear all

[Closed] Maxscripters: check your script for Max 2014 compatibility

There was a small change introduced with 3ds Max 2014:
struct declarations are handled in a stricter way now. You are not allowed to declare a member variable more than once ( which was possible before )
There might be some existing scripts out, which are affected by this change and might break at compile time in Max 2014. Please see the following post for exact details

http://forums.cgsociety.org/showpost.php?p=7554300&postcount=14

8 Replies

In the post you are linking to, this will work without forward definition in pre-2014 max versions :

struct TestB
(
	member1,
	
	function DependsOnF1=
	(
		this.F1();
	),

	function F1 =
	(
		print member1;
	)
)

edit: Btw, it needs an instance so that you can call theTestBInstance.DependsOnF1()

I didn’t test it in 2014, could you say us if it is still working ?

1 Reply
(@spacefrog)
Joined: 11 months ago

Posts: 0

yes still works

good to know about the this solution

I’m so used to that “pseudo forward” style that i did’nt investigate other solutions for that…

RayMeshGridIntersect.intersectSphere is broken as well, intersectBox still works so that can be used as a fallback.

Now that Max 2014 is officially released, i give this thread a little bump…

In Max 2013/2014 the following causes a system exception. It works in prior versions:

(
  	-- collect the data into an array and ensure files are absolute paths
  	local oldArray = #()
  	ATSOps.GetFiles &oldArray
  
  	for itm in oldArray do 
  	(
  		ATSOps.SelectFiles itm
  		ATSOps.ResolveSelectionToAbsolute()
  	)
  )
1 Reply
(@spacefrog)
Joined: 11 months ago

Posts: 0

yep – fails here too
Whats failing is ATSOps.ResolveSelectionToAbsolute()
Further investigation shows all ATSOps select commands throw a system exception


    <bool>ResolveSelectionToUNC()
    <bool>ResolveSelectionRelativeToProjectFolder()
    <bool>ResolveSelectionToAbsolute()

UPDATE:
I only see this exception while the Asset Tracker dialog is open. When it’s closed it doesn’t fail here
So it seems to be something in the Asset Tracker dialog code. Nevertheless i reported it …

In 2013 the skin modifier changed the list to alphabetical order, so the bone index was no longer predictable. But if you had 20 bones, the highest index was 20. If you removed 10 bones the indices were updated so the highest was now 10.

In 2014, the bone index doesn’t change if you remove a bone. So if you have 20 bones, and remove 10 the highest index is still 20. I tried the Invalidate method, but it doesn’t seem to do anything.

I had to change this function, but is there a better way?


	fn getSkinBones obj =
	(
		boneArray = #()
		bCount = skinOps.GetNumberBones obj.skin
		
		for i = 1 to bCount do
		(
			append boneArray (skinOps.GetBoneName obj.skin i 1)
		)
		
		boneArray
	)

Update:


	fn getSkinBones obj =
	(
		boneArray = #()
		bCount = skinOps.GetNumberBones obj.skin
		i = 1
		
		while boneArray.count != bCount do
		(
			try(append boneArray (skinOps.GetBoneName obj.skin i 1))catch()
				
			i += 1
		)
		
		sort boneArray
	)

I would consider this a bug ( non updating bones index )

Did you report it t? If not, please do so …