PDA

View Full Version : Advanced aligning to spline


fish-msk
10-30-2010, 09:00 AM
Hi guys!

My task doesn't seem to be simple, so maybe you give me some ideas, how to solve it.
I have atoms of DNA (spheres, primitives) arranged in 3D space in a helix, and I also have a helix-spline, which I want to animate (make unwinding of a DNA molecule). The problem is: how to connect every atom (sphere) with the point on the helix-spline? I need some kind of advanced aligning to a spline, when an object itself remains at its current position, but becomes connected to a spline.

I can do it by hand: select each sphere, make it editable, then move modeling axis exact on a spline, and then add to a sphere 'Align to spline' tag and adjust the position % to match the original position of a sphere. But, first of all, this way is not accurate (I can't get the same position for the sphere which it had before aligning to the helix-spline), and, second, when you have hundreds of such spheres, this becomes difficult to perform. Any ideas how to do this aligning through the script or XPresso?

Thanks in advance for your attention!

Screenshot of my scene:
http://protein.nmr.ru/fish/c4d/align_to_helix.jpg
Or the scene itself. (http://protein.nmr.ru/fish/c4d/align_to_helix.c4d)

Scott Ayers
10-30-2010, 04:02 PM
You can attach objects to points with coffee or the xpresso point node.
But you can also use the spline IK option for this too. Which might offer you some other things like stretching and twisting that might come in handy.

-Create your spline
-Add the Spline IK tag to it
-Create a sphere for each point
-Put the spline in the spline field of the tag
-Put the last sphere in the "Last" field in the tag
-Use the create handles option in the tag and drop in your other spheres to lock them to the spline's points


-ScottA

fish-msk
10-30-2010, 07:12 PM
The problem is that, some spheres lie not directly on a spline, and they should stay in these positions after linking to it.

Jorge Arango
10-30-2010, 08:18 PM
You can combine what Scott says with this:

http://forums.cgsociety.org/showthread.php?f=182&t=920421

Scott Ayers
10-30-2010, 09:04 PM
Instead of spheres. Attach nulls to the spline.
Then add the spheres as a child to each null.
That will make the spheres follow the spline. And also let you move them away with offsets if needed.

If you have mograph. You can use the spline effector to do this kind of thing a lot easier.
Then use the random, formula, or shader effectors to offset the spheres how you like.
That way you don't have to make the helix spline editable.

-ScottA

fish-msk
10-31-2010, 03:16 PM
Scott, thank you for the idea!

Ok, I've added IK-Spline tag to my helix spline, then dragged the spline to the "Spline field" of the tag, then created nulls at the points on the spline, and when I create handles and drag nulls to that handles - spline deforms and freezes and this nulls positions. Maybe I do smth wrong? I don't what my spline to deform..

Scott Ayers
10-31-2010, 04:23 PM
Sounds like you're doing it right Alexander. I'm not sure why it's freezing on you.
But the method I explained is for using the objects to control the spline. And I think what you're looking for is the opposite. Where the objects just stay attached to the spline while you edit the spline.


This is really where Mograph shines.
If you don't have Mograph. I have this really cool file from years ago that mimics Mograph.
Click on the "ENT_ATS" object and you'll see all of the attributes that you can change with it.
You can also drop a Helix spline into the spline field if you want. And in the group section you can put your spheres.

-ScottA

CGTalk Moderation
10-31-2010, 04:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.