Support !COLOUR in models
Yep, this is actually the preferred way to modify a colour vs. manually changing or using an alternative LDConfig.ldr. This command is natively supported by LDView and LDGLite. Perhaps it’s not so interesting for editing/viewing but it is certainly a valid feature for publishing models/instructions where the user would like to tweak part colours. Since before you implemented fade and highlight colours, I modded my LeoCAD renderer to use it to manage these feature settings from LPub3D. That you have begun to enhance instructions generation in LeoCAD, it could be good to add this capability.
So when there's a !COLOUR in a model file, does it affect all parts in the model (both before and after the command)? What about submodels?
I think it would be hard for me to change just a few parts.
Originally posted by @leozide in https://github.com/leozide/leocad/issues/621#issuecomment-774714670
That would be my assumption.
On 2021-02-07 13:24, Leonardo Zide wrote:
Yep, this is actually the preferred way to modify a colour vs. manually changing or using an alternative LDConfig.ldr. This command is natively supported by LDView and LDGLite. Perhaps it’s not so interesting for editing/viewing but it is certainly a valid feature for publishing models/instructions where the user would like to tweak part colours. Since before you implemented fade and highlight colours, I modded my LeoCAD renderer to use it to manage these feature settings from LPub3D. That you have begun to enhance instructions generation in LeoCAD, it could be good to add this capability.So when there's a !COLOUR in a model file, does it affect all parts in the model (both before and after the command)? What about submodels?
I think it would be hard for me to change just a few parts.
/Originally posted by @leozide https://github.com/leozide in #621 (comment) https://github.com/leozide/leocad/pull/621#issuecomment-774714670/
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leozide/leocad/issues/625, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAECJNDMM7V4NRKIM3AVRM3S53LFVANCNFSM4XHWXY6A.
So when there's a !COLOUR in a model file, does it affect all parts in the model (both before and after the command)? What about submodels?
This depends on how you implement your support. In most cases I have seen, the !COLOUR command is used to add colours (i.e. a new code) to the palette. As a result, the command is usually treated much like a “header” command. In this use case, all lines that use this colour code, after it has been processed, would be expected to reflect the designated colour. However, there is also the use case whereby an existing code is “redefined” using the !COLOUR command. In this scenario, subsequent occurrences of the code after the !COLOUR command would reflect the redefined colour properties but this can be affected by when and how you render models relative to loading the model file.
Cheers,
@leozide possibly also implement the possibility to source ldconfig and ldconfig alt from zip when using compressed library archive? rather than have an extra file for this configuration? it is already supplied with the default ldraw parts lib