OBI (Original Building Instructions) meta commands


OBI (Original Building Instructions) meta commands
#1
I'd like to see if others on this board are interested in adding the !OBI meta command to the list of meta commands allowed in official files. It is used to allow rendering of building instructions in one of the styles used by LEGO, that is, the style with flat black sides on studs and various other geometry.

The !OBI command was created quite a few years ago by Joshua Delahunty (possibly with help from me and others; I honestly don't remember), and implemented as an undocumented feature in LDView. However, it was never made official, or allowed in official parts, and in order to work, some parts and primitives need to include !OBI commands.

An example of the style can be found here:

http://www.technicbricks.com/2011/07/uno...tions.html

I don't at this point know how invasive this meta-command has to be. I think it's mostly present in primitive files, being relatively rare in part files. If that's the case, initial population of the library should be relatively straightforward. If not, things could be more difficult. But there's no real point in doing a thorough study if the LSC at large doesn't consider the !OBI meta command to be appropriate in the official library.
Reply
RE: OBI (Original Building Instructions) meta commands
#2
Sounds interesting, is there an overview of the (sub) commands or is it only the 'OBI_BLACK' one for now?

Also: is this another 'take it as is or leave it' deal like it was with the texmap spec?

And how does this play with LPub(3d) as that is by far the most actual used bom spec.
Reply
RE: OBI (Original Building Instructions) meta commands
#3
(2017-05-02, 19:46)Roland Melkert Wrote: Sounds interesting, is there an overview of the (sub) commands or is it only the 'OBI_BLACK' one for now?

Also: is this another 'take it as is or leave it' deal like it was with the texmap spec?

And how does this play with LPub(3d) as that is by far the most actual used bom spec.

The commands are:

0 !OBI SET <token>
0 !OBI UNSET <token>
0 !OBI NEXT <color> [IFSET <token>|IFNSET <token>]
0 !OBI START <color> [IFSET <token>|IFNSET <token>]
0 !OBI END

In the modified library that Joshua created, <color> is "OBI_BLACK", which needs to be present in LDConfig.ldr in order to work right in LDView. OBI_BLACK is set to true black, but could be set to other colors. When an OBI color is active, it overrides the standard color that would normally be used instead in that location. The next/start/end syntax is similar to !TEXMAP, meaning that OBI color override either happens for one single 1/2/3/4 linetype line (next), or between the begin and end.

<token> is used to allow a particular piece of OBI shading to be conditional. For example, stud.dat uses IFNSET obi_stud_cancel around the part turning the sides of the stud black. Apparently Joshua found at least one place where stud.dat was used in a situation where black sides would be wrong. (Not sure what that instance was.)

I don't think this is a "take it or leave it" deal, but changes would need rather pressing justification. Also, Joshua's modified parts library obviously uses this syntax. Unfortunately, his modified library modifies a lot more parts files than one would expect or like (~350). See here:

https://forums.ldraw.org/archive/index.p...10907.html

That 350 modified part files number also shows that this is a lot more involved than I had hoped. But it seems like a useful thing.
Reply
RE: OBI (Original Building Instructions) meta commands
#4
One of the things I like about the LDraw spec is that it is very generic.

So I can't help wondering why a building instruction meta currently seems to be rendering specific.

Maybe we should adapt this in a more generic fashion, it could then (for example) also include alternate surfaces (like on slopes) some people discussed a while back.

just some brainstorming:

We could for example take the 'set/ifset' thing to a generic compiler directives like level which then can be used in other metas/code blocks too. Also offering the option to be controlled by external variables  (enable/disable bom rendering etc).

And the OBI_BLACK mechanics could ge a generic rendering instruction referring to a surface type (hard coded black in this case defined by an, extended?, !colour meta). Maybe even promote this to a linetype 6 instead of a !xxx  meta.

Then again I might be overthinking this, especially if you're only looking to add this to the library asap.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 3 Guest(s)