Page 1 of 1

DNM File Structure

Posted: Sat Jan 09, 2016 1:34 am
by decaff_42
So I'm working on my Blender book, and I want to explain the DNM structure when assigning information to each SRF. I'm only unsure about the CNT line. In all the DNMs I've looked at that line is 0 0 0.

Does anyone know if this does something/ what it means?

Code: Select all

SRF "Gear_latice"                       - SRF object name
FIL Mesh.004                            - SRF mesh (from inside DNM file)
CLA 0                                   - CLA number assigned to SRF
NST 3                                   - Number of STAs required
STA 0.0000 0.0000 -0.0000 0 0 0 1       - STA #1
STA 0.0000 -0.0000 0.0000 1820 0 0 1    - STA #2
STA 0.0000 -0.0000 0.0000 1820 0 0 1    - STA #3
POS 1.3060 0.0031 -0.0010 0 0 0 1       - Position of the object center
CNT 0.00 0.00 0.00
REL DEP                                 - Beginning of the Family Tree Section
NCH 1                                   - Number of Child objects
CLD "tires.004"                         - Name of 1st Child SRF

Re: DNM File Structure

Posted: Sat Jan 09, 2016 2:19 am
by NightRaven
I've found that the HQPGAC A-6A dnm does employ the use of the CNT line. Its function is quite interesting: it shifts the vertices of the object without changing the object center.
Here, with the original CNT line, the hook, hook centre and hook empty are where they should be: hinged around the bottom half surface of the fuselage, allowing the hook to rotate around that point.
Here, with the CNT line reset to 0 0 0, the hook centre and hook empty are still in the same position, but the vertices themselves have moved by the amount specified by the CNT line.

Interestingly, the positions are flipped, meaning a negative value causes the vertices to move in the positive direction and vice versa.

Re: DNM File Structure

Posted: Sat Jan 09, 2016 2:24 am
by decaff_42
Okay, so this is the offset of the vertices from the object center.

I assume it does not change how the hook rotates? i.e. the rotation point of the hook is still at the same position relative to the mesh itself.

Re: DNM File Structure

Posted: Sat Jan 09, 2016 2:30 am
by NightRaven
Yes, the object center and position are unaffected by the CNT line.

Re: DNM File Structure

Posted: Sat Jan 09, 2016 2:31 am
by decaff_42
So then there is zero difference between using CNT and changing the object center/ parent object position?

Re: DNM File Structure

Posted: Sat Jan 09, 2016 3:13 am
by Neocon
Apparently Ctrl + R refreshes the page instead of opening a Find/Replace box. Very annoying, after a 300 word answer with one little mistake in several lines.

Ok, let's say you build your model and you have a tail hook. The rotation point of the tail hook is located at 00.00 -0.15 -5.25, and the .srf mesh for the hook is located in that position. You set the hook to rotate backwards from its down position by 120° backwards and up. If your entry has POS 0.00 0.00 0.00 0 0 0 1 and CNT 0.0 0.0 0.0, it will rotate from the CNT point, which will end up somewhere about 25 meters from where you wanted it. You have two options: You can move the mesh of the .srf so that it is lined up for the rotation point to actually be at 0 0 0 and POS 00.00 -0.15 -5.25 , or you can do this:
POS 00.00 -0.15 -5.25 0 0 0 1
CNT 00.00 -0.15 -5.25

"CNT 00.00 -0.15 -5.25" will tell YSF that the point 00.00 -0.15 -5.25 should be treated as 0 0 0, and the POS will then tell YSF to actually place the hook at 00.00 -0.15 -5.25 .

Or something like that.

EDIT: I think I just said what Nightraven posted in different words and without illustrations. :lol:

Re: DNM File Structure

Posted: Sat Jan 09, 2016 3:22 am
by NightRaven
This is going to be quite difficult to explain in words...

You are correct in saying that CNT is a form of vertex offset. This also means that when you change the CNT line from 0 0 0 to 0 0 -1 you shift the object center 1m in the local negative Z-direction relative to the vertices. So CNT does change the object center relative to the mesh itself, but does not affect the object center's position itself.

^ extremely confusing explanation when I have no computer to work with

Re: DNM File Structure

Posted: Sat Jan 09, 2016 6:23 am
by Flake
The truth is that the CNT defined the rotation center of the model. The vertecies are first moved opposite of the center, and the entire model is then shifted by the center... in otherwords no real apparant change, right? Except that the rotation point is different now. You have all pretty much got the right answer. There is no difference between using CNT and manually moving the vertecies yourself so as to rotate about 0,0,0 (In fact, this is the method I prefer!)

Re: DNM File Structure

Posted: Sat Jan 09, 2016 6:45 am
by ysmajor
CNT is super useful.

Basically for modders: you can make your full model with all parts in the place where they are located on the plane.
for instance you draw the left main gear at -1,45 meters on the x-axis, and -1 meter to the back on z-axis (in Gepolyx).

Then you cut the part from the mesh and save it.
In DNM now, you add the gear SRF, but it rotates on 0,0,0 middle point, which gives a wrong animation.
So, you enter the exact coordinates of the SRF you just made in the CNT line (I think it means Counter or contra-location), in above example x=-1,45 y=0 z=-1
In DNM viewer the part has now moved to the middle of the plane.

Then you locate the part again on the place where it should be.
Result, the animation is seamless.

especially with geardoors and bombdoors this is very important as they close exact and you wont see any cracks.
Flaps and ailerons and the like are also easily made (in the wing) and they move much better.

Look at my later models for examples.
(Ho-229, A-12, C-119)

Re: DNM File Structure

Posted: Sat Jan 09, 2016 3:44 pm
by decaff_42
I think I understand what this does now and from a blender perspective seems not that useful as the general method of moving animated parts is to move their parent object.

However from a DNMViewer point of view this seems really useful.

Thank you for the clarification!