aFrInaTi0n Posted May 26, 2022 Posted May 26, 2022 (edited) Update July 2024: My described tool here is considered DEPRECATED as the ldraw site has implemented a functionality to download complete .zip files with all needed subparts / assemblies. Scenario: You are in the situation in which you miss some LEGO parts in Studio but have seen them in LDRAW (unofficial) library. Maybe you tried to resolve all the references to all sub-assembly-files once by hand or had a look at the dependencies with some other tools - as I am working in IT and love to automate things and thought "I can't be bothered with doing this manually". And as I want to contribute something back to the lovely community of people I put it online in May 2022 and gave it some little updates inbetween: The LDraw to Studio Exporter (https://www.reum.it/ldraw-to-studio-exporter/) Description This tool is designed to import parts which are available in LDraw, but not in Studio. From the LDraw part number, it zips all relevant sub elements (there can be many!) into a part pack. Howto Visit the LDraw Parts Lookup Search for your part of choice & copy the number Enter this number into the below searchfield A list of all fitting parts from the catalogue will show up - clicking the entries will create a zip package with just the needed parts To use the packs, unzip them and place their contents in your "C:\Users\{your username}\AppData\Local\Stud.io\CustomParts" (Windows) The parts will then be available in Custom Parts palette of Studio Screenshots Entry-Page Example result for query "47373" Details of the zipfile structure of an example part Here is an example of the structure and the needed subparts for one Shock Absorber ("47373-f1"): Spoiler C:\Users\User\Downloads\47373-f1 │ CAlicense.txt │ CAreadme.txt │ Readme.txt └───CustomParts ├───p │ 1-16cyli.dat │ 1-16edge.dat │ 1-4chrd.dat │ 1-4cyli.dat │ 1-4edge.dat │ 1-8chrd.dat │ 1-8cyli.dat │ 1-8cyls2.dat │ 1-8edge.dat │ 1-8ndis.dat │ 1-8rin10.dat │ 1-8ring9.dat │ 3-8edge.dat │ 4-4con3.dat │ 4-4con8.dat │ 4-4cylc.dat │ 4-4cyli.dat │ 4-4disc.dat │ 4-4edge.dat │ 4-4rin10.dat │ 4-4ring2.dat │ 4-4ring3.dat │ 4-4ring4.dat │ 4-4ring8.dat │ 4-4ring9.dat │ 7-8cyli.dat │ 7-8edge.dat │ peghole.dat │ t04o2500.dat │ └───parts 47373-f1.dat 48912.dat 48913.dat 48914.dat 48915.dat 48917.dat 48918.dat u9013.dat Some example results as direct links of parts missing in Studio: 65151-f1.zip - Technic Shock Absorber 11L Soft (Extended) 65151-f2.zip - Technic Shock Absorber 11L Soft (Compressed) 47373-f1.zip - Technic Shock Absorber 11L/9L (in Extended Position, not Pre-Tensioned) 47373-f2.zip - Technic Shock Absorber 11L/9L (in Extended Position, Pre-Tensioned) 47373-f3.zip - Technic Shock Absorber 11L/9L (in Compressed Position, not Pre-Tensioned) 47373-f4.zip - Technic Shock Absorber 11L/9L (in Compressed Position, Pre-Tensioned) Updates January 2023: Fix: Nightly refresh of LDraw unofficial files working now, it was buggy before and stuck on the releases from ~August 2022 version Feature: Unofficial files may be downloaded via a new checkbox. Searches are exclusive here, so having the checkbox set means it only goes through the unofficial list (but may grab sub assemblies from the official, where needed) UI: Added Dark Mode awareness UI: Added Font-Awesome Icons for downloads UI: Some tweaks (all professional webdesigners: hush hush, nothing to see here... don't look at my nasty css quirks :P) May 2023: Fix: Textures are now included (they werent before..) Edited July 9, 2024 by aFrInaTi0n Updated information Quote
Toastie Posted May 26, 2022 Posted May 26, 2022 Wow!!! Thanks a million for that tool!!! I am using MLCad for building and thus the LDraw library. I like to use Stud.io for rendering ... and now this will be one genuinely nice workflow. Nice. All the best, Thorsten Quote
freakwave Posted June 23, 2022 Posted June 23, 2022 Hi, that is really a nice tool, great work! we had a discussion at LDraw itself to add something like this to the site, but so far the time was missing to implement it. Could you adapt it to do the same with unofficial parts? e.g.: https://www.ldraw.org/cgi-bin/ptdetail.cgi?s=83496 Thanks! Quote
aFrInaTi0n Posted June 24, 2022 Author Posted June 24, 2022 @freakwave Its just ~150 lins of dirty php code. Its more or less just 1 recursive function, walking down the references to subparts of the main part and adding them into a zip-stream, which is send to the browser. I will have to check if there are any legal reasons denying that - I will check out if I can add the unofficial parts on the weekend. Quote
aFrInaTi0n Posted July 1, 2022 Author Posted July 1, 2022 (edited) Hey @freakwave, first of all, sorry for one week without an update! Finally had some minutes to take a initial look :D Legal reasons shouldn't be any concern for the unofficial parts, as far as I get it. Only problem I see is, the unofficial lib is updated very frequent and it would need some scheduled job for my script / server to have the library files refreshed with a more recent version - technically its no huge thing, just needs some brainjuice (I would also use this to automatically update the official one, because it was just placed manually there for the first approach).. Open Questions: Would a checkbox for "include LDraw unofficial" for the search be enough for your needs? Do you know if the unofficial contains parts which are already in the official? If so, this could create multiple result. Could be solved by also prefixing the source [official|unofficial] at the search-results links I hope I can give some feedback on this sunday already, regards. Edit: updated official parts with the latest files (2022-03, released on 2022-05-07) Edit 2: The unofficial LDraw Lib contains also other parts (textures etc) -> need to extend my script to be able to include them too. Edited July 3, 2022 by aFrInaTi0n Quote
aFrInaTi0n Posted July 16, 2022 Author Posted July 16, 2022 (edited) @freakwave This feature may be provided by ldraw homepage in the near future - so I think I would stop my efforts, if its getting obsolete in the future anyways.. reference: https://forums.ldraw.org/thread-26497-post-47070.html#pid47070 Edited July 16, 2022 by aFrInaTi0n Quote
SNIPE Posted July 29, 2022 Posted July 29, 2022 This does not really need its own thread so I decided that this thread would be best to post it in, but you can also import .io models directly LDCAD by opening the io file in WINRAR, and extracting model.ldr. For a while I thought that the password was just garbage data being treat as a password because it happned to be in the same section of the file that WINRAR uses to check if the archive has a password, and what it is (in encrypted form) but turns out I was wrong, the password is actually just soho0909. I found the password from this souce after extensive googling: https://www.mecabricks.com/en/forum/topic/853 Quote
aFrInaTi0n Posted August 1, 2022 Author Posted August 1, 2022 @SNIPE Not really gitting it, your topic is for imports from Studio to LDCad - my thread is about importing parts from LDraw into Studio... All good if you think it fits best here, but maybe I didn't got your point correctly.. :D Quote
aFrInaTi0n Posted August 11, 2022 Author Posted August 11, 2022 @freakwave you can now download unofficial files too... Examples of the Daytona wheels:https://www.reum.it/ldraw-to-studio-exporter/index.php?part=73389.dat&unofficial=true https://www.reum.it/ldraw-to-studio-exporter/index.php?part=73398.dat&unofficial=true https://www.reum.it/ldraw-to-studio-exporter/index.php?part=80279.dat&unofficial=true Quote
aFrInaTi0n Posted January 9, 2023 Author Posted January 9, 2023 (edited) Updates of January 2023: Fix: Nightly refresh of LDraw unofficial files working now, it was buggy before and stuck on the releases from ~August 2022 version Feature: Unofficial files may be downloaded via a new checkbox. Searches are exclusive here, so having the checkbox set means it only goes through the unofficial list (but may grab sub assemblies from the official, where needed) UI: Added Dark Mode awareness UI: Added Font-Awesome Icons for downloads UI: Some tweaks (all professional webdesigners: hush hush, nothing to see here... don't look at my nasty css quirks :P) There shouldn't be any bugs known - hit me up if you found something to proof me wrong! Edited January 9, 2023 by aFrInaTi0n Quote
sparrow_blaise Posted May 28, 2023 Posted May 28, 2023 Hello there @aFrInaTi0n I love your " LDraw to Studio Exporter " So far I found one unofficial LDraw part that won't display properly, to be specific the shape is ok but the textures are not displayed https://library.ldraw.org/search/part?s=u9328ap01c01 parts/u9328ap01c01.dat Can you fix it if you can :) thanks a lot Quote
aFrInaTi0n Posted May 28, 2023 Author Posted May 28, 2023 (edited) Hello @sparrow_blaise - first of all thanks for your kind words - can you retest if all textures are now included? Direct Link: https://www.reum.it/ldraw-to-studio-exporter/index.php?part=u9328ap01c01.dat&unofficial=true There was a bug, missing out textures at all... fixed now - thanks for pointing out! With the LDraw Viewer its correctly showing the textures - I am not familar with working with textures, so I don't know if they need to be added manually in Part Designer for Studio picking them up, as mine isn't taking them.. Edited May 28, 2023 by aFrInaTi0n Quote
SylvainLS Posted May 28, 2023 Posted May 28, 2023 At the moment, LDraw and Studio’s texture mapping solutions are different. They could be compatible but they aren’t. Studio reinvented a solution, mostly because LDraw’s texmapping wasn’t actually used at the time (also because Studio wanted the images included in the part’s file, not as external files; that’s possible in LDraw but was not obvious). We are trying to have the Studio team at least make it easy/simple to import from / export to LDraw. Quote
aFrInaTi0n Posted May 28, 2023 Author Posted May 28, 2023 (edited) Thanks for clarification! So I am including all the pngs in the correct folder structure now - but then they need to be re-added in PartDesigner, I guess?! I which file is the description for Studio to recognize those? May be its worth a look, if those can be translated (in the process of creating the zipfiles from my tool). Edited May 28, 2023 by aFrInaTi0n Quote
SylvainLS Posted May 29, 2023 Posted May 29, 2023 It should be possible to automatically convert LDraw’s texmap syntax to Studio’s. The easy part is to include the png as a base64-encoded blob. For the other parameters, unfortunately, there’s no documentation, so you’ll need to retro-engineer the parameters. Note that, for some parts, Studio uses special files for texmaps (for instance, 973tex.dat for decorated torsos). I’m not sure of their utility: as a shape, they are the same as the plain parts, and I didn’t see any big syntactic difference (I mean, they are somewhat flattened but still use subfiles/primitives, including for the texmapped surface). Quote
sparrow_blaise Posted May 31, 2023 Posted May 31, 2023 (edited) @aFrInaTi0n Sorry it didn't work for me in Studio 2.0 Can you please fix it, it would mean the world to me Thanks buddy ALSO do you have that string that goes along the whole ship front to back from your Pirates 6285 ship for Studio 2.0 as a ldraw file perhaps? Edited May 31, 2023 by sparrow_blaise Quote
aFrInaTi0n Posted May 31, 2023 Author Posted May 31, 2023 (edited) Pleas read the posts above from @Sylvain - seems the format is structured in a complete other way in Studio. I fixed the downloader already - so now the pngs are included now - I will have to have a deeper look into this.. But I expect it taking longer / my capabilities to work on that issue not being good enough in the end. So no promises, but will update you as soon as I am somehow smarter about this topic (expect 2-4 weeks). Regards Edited May 31, 2023 by aFrInaTi0n Quote
sparrow_blaise Posted June 1, 2023 Posted June 1, 2023 @aFrInaTi0n thank you for your answer, I will kindly wait 2-4 weeks :) ALSO do you have that string that goes along the whole ship front to back from your Pirates 6285 ship for Studio 2.0 as a ldraw file perhaps? see picture above Quote
aFrInaTi0n Posted June 1, 2023 Author Posted June 1, 2023 (edited) If there is a part id in the LDraw official & inofficial, than the answer may be "yes" - so are you speaking of https://www.bricklink.com/v2/catalog/catalogitem.page?P=x77ac50 ? Can't find the ID in LDraw unfortunately - so the answer seems to be "no". General thing with Studio is: Its very limited when it comes to flexible parts like hoses, tubes etc - I think this may also apply to strings / cords.. normally people recommend to do the flexible parts in LDDraw and import them into Studio in their already-correctly bent positions. Another idea: Philo did it via the LDraw OMR: https://omr.ldraw.org/files/1512 Download this and take it out from there? I am curently working, so I can't rn check in detail what part number is in philos file of the ship.. Edited June 1, 2023 by aFrInaTi0n Quote
sparrow_blaise Posted June 3, 2023 Posted June 3, 2023 @aFrInaTi0n I didn't know LDraw OMR existed, what is it exactly? I love LDraw OMR, Built Lego sets with everything from sails, stickers to strings / cords, completed as it's meant to be :) Hey please don't give up on making the png files work for the tepees, even if it takes some time I would really like to build set LEGO Rapid River Village Set 6766 Quote
grab_a_beer_and_build_lego Posted December 12, 2023 Posted December 12, 2023 Hello! I've noticed an issue while trying to zip part no. 48156p01.dat - Minifig Helmet SW Scout Trooper with Black and Light Bluish Grey Markings Pattern. Exporter returns "not found" msg. Might be that I'm doing something wrong, tho I tried with part no. 47373 - from yours tutorial - and it worked properly :) May I ask for a little help? Thanks! Quote
aFrInaTi0n Posted December 12, 2023 Author Posted December 12, 2023 @grab_a_beer_and_build_lego You are right, its missing but should not - I will take a look the next days and post back here whenever I know the reasons. Meanwhile you may use the direct download function of the Ldraw lib (but then only as one unified .dat file - bottom left on the page you linked, direct link: https://library.ldraw.org/library/official/parts/48156p01.dat) Quote
grab_a_beer_and_build_lego Posted December 12, 2023 Posted December 12, 2023 I tried that - and unfortunately it looks like only a fragment of the part shows up in the open Studio editor. I wasn't sure whether it was a matter of a damaged LDraw model (unlikely - the embedded 3D preview on the LDraw website shows the correct model) or a matter of the fact that putting the model downloaded via "Download" into the "custom" directory causes an error. I'm sure I tried with the main model - that's why I kept looking and finally found your program :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.