File Format for the Studio Connectivity Files (*.conn)


File Format for the Studio Connectivity Files (*.conn)
#1
Hello everyone,

maybe the *.conn file format is already known but in case its not you can find the description below.  I’m also referring partly to the thread “Studio Connectivity Data“ where the question was asked how the *.conn file format is defined.

Connectivity files, e.g., the file definition is actually not too complicated to understand. However, it is more complicated as the collision files just because there are more of them and they are encrypted.

It is true that Part Designer converts the *.conn files -contrary to the *.col files- to a binary format (due to whatever reason). But this does not mean that you cannot access the information, you just have to use a trick. If you generate a part file in Part Designer and store it as *.part it contains all information about the brick. The geometry, the connectivity info and -hidden in the part geometry- the collision data. To see the connectivity info in human-readable format only thing you have to do: Start with a new part but only add connectivity elements (no geometry). In the part editor you will see an empty workspace but in the connectivity editor you can see the connectivity element. If you store this part now as *.part you can open and read it in a text editor (the conversion to binary takes places during export; not internally). From here it is rather a matter of changing the individual values/variables  in *.part file and check what are the consequences. Below an image from the STUD connectivity element e.g. the file format:

   
Figure 1.1: Connectivity file format for the STUD connectivity element (associated *.part file)

I’ve been playing around with these values and compared it with the other connectivity elements. What I’ve found out so far:

First block:              0 (always the same)
Second block:          PE_CONN (always the same, mostly likely a meta command; Part Editor Connectivity maybe)
Third block:             ID1 (group ID see figure 1.2 below)
Fourth block:           ID2 (element ID see figure 1.2 below)
Fifth block:              1 0 0 0 1 0 0 0 1 (always the same, Transformation matrix)*
Sixth block:              XYZ (Position of the element)
Seventh block:         2 2 (always the same; geometry data aka visual representation of the element)**
Eight block:             3:1,0:4,3:1,0:4,10:4,0:4,3:1,0:4,3:1 (always the same; geometry data aka visual representation of the element)***

* For other elements not always the identity matrix; see figure 1.2
** Lateral size. If you change it from 2 2 to 1 1 it has half the size. But any other value does not work
*** Most complicated one. I guess it describes or are related the geometry of the connectivity element itself (squares in the corner, disc in the center and the connection lines). If you change 10:4 to 20:4 for example the disc changes its form from a disc to a ring. Some of the numbers fit roughly to the size of the connectivity element.

One can argue that during the export Part Editor adds additional data but I’ve also checked this. I’ve generated a *.part file with connectivity elements and exported it to Studio. The associated connectivity file (*.conn) I’ve opened in Part Editor and saved it as *.part again. If the exporter from PE adds additional data to the *.conn file these files should be different but there are the same (I’m assuming PE does not remove data during import).   

In figure 1.2 you can see the *.part file with all connectivity elements you can choose from the menu. There are 43 of them. Sorted by ID1. You can see the similarity between these elements. Only the seventh and eights block is different. I guess the above file format also applies to these files (more or less).

   
Figure 1.2: Connectivity file format for all connectivity elements you can pick from task bar 

In figure 1.3 you can see all connectivity elements in the connectivity editor (sorted by group).

   
Figure 1.3: Connectivity elements in Part Designer 

Hope the helps.

Best,
Gabe
Reply
RE: File Format for the Studio Connectivity Files (*.conn)
#2
Hello Gabriel, nice explanation...
I also fiddled around a bit with these connections, and found out that all connections have some kind of ID number...
Do you have a list which number is what and what connection fits what counterpiece?
For example: Stud fits antistud and center of big hollow antistud...
Positive hollow stud too, but additionally has clip connectivity (for bar)
Bar is similar to thin bottom stud...
Some conns like the technic hole have options (start/end capped), how does that show?
Some conns have defined IDs, the pair is always one number apart:
-technic pinhole 2, technic pin 3
-technic axlehole 6, technic axle 7 (axle with stop has 9)
-round hole 10, bar for round hole 11
-clip 12, bar 13
René
Reply
RE: File Format for the Studio Connectivity Files (*.conn)
#3
Would definitely be interesting to see a full list.

There are also a few connections inside Stud.io which don't seem to be placeable (but viewable, so can be copied) in the regular parts editor (many of which are minifig related it seems).
Reply
RE: File Format for the Studio Connectivity Files (*.conn)
#4
Minifig connections (hips/torso/arm) are under Accessory->more accessory connectivities
one of the things i didnt find in the menu are the 12V/9V Rail connections...
the old non-click hinges are also missing there
Reply
RE: File Format for the Studio Connectivity Files (*.conn)
#5
Hi Rene,
Hi Chris 

Honestly, I don’t know. What I’ve done in the meantime is rather find out the purpose of the folders, files, and *.txt files in the “primitive” folder from PE. But I’ve also sent both of you a PM with some more details.

Best,
Gabe
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)