trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
133 stars 19 forks source link

Unofficial custom part and textures sub-folder in sub-folder handling #446

Closed trevorsandy closed 3 years ago

trevorsandy commented 4 years ago

Subject

Unofficial custom part and textures sub-folder in sub-folder handling

Environment

Version of LPub3D - 2.4.0
Operating system - All

Solution

This update will recognize and process textures placed in a subfolder under unofficial/customParts/textures/. For example, unofficial/customParts/textures/customTexturesForMyModel. The previous behaviour would not have recognized the customTexturesForMyModel subfolder.

The aim is to allow the editor more flexibility by allowing her to group textures under a specified subfolder versus having all textures under unofficial/customParts/textures.

Notice: customParts and customTexturesForMyModel are sample names I used to describe the behaviour using representative sample paths. Any acceptable folder name should work as described - I would imagine even unofficial.

jacovandermolen commented 3 years ago

Is this by any chance related to the fact that it seems unofficial primitives in say C:\Users\Public\Documents\LDraw\Unofficial\p\48 are not copied to the folder? I seem to be missing some primitives for unofficial parts in the 48 folder. If I add those manually to the lpub3dldrawunf.zip file it works fine.

trevorsandy commented 3 years ago

This update will recognize and process textures placed in a subfolder under unofficial/customParts/textures/. For example, unofficial/customParts/textures/customTexturesForMyModel. The previous behaviour would not have recognized the customTexturesForMyModel subfolder.

The aim is to allow the editor more flexibility by allowing her to group textures under a specified subfolder versus having all textures under unofficial/customParts/textures.

The 'parts' and 'p' subfolders under 'Unofficial' are excluded from the parts archive processing. This has been the case since the inception of the archiving behaviour.

Cheers,

jacovandermolen commented 3 years ago

OK, I didn't notice this before, because this is the first time I used a custom unofficial part that uses a primitive. I can easily put the file in the right folder manually in the zip, so no problem there.

trevorsandy commented 3 years ago

Were you not successful putting your custom primitives in 'p/48' under a custom subfolder - i.e. C:\Users\Public\Documents\LDraw\Unofficial\CustomParts\p\48 ? It is not a good practice to directly update the archive file.

The current behaviour is designed to recognize and process this configuration. Moreover, the following should also be recognized:

Just to repeat, the p and parts exclusion rule only applies to the default Official and Unofficial p and parts subfolders. The aim is to avoid parsing the large number of files in these folders to determine if they have already been archived. All LDraw subfolders, starting with p and parts, created under a custom subfolder should be recognized and processed accordingly.

Cheers,

jacovandermolen commented 3 years ago

Yes. My parts forlder structure is different. My custom parts are in "custom" instead of "CustomParts". I also have Helpers and recently a Hubelino ;-) subfolder to

So, if I rename custom to CustomParts it would be better? I'd like to add the 48 folder too since there are some parts that I use that have high-res primitives (like the Hubelino parts).

trevorsandy commented 3 years ago

So, if I rename custom to CustomParts it would be better?

CustomParts is the sample name I used to describe the behaviour using representative sample paths. Any acceptable folder name should work as described - I would imagine even Unofficial.

In your case, simply add /48 under the your custom/p subfolder or add /p/48 under custom if you did not have a primitives subfolder defined.

Cheers,

trevorsandy commented 3 years ago

Implemented.

Cheers,