PDA

View Full Version : Unwinding DNA using bones?



inkpen3d
02-13-2012, 10:32 AM
Hi guys,

I've been scratching my head over this problem for a few days now and have hit a brick wall...

DNA comprises two strands (A & B) that are wound around each other to form a double helix. I want to show the double-stranded DNA (dsDNA) unwinding to form two single strands.

The analogy would be if you got a length of string comprising two strands, teased apart one end of the string and, grasping each end between forefinger and thumb, pulled the ends of the separated strands apart - as you do so the remaining string rotates around and around as it unwinds.

The method I have tried is based on William Vaughan's rope and pulley tutorial that uses a morph to move the rope along a bone chain.

Likewise, each single strand of the dsDNA has a morph applied to it that moves it along the Z-axis (i.e. the long axis of the strand). A skelegon chain is constructed that follows the helix of the given strand (note that I plan to eventually extend each skelegon chain so that the single strands would be directed out and away from the dsDNA).

The set-up is imported into Layout, bones created from the skelegons and the heading/pitch of the bone-chain cleared. The given single strand of DNA uses the appropriate bone chain and has the morph applied using morphmixer.

As you can see from the attached images (for clarity, all images except the first show only a single strand) the single strand of DNA does not follow the bone chain properly and is massively distorted. I have tried various ways to try and get rid of this distortion, but without success.

If any of you with more experience of using bones could point out where I am going wrong, or perhaps even suggest a better method to achieve the result that I am after, it would be very much appreciated.

Kind regards,
Peter

nickdigital
02-13-2012, 10:50 AM
Your bones might be in the wrong rest rotation. Whenever I use the Morph Down Bone Chain trick my setup state for my bones is perfectly straight. Since your bones are initially curved your rest state is in that position. What I would do is key your current state at frame 1, go back to frame 0 and zero out all your rotations. Then rest your bones.

shrox
02-13-2012, 10:56 AM
Is this a "representation" of DNA? That is the stick model, and looks nothing like DNA. Here is a pic of a realistic model. Such a realistic model might help hide some odd deformations too.

If they've requested a stick model representation, well darn.

http://www.strategosinc.com/images/dna.jpg

inkpen3d
02-13-2012, 11:08 AM
Your bones might be in the wrong rest rotation. Whenever I use the Morph Down Bone Chain trick my setup state for my bones is perfectly straight. Since your bones are initially curved your rest state is in that position. What I would do is key your current state at frame 1, go back to frame 0 and zero out all your rotations. Then rest your bones.

Many thanks Nick, I'll give that method you suggest a try.


Is this a "representation" of DNA? That is the stick model, and looks nothing like DNA. Here is a pic of a realistic model. Such a realistic model might help hide some odd deformations too.

If they've requested a stick model representation, well darn.

http://www.strategosinc.com/images/dna.jpg

Many thanks Shrox - I am using the stepladder representation as a proxy for the other more biochemically accurate model that I'll be using. We biochemists use a range of different ways to represent DNA - sometimes you need a space-filling model, such as the one you kindly posted, as you're interested in how other molecules interact with it, other times you just want a stripped down representation of the DNA strand with the bases colour-coded as you're only concerned with the sequence of the bases.

I think the distortion is so bad that even a space-filling model wouldn't hide it! ;-)

Kind regards,
Peter

shrox
02-13-2012, 11:15 AM
Many thanks Nick, I'll give that method you suggest a try.



Many thanks Shrox - I am using the stepladder representation as a proxy for the other more biochemically accurate model that I'll be using. We biochemists use a range of different ways to represent DNA - sometimes you need a space-filling model, such as the one you kindly posted, as you're interested in how other molecules interact with it, other times you just want a stripped down representation of the DNA strand with the bases colour-coded as you're only concerned with the sequence of the bases.

I think the distortion is so bad that even a space-filling model wouldn't hide it! ;-)

Kind regards,
Peter

Yes, I too understand the models, so many people think DNA is really a twisted ladder with smooth hard rungs and stringers! I use RasMol sometimes in my own research on my own medical condition. But I can never get the ribbon models to display.

inkpen3d
02-13-2012, 11:49 AM
Yes, I too understand the models, so many people think DNA is really a twisted ladder with smooth hard rungs and stringers! I use RasMol sometimes in my own research on my own medical condition. But I can never get the ribbon models to display.

Indeed, and they also don't realise that the helix has major/minor grooves running along its length - something which always sorts the men from the boys when visualising DNA!

Have you tried using the free Accelrys Discovery Studio Visualizer (http://accelrys.com/products/discovery-studio/visualization-download.php). It has lots of display modes (various atomic representations, plus several DNA/RNA modes) and you can export to a range of file formats.

Kind regards,
Peter

jeric_synergy
02-13-2012, 12:54 PM
If any of you with more experience of using bones could point out where I am going wrong, or perhaps even suggest a better method to achieve the result that I am after, it would be very much appreciated.

Kind regards,
Peter
Well, if you can make this work with bones, you deserve a medal.

A possible alternative approach would be to use the TWIST and BEND deformers. Model your DNA straight, and use DEFORM:TWIST in Layout to get the initial helix.

It might work. I'd do a lot of tests before it got too involved, it might be a total bust.

Let us know how it goes.

shrox
02-13-2012, 01:14 PM
I have used HVs to model DNA, this might work with unwinding it, since you would just have points to work with. That would really help it look "realistic". Is it just the average layman/consumer viewing this?

A really rough attempt attached.

SteveH
02-13-2012, 02:09 PM
I've been working on a DNA strand animation for a long time - but it's going the other way - a single strand that wraps/bends onto itself and connects up certain nucleotides while leaving others unconnected. I've got it done up to the point where the pair of nucleotides twist once they connect with each other. It's a bear getting this to look right. (expecially when I have little idea of what it's REALLY supposed to look like). I'm limited in my knowledge of bones so....if you figure everything out - let me know how you did it! :help:

inkpen3d
02-13-2012, 02:10 PM
I have used HVs to model DNA, this might work with unwinding it, since you would just have points to work with. That would really help it look "realistic". Is it just the average layman/consumer viewing this?

A really rough attempt attached.

Thanks for the suggestion - definitely food for thought. Unfortunately, my clients and their audience are in the business of dealing with DNA/RNA, so the models have to be 100% accurate.

Kind regards,
Peter

inkpen3d
02-13-2012, 02:21 PM
I've been working on a DNA strand animation for a long time - but it's going the other way - a single strand that wraps/bends onto itself and connects up certain nucleotides while leaving others unconnected. I've got it done up to the point where the pair of nucleotides twist once they connect with each other. It's a bear getting this to look right. (expecially when I have little idea of what it's REALLY supposed to look like). I'm limited in my knowledge of bones so....if you figure everything out - let me know how you did it! :help:

Yes, I have to do those type of models as well - called hairpin DNA. You also get the same type of hairpin structures with the transfer RNA's (tRNA) that are involved in protein synthesis. As you say, those hairpin structures are a pain to work with, so you've done a sterling job there.

Kind regards,
Peter

inkpen3d
02-13-2012, 02:26 PM
Well, if you can make this work with bones, you deserve a medal.

A possible alternative approach would be to use the TWIST and BEND deformers. Model your DNA straight, and use DEFORM:TWIST in Layout to get the initial helix.

It might work. I'd do a lot of tests before it got too involved, it might be a total bust.

Let us know how it goes.

Many thanks for the suggestion - I'll keep that in mind. However, since I am dealing with very long double and single strands of DNA it might get a bit unwieldy.

Kind regards,
Peter

inkpen3d
02-13-2012, 02:56 PM
Your bones might be in the wrong rest rotation. Whenever I use the Morph Down Bone Chain trick my setup state for my bones is perfectly straight. Since your bones are initially curved your rest state is in that position. What I would do is key your current state at frame 1, go back to frame 0 and zero out all your rotations. Then rest your bones.

Hi Nick,

Well, I tried what you suggested...

After I'd cleared all the bones heading/pitch rotations to zero, the single strand model snapped out to beyond the bones on the Z-axis and took on a distorted shape (as before). I then rested all the bones (r-key) and the strand model snapped back to lie coincident with the bones and was undistorted. However, the move-morph now just shunted the strand back and forth along the Z-axis without it following the bones - also, all the heading/pitch values on the bones had returned to the same values as before I zeroed them. So back to square one!

Kind regards,
Peter

lertola2
02-14-2012, 07:35 AM
I think if you want to unwind dna you need a setup similar to this. Because even if you got the bones you are using to animate from a twisted chain to a straight one the in between animation is likely to point the dna at odd angles. With a setup like this you can animate the untwisting from the center of the dna strand. This is relatively easy to setup by creating the bones as slelegons in modeler.


http://forums.newtek.com/attachment.php?attachmentid=101768&stc=1&d=1329229769

shrox
02-14-2012, 08:00 AM
I think if you want to unwind dna you need a setup similar to this. Because even if you got the bones you are using to animate from a twisted chain to a straight one the in between animation is likely to point the dna at odd angles. With a setup like this you can animate the untwisting from the center of the dna strand. This is relatively easy to setup by creating the bones as slelegons in modeler.


http://forums.newtek.com/attachment.php?attachmentid=101768&stc=1&d=1329229769

Yes, that looks very good.

3DGFXStudios
02-14-2012, 08:07 AM
Did you guys know there is a DNA generator in LW. It's not in the gui by default but it pretty nice ;). It's called DNA builder.....

shrox
02-14-2012, 08:25 AM
Did you guys know there is a DNA generator in LW. It's not in the gui by default but it pretty nice ;). It's called DNA builder.....

I can't find it. I did find this online:

http://home.comcast.net/~erniew/lwsdk/sample/dna/dna.c

jeric_synergy
02-14-2012, 12:05 PM
Did you guys know there is a DNA generator in LW. It's not in the gui by default but it pretty nice ;). It's called DNA builder.....
Do you have a filename?

(the "Edit Plugins" Panel can show you the source filename of a plugin or Lscript)

jeric_synergy
02-14-2012, 12:08 PM
I think if you want to unwind dna you need a setup similar to this. Because even if you got the bones you are using to animate from a twisted chain to a straight one the in between animation is likely to point the dna at odd angles. With a setup like this you can animate the untwisting from the center of the dna strand. This is relatively easy to setup by creating the bones as slelegons in modeler.


http://forums.newtek.com/attachment.php?attachmentid=101768&stc=1&d=1329229769
Looks cool. Now, how do you get a progressive twisting of the center bones? I assume it's a hierarchical chain, would you just select all the spine bones and enter a Bank amount? (It'll add up.) Or is there an easier way, a rotational-IK way where you'd only twist ONE bone?

shrox
02-14-2012, 12:37 PM
Do you have a filename?

(the "Edit Plugins" Panel can show you the source filename of a plugin or Lscript)

And is it modeler or layout, I am guessing modeler. I have 9.6.1

lertola2
02-14-2012, 06:22 PM
Looks cool. Now, how do you get a progressive twisting of the center bones? I assume it's a hierarchical chain, would you just select all the spine bones and enter a Bank amount? (It'll add up.) Or is there an easier way, a rotational-IK way where you'd only twist ONE bone?

To rotate the dna strand I just grabbed all the center bones and entered a bank amount. I gave the center skelegons a unique name in modeler so that when I converted to bones I was able to easily select just the center bones in the scene editor.

This is an interesting problem and I have been trying to think of ways to animate the overall shape of dna while it is curled up. And I would like to know how to unwind a part of the dna and separate the two strands and animate a ribosomes attaching. I can't think of an easy way to do these things though.

jeric_synergy
02-14-2012, 08:41 PM
This is an interesting problem and I have been trying to think of ways to animate the overall shape of dna while it is curled up. And I would like to know how to unwind a part of the dna and separate the two strands and animate a ribosomes attaching. I can't think of an easy way to do these things though.
Hmmmm........::bluesky:: if Bones could be LAYERED, one layer could do one part of an animation/deformation, THEN the next layer could its deformation. For this very specific problem, that kind of approach would work.

In general, I think one would HAVE to cheat: animate each half, then do the bending bit separately. Just duplicate the DNA mesh and hide alternate halves of the chain.

I remember MAYA did a promo showing how they layered... 'animation layers'??? It allowed them to tweak motions, it was like an extra layer of deformation on top of the main animation. In the demo it allowed them to tweak the clearance of a knee over a vehicle as the character jumped into the seat. --It was very attractive as a feature, but I'm almost positive you could get the same effect in LW using DPont nodes. Someone just has to figure it out.

+++++

Anyone find that Modeler DNA generator yet???

.

Dexter2999
02-14-2012, 09:04 PM
I don't know about a DNA generator, but there is a Helix tool under Multiply>Duplicate>More

probiner
02-15-2012, 12:03 AM
Super cheated :D
Twisted and Scaled it in Layoout with Morph in Node Editor. I think Twist modifier is World Related and so I couldn't spin the object without screwing the twist so... I spinned the camera aroud :D

http://i153.photobucket.com/albums/s202/animatics/Lightwave/dna.gif

Cheers

inkpen3d
02-15-2012, 03:03 AM
Hi guys,

Many thanks for all of your input - it's very much appreciated and certainly contains lots of interesting ideas. :thumbsup:

My main problem is not so much the construction of the double-stranded DNA itself (I can do that very easily and accurately) but specifically the separating and guiding the two strands along specific paths with a fixed unwind point for the ds-DNA.

The attached diagram hopefully makes it clear what exactly I am trying to achieve and why I thought bone-chains would perhaps be the solution. Unfortunately, I don't think any of the excellent suggestions made so far quite solves this particular aspect of the problem.

Thanks in advance.

Kind regards,
Peter

3DGFXStudios
02-15-2012, 03:46 AM
And is it modeler or layout, I am guessing modeler. I have 9.6.1

I added the DNA.p file. Don't know where I got it, but it's fun :D:thumbsup:

cagey5
02-15-2012, 06:35 AM
Talking of Helixes. There was a simple trick of cloning an object along a helix and then deleting the original object in order to be left with a helix path to extrude along etc.
This was because the clone operation left behind the helix after the event.

I've just tried it in various builds from 10 onwards and am unable to access the helix. So either I've forgotten a step or Modeler is now (unfortunately) better at tidying up after itself. If that's the case I feel a feature request coming on.

cagey5
02-15-2012, 06:43 AM
... Don't know where I got it, ...

Seems it's in from LW 10.0 onwards. In the additional tab.

inkpen3d
02-15-2012, 07:00 AM
I added the DNA.p file. Don't know where I got it, but it's fun :D:thumbsup:

I've just checked my LW10.1 install and DNA.p is located in C:\Program Files\NewTek\LightWave10.1\support\plugins\model\, similarly for LW11. It produces classical Watson & Crick DNA models from a nucleotide base sequence. Atoms can be represented as points, spheres or dodecahedrons, whilst the covalent and hydrogen bonds between atoms can be represented either by lines or cylinders.

The operation of the plugin is quite slow and only practical for short base sequences - I sometimes have to deal with sequences in the 100's or 1000's for which the plugin would not be of any use.

The plugin does not do space-filling, ribbon or ladder type representations of the DNA molecule. But if you're after a ball-and-stick or line type model of a short stretch of DNA, then it's ideal.

Kind regards,
Peter

lertola2
02-15-2012, 07:47 AM
Hi guys,

Many thanks for all of your input - it's very much appreciated and certainly contains lots of interesting ideas. :thumbsup:

My main problem is not so much the construction of the double-stranded DNA itself (I can do that very easily and accurately) but specifically the separating and guiding the two strands along specific paths with a fixed unwind point for the ds-DNA.

The attached diagram hopefully makes it clear what exactly I am trying to achieve and why I thought bone-chains would perhaps be the solution. Unfortunately, I don't think any of the excellent suggestions made so far quite solves this particular aspect of the problem.

-Joe

Thanks in advance.

Kind regards,
Peter

If the dna condons can move in a rigid way then you could model a spline for the motion to follow and export it as a motion path from modeler. Then in layout load the motion onto a condon set up align to path and pole item in the motion options and then clone the condon and offset the timing of the motion in the dope sheet. See the attached image. If you need more organic motion perhaps you can use the same technique but load the motion onto some bones instead.

http://forums.newtek.com/attachment.php?attachmentid=101803&stc=1&d=1329317015

3DGFXStudios
02-15-2012, 07:58 AM
Seems it's in from LW 10.0 onwards. In the additional tab.

Oh you see I was right the first time :hey:

inkpen3d
02-15-2012, 08:13 AM
If the dna condons can move in a rigid way then you could model a spline for the motion to follow and export it as a motion path from modeler. Then in layout load the motion onto a condon set up align to path and pole item in the motion options and then clone the condon and offset the timing of the motion in the dope sheet. See the attached image. If you need more organic motion perhaps you can use the same technique but load the motion onto some bones instead.

http://forums.newtek.com/attachment.php?attachmentid=101803&stc=1&d=1329317015

That's looking very promising indeed! I'll investigate your idea further.

Many thanks.:thumbsup:

Peter

johnliebler
02-15-2012, 08:18 AM
This thread caught my eye, because I wrestle with this kind of problem all the time. I would probably try the morph through bonechains method, that you tried first, Peter. In the spirit of "did you try turning it off, and back on again?" :) make sure that "use morphed positions" is checked. Then, if you modeled your strand and skelegons in a helix, you can bring it into layout, rest the bones, set a key on the bones on another frame than zero, go back to frame zero, and zero out the rotations of the bones. Now save transformed the straightened helix, and "replace object" the original helix with the one you just straightened.

Actually, I think you need to go into modeler at this point to create your moving morph on the straightened object, then load it back into layout with replace object. It will look a right mess. Select all the bones and deactivate them, then re-rest them at frame zero.

That's how I would try this, anyway, I don't know if you will get satisfactory alignment of the codons, though. The last project I worked on had really stylized DNA, with only the two backbone strands represented. Unfortunately, to show a chain as long as the one in your diagram, you'll be dealing with hundreds of bones, and Layout may become a bear to work with.

Joe's approach might be worth exploring as well, it presents some intriguing possibilities...especially if you use bones on the curves... hmmm

Good Luck, and please post your progress!

John

shrox
02-15-2012, 11:03 AM
I added the DNA.p file. Don't know where I got it, but it's fun :D:thumbsup:

Well darn, I am 9.6.1, I never got the proper key for 10 because of the website debacle.

inkpen3d
02-15-2012, 11:40 AM
This thread caught my eye, because I wrestle with this kind of problem all the time. I would probably try the morph through bonechains method, that you tried first, Peter. In the spirit of "did you try turning it off, and back on again?" :) make sure that "use morphed positions" is checked. Then, if you modeled your strand and skelegons in a helix, you can bring it into layout, rest the bones, set a key on the bones on another frame than zero, go back to frame zero, and zero out the rotations of the bones. Now save transformed the straightened helix, and "replace object" the original helix with the one you just straightened.

Actually, I think you need to go into modeler at this point to create your moving morph on the straightened object, then load it back into layout with replace object. It will look a right mess. Select all the bones and deactivate them, then re-rest them at frame zero.

That's how I would try this, anyway, I don't know if you will get satisfactory alignment of the codons, though. The last project I worked on had really stylized DNA, with only the two backbone strands represented. Unfortunately, to show a chain as long as the one in your diagram, you'll be dealing with hundreds of bones, and Layout may become a bear to work with.

Joe's approach might be worth exploring as well, it presents some intriguing possibilities...especially if you use bones on the curves... hmmm

Good Luck, and please post your progress!

John

Hi John,

Thank you for your very clear instructions.

I tried them out on the attached LW scene DNA_Bone_Chain_v001.lws, which is the starting point (with all the items relating to the B-chain hidden for clarity).

All goes well up to the point where I substitute the baseline DNA strand for the transformed strand with movement morph (see DNA_Bone_Chain_v002.lws).

Firstly, I found that, even after deactivating and resting the bones, I had to move to frame 1 (where the bone had been initially key-framed) in order to get back the bone helix - is that to be expected?

However, at frame 1, if I scrub through the morph the DNA strand actually follows the bones nicely, which is a hell of a lot further than I've managed to get previously. :thumbsup:

The only remaining issue is that as the morph is scrubbed you can see the bases synchronously rotating around the (local) axis of the strand - so sometimes the bases all point inwards towards the centre of the helix, and at other times they all point outwards like the bristles on a loo-brush!:D

Since the bases in the transformed strand still spiral around the long-axis, I've tried de-rotating the bases (i.e. so they all line up) in Modeler using the Twist tool. However, this doesn't totally cure the problem as the bases still point outwards or inwards (albeit at a fixed point down the bone chain now).

I feel that this is almost there now - just this puzzling bases rotation problem to crack!

Any ideas?

Thank you once again.:)

Kind regards,
Peter

johnliebler
02-15-2012, 12:22 PM
Hi Peter,

I was afraid of that. I'll download your scene and take a look this afternoon. It seems like the really hard work is always the last ten percent. :) I'm in the middle of a rare (for me) character model, and I need to figure out a reasonable facsimile of Medieval scale mail :/

Cheers,

John

johnliebler
02-15-2012, 01:36 PM
Here, try the "DNA twisty" scene. Let me know what you think. No attempt was made to make the dimensions accurate, but the concept should work. The trick is to put the bones in the middle. That allows the twisting to be done by the bank channel and frees up the heading and pitch to pose the chains.

There is a second morph called offset, that allows for the double helix effect, instead of just the twisting, adjust to taste. It could be hard modeled, if you can figureI set it up with both chain in one object first, then cloned it and its bone chain to make the second strand. Then I separated the strands into two objects. Let me know if you have any questions.

Now, about that scale mail...

shrox
02-15-2012, 01:47 PM
Here, try the "DNA twisty" scene...

Just so you know, I stole this.

jeric_synergy
02-15-2012, 05:29 PM
I've just checked my LW10.1 install and DNA.p is located in C:\Program Files\NewTek\LightWave10.1\support\plugins\model\, similarly for LW11. It produces classical Watson & Crick DNA models from a nucleotide base sequence. Atoms can be represented as points, spheres or dodecahedrons, whilst the covalent and hydrogen bonds between atoms can be represented either by lines or cylinders.

The operation of the plugin is quite slow and only practical for short base sequences - I sometimes have to deal with sequences in the 100's or 1000's for which the plugin would not be of any use.

The plugin does not do space-filling, ribbon or ladder type representations of the DNA molecule. But if you're after a ball-and-stick or line type model of a short stretch of DNA, then it's ideal.

It'd be nice if NewTek supplied ALL the source code for ALL the plugins so that users could extend and enhance on a solid foundation.

IIRC that maybe the case with Lscripts (ie, non are compiled), but it would be great to get C source code for everything ending in "dot-p".

They don't currently, right?

shrox
02-15-2012, 05:34 PM
It'd be nice if NewTek supplied ALL the source code for ALL the plugins so that users could extend and enhance on a solid foundation.

IIRC that maybe the case with Lscripts (ie, non are compiled), but it would be great to get C source code for everything ending in "dot-p".

They don't currently, right?

I found this online.

johnliebler
02-15-2012, 06:08 PM
Just so you know, I stole this.


Share and Enjoy! ;)

jeric_synergy
02-16-2012, 12:11 AM
I found this online.
Maybe NewTek already has published all the source!

Using this code as a foundation, a C coder would really have a leg up on adding those other visualization options the OP mentioned.

inkpen3d
02-16-2012, 02:04 AM
Here, try the "DNA twisty" scene. Let me know what you think. No attempt was made to make the dimensions accurate, but the concept should work. The trick is to put the bones in the middle. That allows the twisting to be done by the bank channel and frees up the heading and pitch to pose the chains.

There is a second morph called offset, that allows for the double helix effect, instead of just the twisting, adjust to taste. It could be hard modeled, if you can figureI set it up with both chain in one object first, then cloned it and its bone chain to make the second strand. Then I separated the strands into two objects. Let me know if you have any questions.

Now, about that scale mail...

Hi John,

Many thanks for that and all the time you spent on it - I'll have a look at what you've done. Alas, it probably wont be today as one of my clients has requested some images to be done before an important meeting tomorrow - the subject matter, you guessed, DNA!:D

Kind regards,
Peter

shrox
02-16-2012, 09:02 AM
Maybe NewTek already has published all the source!

Using this code as a foundation, a C coder would really have a leg up on adding those other visualization options the OP mentioned.

Jump on it!

inkpen3d
02-16-2012, 09:27 AM
Here, try the "DNA twisty" scene. Let me know what you think. No attempt was made to make the dimensions accurate, but the concept should work. The trick is to put the bones in the middle. That allows the twisting to be done by the bank channel and frees up the heading and pitch to pose the chains.

There is a second morph called offset, that allows for the double helix effect, instead of just the twisting, adjust to taste. It could be hard modeled, if you can figureI set it up with both chain in one object first, then cloned it and its bone chain to make the second strand. Then I separated the strands into two objects. Let me know if you have any questions.

Now, about that scale mail...

Hi John,

Now that I've finished the job for my client, I've had a quick look at the "DNA twisty" scene you kindly supplied and, as far as I can tell, it looks like you've cracked the problem!:thumbsup:

I'll need some more time to work out exactly how to adapt your method to use the DNA models that I auto-generate, but it shouldn't be too difficult.

Once again, thank you John for all the time you spent looking into this!

Likewise, to all the other contributors to this thread - a big thank you for your collective input, it's very much appreciated and there's lots of interesting ideas that you've suggested which I've yet to fully get my head around and try out.

Kind regards,
Peter

jeric_synergy
02-16-2012, 10:58 AM
Jump on it!

"....a C coder...". IE, not I. :cry:

inkpen3d
02-21-2012, 07:26 AM
Hi,

Just thought I'd share my progress so far with you guys (see attached images) and ask you bone experts a couple of questions whilst I'm about it...


Can anyone explain why, when the strands move apart along the bone chains, the DNA backbones (i.e. the tubes) thicken - is there any way to mitigate this?

Likewise, I'd like to be able to double the spacing between the bases in the separated strands whilst at the same time not affecting their thickness (i.e. doubling the length of the bones, whilst fixing the spacing problem, causes the bases to double their thickness)?


Many thanks in advance.

Kind regards,
Peter

mummyman
02-21-2012, 08:05 AM
2 straight chains of DNA, in modeler... morph target them "up" in "Y".

Then, in Layout, use the twist on deformation, and morph them. You can use bones to guide where the open areas will go.

I think... The DNA will be twisted, and move up into an open postion from the morph target. Easy, but maybe not as much control.

mummyman
02-21-2012, 08:17 AM
Ha... didn't read the whole post... Nice work John!!!

I may snag this myself. Thanks

lertola2
02-21-2012, 08:49 PM
Hi,

Just thought I'd share my progress so far with you guys (see attached images) and ask you bone experts a couple of questions whilst I'm about it...


Can anyone explain why, when the strands move apart along the bone chains, the DNA backbones (i.e. the tubes) thicken - is there any way to mitigate this?

Likewise, I'd like to be able to double the spacing between the bases in the separated strands whilst at the same time not affecting their thickness (i.e. doubling the length of the bones, whilst fixing the spacing problem, causes the bases to double their thickness)?


Many thanks in advance.

Kind regards,
Peter

The fact that you are using the bones bank channel to twist your shape into the helix is causing the tube to stretch around the center of the helix. That is why the tube is so flat where the dna is twisted. One quick fix might be to replace your tube with a chain of two point polygons. You could create the look of a tube by using the Particle/Line setting on the Edges tab of the Object Properties panel. If you put in a negative number lightwave will render the line as a tube with thickness and this tube won't suffer from the stretching problem.

I can't think of a way to change the spacing of you shape though. To change the spacing I think you need actual moving bases.

-Joe

johnliebler
02-22-2012, 09:55 AM
Hmmm, (rubs chin thoughtfully). It's the last few details that always the the most effort. Joe's 2-point polys got me thinking. would it distort less if you had 2-point polys deformed by the bones, then metalink the chain to the 2-point polys?
As for the spacing, I think I'd create a morph target with more space between the bases, then control the morph with a gradient so that it happens to everything below the split. I'm on vacation this week, so I can't try it myself.

inkpen3d
02-22-2012, 10:25 AM
The fact that you are using the bones bank channel to twist your shape into the helix is causing the tube to stretch around the center of the helix. That is why the tube is so flat where the dna is twisted. One quick fix might be to replace your tube with a chain of two point polygons. You could create the look of a tube by using the Particle/Line setting on the Edges tab of the Object Properties panel. If you put in a negative number lightwave will render the line as a tube with thickness and this tube won't suffer from the stretching problem.

I can't think of a way to change the spacing of you shape though. To change the spacing I think you need actual moving bases.

-Joe

That works fine, thanks Joe. :thumbsup: The only limitation to the way NT has implemented the Edges-particle/line thickness is that it's done on a pixels basis. This is a pain since it means that if, during an animation of the scene you zoom in/out, the line thickness doesn't scale but remains a constant value (w.r.t. the image dimensions).


Hmmm, (rubs chin thoughtfully). It's the last few details that always the the most effort. Joe's 2-point polys got me thinking. would it distort less if you had 2-point polys deformed by the bones, then metalink the chain to the 2-point polys?
As for the spacing, I think I'd create a morph target with more space between the bases, then control the morph with a gradient so that it happens to everything below the split. I'm on vacation this week, so I can't try it myself.

LOL - as you say, it's that last little bit that produces all the grey hairs! Using a 2-point poly chain for the backbone works well (unless, as I said above in response to Joe, you have to zoom in/out). I am currently trying various methods to stop the bases distorting and also to get the spacing correct. I like your morph target with gradient idea and will give that a try. I'll post how I get on.

Have a relaxing and fun vacation.

Kind regards,
Peter

jeric_synergy
02-22-2012, 04:24 PM
Like someone else said: isn't Metalink the tool for linking deformations to, uhhhhh, 'units' so that they don't distort?

inkpen3d
02-27-2012, 04:28 AM
Hi Guys,

Thanks to all your help progress has been pretty good - see attached images.

Unfortunately, I found that FX_Hardlink and FX_Metalink caused the geometry of the bases to distort and break up - especially within the tight double-helix spirals of the DNA. I think this was because the low-poly proxy objects (bounding boxes for each base) used to record the bones/morph motions became highly distorted within the DNA double helix and this distortion somehow fed through when the mdd files were applied to the real DNA-bases geometry.

I revisited the method of just using the bones and movement morphs on the real bases. If you recall, I tried lengthening the bones in the single strand sections in order to get the spacing between the bases correct, but this had the knock-on effect of stretching the geometry of the bases in the single-strand sections to an unacceptable degree.

I had one of those light-bulb moments and realised that I could turn the problem on its head - start off with a DNA ladder with the bases separated by the distance required for the single-strand sections and use the length of the bones in the double-helix sections to compress the spacing between the bases to obtain the required separation in these sections. Any distortion of the bases within the double-helix sections would not be apparent unless you zoom in really close to the structure. As you can see from the image, this works reasonably well.

I now have one remaining problem - how to bend the long bone chains of the double helix section so they are not straight - preferably wavy and animatable. Note that these sections potentially could be very long with hundreds of bones in them and also that the root bones (i.e. bone 0) are at the top of the DNA double helix.

I've investigated several possibilities and PLG_Curve_Bone looked very promising until I discovered that I would need to manually add the plugin to every single bone in the two chains, which is just not a practical option (unless there is a way to mass-add this plugin to the bones). Once again, my woeful lack of in-depth knowledge of using bones in LW has brought any progress to a grinding halt.

Do any of you have a nice solution to this problem?

Kind regards,
Peter

inkpen3d
02-27-2012, 05:29 AM
Aha, just found a way to mass-add the PLG_Curve_Bone plugin to all the bones (if there isn't a way to do this from within LW itself)...

Just open up the scene file in MS Word and search for AddBone and then insert the text:

Plugin ItemMotionHandler 1 plg_Curve_Bone
EndPlugin

just before the AddBone line. Then save out the new scene file as a plain text file.

Back in Layout you can then edit the Motion options/Add Modifier for bone 0 in each chain to replace plg_Curve_Bone with plg_Curve_Bone_Top.

FYI: More specifically, in the MS Word search/Replace dialogue box the Find what string is "AddBone". And the Replace with string is "Plugin ItemMotionHandler 1 plg_Curve_Bone^11EndPlugin^11AddBone", where ^11 is the special code for a new line.

Kind regards,
Peter

inkpen3d
02-27-2012, 09:01 AM
Update:

Now that I've got Plg_Curve_Bones applied to all the child bones I can now control the flexing of the double-helix strands!:)

Kind regards,
Peter

johnliebler
02-29-2012, 07:20 AM
Hi Peter,
Sorry, I was away for a few days. There is a script called SR_Add-Remove_plug-ins floating around which can add the PLG curve bone plug to all selected items, but it is slightly unfinished, and I don't know if it was ever officially released. I got it on the forums somewhere in a PLG tutorial. I think your solution is great though. It's always good to know how to get under the hood of a scene file like that. I've copied your post for future reference. Are you using 64bit or 32bit LW? I ask because I wasn't able to get PLG to set-up in 64bit. Once it was set up in 32bit, it would work in the 64bit version though.

I'd love to see a clip of your shot when you are finished!

Cheers,

John

inkpen3d
02-29-2012, 07:29 AM
Hi Peter,
Sorry, I was away for a few days. There is a script called SR_Add-Remove_plug-ins floating around which can add the PLG curve bone plug to all selected items, but it is slightly unfinished, and I don't know if it was ever officially released. I got it on the forums somewhere in a PLG tutorial. I think your solution is great though. It's always good to know how to get under the hood of a scene file like that. I've copied your post for future reference. Are you using 64bit or 32bit LW? I ask because I wasn't able to get PLG to set-up in 64bit. Once it was set up in 32bit, it would work in the 64bit version though.

I'd love to see a clip of your shot when you are finished!

Cheers,

John

Hi John,

Hope you had a relaxing break!

Thanks for the info - SR_Add-Remove_plug-ins might be a useful tool if I can get my hands on it.:D

I can confirm that plg_Bone_Curve_Top doesn't work under 64-bit - you have to reload the scene into 32-bit Layout in order to add the control nulls, after doing that you can, if need be, revert to 64-bit Layout.

It would be useful if the author of plg_Curve_Bone could either fix this bug himself, or release the source code to allow others to do so.

I'll post a clip of the DNA unzipping shortly.

Kind regards,
Peter

erikals
02-29-2012, 09:30 AM
SR_Add-Remove
http://www.spinquad.com/forums/showthread.php?15687-looking-for-SR-Add-Remove-Plugins

 

inkpen3d
02-29-2012, 09:36 AM
SR_Add-Remove
http://www.spinquad.com/forums/showthread.php?15687-looking-for-SR-Add-Remove-Plugins



Cheers! :thumbsup:

medicalart
02-29-2012, 10:56 AM
Hi John,

It would be useful if the author of plg_Curve_Bone could either fix this bug himself, or release the source code to allow others to do so.



Lightwave's tool, "Spline Control", worked well for me, without the hassle of plg-Curve.

inkpen3d
02-29-2012, 03:01 PM
Hi Guys,

Here's (attached) the result of my labours. It's not perfect - e.g. I still need to find a way to thin out the DNA backbone as it emerges into the single strands - but it is a lot better than what I had before starting on this little exercise.

So once again, a big thank you to all who contributed to this thread with your inspirational help and suggestions!:thumbsup::)

FYI:
In the end I used the following:


Two sets of bones to twist up the strands of the DNA ladder (in the end I had to use the twist setting in plg_Curve_Bones_Top to do this).
Morphs to move the proxies (of the bases) and the backbones along the bone chains.
Record the proxy motions using Cloth and then FX_MetaLink to apply the result to the actual bases.


Note: Having the plg_Curve_Bone plugin applied to the 320+ bones in this scene (160 bones per strand) really slows down both the responsiveness of Layout and the recording of the mdd files (which is not surprising as I am pushing plg_Curve_Bones way beyond its intended normal usage). Using significantly more bones will render the scene unusable, so I will have to try the suggested alternatives to plg_Curve_Bones.

Kind regards,
Peter

medicalart
02-29-2012, 05:59 PM
[QUOTE=inkpen3d;1224475]


Two sets of bones to twist up the strands of the DNA ladder (in the end I had to use the twist setting in plg_Curve_Bones_Top to do this).
Morphs to move the proxies (of the bases) and the backbones along the bone chains.
Record the proxy motions using Cloth and then FX_MetaLink to apply the result to the actual bases.


Looks great! But which configuration of bones did you end up using? (Can you post a bone x-ray? ) Many thanks.

inkpen3d
03-01-2012, 02:18 AM
[QUOTE=inkpen3d;1224475]


Two sets of bones to twist up the strands of the DNA ladder (in the end I had to use the twist setting in plg_Curve_Bones_Top to do this).
Morphs to move the proxies (of the bases) and the backbones along the bone chains.
Record the proxy motions using Cloth and then FX_MetaLink to apply the result to the actual bases.


Looks great! But which configuration of bones did you end up using? (Can you post a bone x-ray? ) Many thanks.

I ended up using the down-the-centre bone configuration suggested by John in post #37 of this thread. The single strand sections are simply extensions of these bone chains with some heading/pitch applied to induce the separation.

Kind regards,
Peter

inkpen3d
03-01-2012, 03:57 AM
Lightwave's tool, "Spline Control", worked well for me, without the hassle of plg-Curve.

Hi there,

I have investigated using SplineControl previously, but failed to get it to work on bones.

You appear to have used it successfully - how on earth did you get it to work?

I've tried applying SplineControl to the skelegon chain both before and after conversion to a bone chain and then moved the control points around, but the bone chain remains stubbornly straight!:bangwall:

Am I being stupid and missing some obvious, but crucial, step(s)?

Also, as an aside, I've noticed that when the bone chains have Use Morphed Positions activated, and you click on the SplineControl button under the Modify tab, sometimes an error message appears stating "Plug-in SplineControl failed to start.". Does this mean the two cannot be used together?

Kind regards,
Peter

johnliebler
03-01-2012, 07:04 AM
That Looks great, Peter!
Remember, you can clone the dna strand, use bones from the first strand, and offset the morph to extend the animation. Just move the other end of the strand offscreen, so that you don't see the loop.

medicalart
03-01-2012, 07:57 AM
I have investigated using SplineControl previously, but failed to get it to work on bones.


It's a shortcut to undulate long strands without bones, and without PLG, but it certainly -won't- allow you to accomplish all that you have. Quick, but little control. Sorry, I should have clarified that. Say, you want to do this without bones, and say, you have the 'luxury' of a protein right at the fork junction, blocking the view; you could 'cheat', as someone mentioned earlier, by using a clip map to make each single strand appear to emerge from that junction. Single strands would be separate objects from the double-stranded DNA, so easier to manipulate using spline control (and a morph).

inkpen3d
03-01-2012, 08:23 AM
That Looks great, Peter!
Remember, you can clone the dna strand, use bones from the first strand, and offset the morph to extend the animation. Just move the other end of the strand offscreen, so that you don't see the loop.

Thanks for your kind words and the useful tip.:thumbsup:


It's a shortcut to undulate long strands without bones, and without PLG, but it certainly -won't- allow you to accomplish all that you have. Quick, but little control. Sorry, I should have clarified that. Say, you want to do this without bones, and say, you have the 'luxury' of a protein right at the fork junction, blocking the view; you could 'cheat', as someone mentioned earlier, by using a clip map to make each single strand appear to emerge from that junction. Single strands would be separate objects from the double-stranded DNA, so easier to manipulate using spline control (and a morph).

Regarding SplineControl: No problem, but thought I was going mad when I couldn't apply it to the bone chains! However, it's useful to know about SplineControl as I can use it to animate long wiggly DNA strands floating around in the background.

Regarding the clip map: That's the very method I've been using up until now AND without something blocking the junction! But, as you can imagine, it takes a hell of a lot of fiddly setting up to get the bases on the strands to transition from one into the another correctly, hence why I embarked on the unwinding using bones method.:D

Kind regards,
Peter