Home Website Youtube GitHub

Mgear springnode gravity

The mGear spring node is a very simple position-tracking solver. It takes into account only current and previous position. It can’t account for forces (second order acceleration) without a rewrite. This loses the simplicity of the spring node.

hi aerys

we already implemented gravity to the spring-node in our custom mgear…
already shared it with miquel…
next step could be to have some collision detection…

1 Like

@soulcage, nice ! Is it something that can share to the group?

i can share it, but it is for mgear 2.5.24 and the solvers are only compiled for maya2018…
also the component scripts are modified to work with the custom spring node…so its not implemented for higher versions of mgear (v3.x.x has a different python modules implementation as prior versions…)

I’m curious to see it, since maya 2020 is out I will probably compile a few nodes when the new devkit is released so I can play around with a gravity-enabled spring.

Collision detection sounds like a fun project haha

its here…

scroll down for the links…

1 Like

Fantastic thank you!

I guess my original concern came down to the fact that adding gravity is the same as simply offsetting the goal position in the spring node to move it downward. But when I thought about it more I realized it’s the correct thing to do.

I added a simple collider effect to the node. You can set a sphere of arbitrary radius to repel the spring and also choose how forceful the collision is. Kinda fun effect!

2 Likes

cool. have to try out…
for collision i thought to use closestPointOnMesh function/node…
there is a simple code for that here

forgot to mention, that if using gravity values more/less than 0, the spring intensity could be set above 1 to compensate the damping effect of the gravity…

1 Like

In my opinion a full mesh collision effect like that kinda tarnishes the beauty of the spring node which is that it is instantaneous. I would keep it to some sort of closed form geometrical collider, like a sphere or capsule. https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm

Perhaps it would be better to write a new node if you want something with more options? Full mesh collision gets to the point where you might be better off building a simple bullet sim into your rig instead since they can do all kinds of clever stuff to make it fast.

1 Like

just testet.
aerys this is really great!!! works like a charm…
maybe also a plane (ground) collision would be nice…

would it be possible to have more collision positions (array of collision positions)? maybe a lookup for a set (rig collision set) where spheres are inside that the node can pick up?

3 Likes

Same repository as before.

spring_new

3 Likes

ok?
but how is this setuped?
i can only connect one transform in “collider”…

edit: oh just saw that you updated the code to have a list of colliders…and ground plane…thank you so much for providing this…

No problem, thought it was a fun little project and I plan to use it myself.

This looks awesome!
Noob alert: How do you compile that? Should I use scons or cMake or?

Maya 2018.6

Thanks in advance

i compiled it with VS2015 express and win10 SDK 10.0.15063

I went through Cult of Rig tutorial: https://www.youtube.com/watch?v=8OcRTtp5Sk8 and compiled that without errors.
I can not load the plugin into Maya though - it’s saying
// Error: file: C:/Program Files/Autodesk/Maya2018/scripts/others/pluginWin.mel line 909: initializePlugin function could not be found in plug-in (SpringBuild) //

so that I added in VS Linker > Command Line > Additional Options

/export:initializePlugin /export:uninitializePlugin

and C/C++ Preprocessor added:
;NT_PLUGIN;REQUIRE_IOSTREAM

but then VS can not compile that giving 3 errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol initializePlugin	SpringBuild	C:\Users\Krzym\Desktop\Solvers\vs4\SpringBuild\SpringBuild\LINK	1	
Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol uninitializePlugin	SpringBuild	C:\Users\Krzym\Desktop\Solvers\vs4\SpringBuild\SpringBuild\LINK	1	
Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK1120	2 unresolved externals	SpringBuild	C:\Users\Krzym\Desktop\Solvers\vs4\SpringBuild\x64\Debug\SpringBuild.lib	1	

Thought maybe you will know the answer as I can not google anything helpful.
My setup its VS 15 Win 10 10.0.10586.0

The way I built it was opening a native tools command prompt and running

C:\Python27\Scripts\scons.bat -j8 no-cache=1 x64=1 with-maya=2019 mscver=14.1

1 Like

I can also upstream these features if there’s interest

1 Like

try the sdk version above (10.0.14393). sorry for the wrong sdk version.
and i compiled in release mode…

here my sln…
http://www.soulcage-department.de/Mgear_Solvers_Maya2018_CollisionGravity.zip

(you have to point to the includes and libs on your harddrive…)

4 Likes