LDraw.org Discussion Forums

Full Version: Thinking about doing a LDCad 1.7 version
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(2020-05-08, 20:05)Milan Vančura Wrote: [ -> ]This is, exactly, why I asked for the top "feature" making a better documentation of both the script language and the object model in LDCAD. Roland, can you think about this, please? At least put all scripts from this forum, as you post them time to time, to one place at your WWW site, with comments. Better if you document even more.

I know, but often when I start to work on documentation in about 5 minutes I'm like "Bored now" Smile

Adding features trough script is a 2.0 core feature, as I want to keep the binary compact and do everything else trough extensions.
(2020-01-13, 20:41)Roland Melkert Wrote: [ -> ]- !DATA support

Took some more work than expected but I have implemented basic support for embedded textures in 1.7

[attachment=5264]

Next I will need to hide the DATA 'sub model' from the editor as it behaves as a empty model at the moment.

But I'm not yet sure how to handle the contents of data sections gui wise.

Any ideas on that are welcome.

I'm thinking to remove the whole "Change current session" menu and instead add a generic dialog from where you can save/add/change submodels/data content etc.

Only problem with that is when there is how to handle a mpd with just a single data section and nothing else (no editing area subject).
I have run into issues with a user who has used LDCad to create instructions with BUFEXCH commands, see: https://github.com/LasseD/buildinginstru.../issues/34

As you can see, the issue appears to be a lack of "0" prefixes in the buffer-exchange-specific regions, causing LDCad to output files that are not interpreted correctly in software that does not support Buffer Exchange commands. 

Can you please share the specification which you have used for the existing support, and are you aware of other commands in LDCad which might cause other software to render stuff incorrectly?
Thought of this one some time ago but didn't get around to suggesting it…

Is it possible to display the length of flexible parts dynamically as I edit the part? Most of the time, this means in nested mode, whereas now you have to exit nested mode and highlight the whole part. (I wouldn't mind also if it displayed the greater precision used in the generated code.)

While I'm on the subject, I feel like there may be bugs in the length parameters of the path dialog. For example, if I set a length display offset, it vanishes next time I open the dialog. And if I set the unit to LDraw, the displayed length is some wild enormous number—but what it writes into the code is correct. Maybe this is a know issue, but if not I can go into more detail.
(2020-05-23, 12:53)Lasse Deleuran Wrote: [ -> ]I have run into issues with a user who has used LDCad to create instructions with BUFEXCH commands, see: https://github.com/LasseD/buildinginstru.../issues/34

As you can see, the issue appears to be a lack of "0" prefixes in the buffer-exchange-specific regions, causing LDCad to output files that are not interpreted correctly in software that does not support Buffer Exchange commands. 

Can you please share the specification which you have used for the existing support, and are you aware of other commands in LDCad which might cause other software to render stuff incorrectly?

I'm not sure I understand the problem, do you mean you expected the "0 " prefixes on the ghost lines to be added automatically ?

If so that's not part of the bufxchg spec.

0 GHOST  is a different mlcad meta, which it uses to draw parts transparently I believe.

It is just added as a prefix to lines which the user wants 'ghosted'.


I used MLCad's documentation to implement bufxchg
http://mlcad.lm-software.com/e_default.htm

It is basically a stack command, meaning you store the whole LDraw content at the STORE point and trow away the current content upon a RETRIEVE.

I did implement it as a hide flag in LDCad as I don't want to literately delete stuff Smile

The main trick is to loop backwards trough the LDraw lines when processing the commands, that way nested ones are automatically handled correctly.
(2020-05-23, 18:11)Roland Melkert Wrote: [ -> ]I'm not sure I understand the problem, do you mean you expected the "0 " prefixes on the ghost lines to be added automatically ?

If so that's not part of the bufxchg spec.

0 GHOST  is a different mlcad meta, which it uses to draw parts transparently I believe.

It is just added as a prefix to lines which the user wants 'ghosted'.


I used MLCad's documentation to implement bufxchg
http://mlcad.lm-software.com/e_default.htm

It is basically a stack command, meaning you store the whole LDraw content at the STORE point and trow away the current content upon a RETRIEVE.

I did implement it as a hide flag in LDCad as I don't want to literately delete stuff Smile

The main trick is to loop backwards trough the LDraw lines when processing the commands, that way nested ones are automatically handled correctly.

That explains the issue. The two commands go hand-in-hand to ensure compatibility with other LDraw software, such as LDView.

In the documentation you link to, the section with GHOST says (highlight mine):


Quote:Ghost commands are a special form of other commands. Any MLCad or Ldraw command can be a ghost command. To make a command to a ghost command simply put “0 GHOST” at the beginning of the line.
So what’s the deal with this type of command?
MLCad displays ghost commands only if the model containing the command is the main model. If the model is a sub-model of another or simply a part included into a model the ghost lines are simply ignored. They are useful in connection with the buffer exchange command and allow to show detailed assembly instructions of a part when it’s viewed by its own, but if it’s included as a part these steps will not be shown.
Without this ghost command you would see things between buffer exchange commands uncontrolled since buffer exchange commands are also ignored in sub-models.

And this is the issue with their models. LDCad outputs the stuff between SAVE and RETRIEVE without any modification, so other viewers will simply also render all the stuff in those sections.
(2020-05-23, 18:37)Lasse Deleuran Wrote: [ -> ]That explains the issue. The two commands go hand-in-hand to ensure compatibility with other LDraw software, such as LDView.

In the documentation you link to, the section with GHOST says (highlight mine):

And this is the issue with their models. LDCad outputs the stuff between SAVE and RETRIEVE without any modification, so other viewers will simply also render all the stuff in those sections.

Now I see, I  actually implement nested BUFXCHG meaning it will also work on submodels.

To this end I keep track of two visibility flags one for visibility as seen from the last step (submodel state) and one for the current step of the model you're working on.

This is a fairly easy fix and prevents littering all those GHOST meta's imho.

But if you want to use the ghost tag in your instructions you can use the newly added "toggle ghosted lines" macro of 1.6d, it's in the scripts/mlcad menu.
(2020-05-23, 19:10)Roland Melkert Wrote: [ -> ]Now I see, I  actually implement nested BUFXCHG meaning it will also work on submodels.

To this end I keep track of two visibility flags one for visibility as seen from the last step (submodel state) and one for the current step of the model you're working on.

This is a fairly easy fix and prevents littering all those GHOST meta's imho.

But if you want to use the ghost tag in your instructions you can use the newly added "toggle ghosted lines" macro of 1.6d, it's in the scripts/mlcad menu.
That makes sense. I am not fully versed in when stuff is ghosted or not in MLCad, but if you add the "0" prefix then that should help with how LDView shows the model.

I will make sure that both "0 " and "0 GHOST " prefixes are ignored when interpreting the BUFEXCHG commands in the Javascript library, so it should work together with the output from LDCad no matter the version.
(2020-05-23, 16:55)N. W. Perry Wrote: [ -> ]Is it possible to display the length of flexible parts dynamically as I edit the part? Most of the time, this means in nested mode, whereas now you have to exit nested mode and highlight the whole part. (I wouldn't mind also if it displayed the greater precision used in the generated code.)

If you open the MPD contents group in the bin, you can inspect the length using the flexible part's bin cell hint.

And if you open the parts own editing session you can also get extra information by opening the information icon at the right bottom.

That said, it might be handy to have it somewhere more prominent while working with the control points.

Maybe add it to the coordinate panel when anything path related is selected ?


(2020-05-23, 16:55)N. W. Perry Wrote: [ -> ]While I'm on the subject, I feel like there may be bugs in the length parameters of the path dialog. For example, if I set a length display offset, it vanishes next time I open the dialog. And if I set the unit to LDraw, the displayed length is some wild enormous number—but what it writes into the code is correct. Maybe this is a know issue, but if not I can go into more detail.
Sounds like a bug, but I can't replicate it.

I assume you talking about these settings?
[attachment=5270]

Are you using 1.6d because I did change something concerning those settings in 1.6c (added the L option) so I may have broken something during that.
(2020-05-23, 22:31)Roland Melkert Wrote: [ -> ]If you open the MPD contents group in the bin, you can inspect the length using the flexible part's bin cell hint.

And if you open the parts own editing session you can also get extra information by opening the information icon at the right bottom.

That said, it might be handy to have it somewhere more prominent while working with the control points.

Maybe add it to the coordinate panel when anything path related is selected ?

Coordinate panel would be the perfect spot! I did know about the bin hint, but I'd forgotten about the document into icon. There's some helpful extra info in there, but as you say it requires switching to that part's editing session.

Quote:Sounds like a bug, but I can't replicate it.

I assume you talking about these settings?

Yes, but now I can't replicate it either. Huh Perhaps I was doing something wrong (like closing the dialog with ESC instead of ENTER).

But the other part is easy to replicate:
[attachment=5271]

That's a bit of a funky number for LDU, no?

Quote:Are you using 1.6d because I did change something concerning those settings in 1.6c (added the L option) so I may have broken something during that.

Yes, 1.6d. And thanks for adding L, by the way—I use it all the time!
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15