Using LDCad flexible parts with Studio


Using LDCad flexible parts with Studio
#1
Studio is a nice LEGO CAD tool, but current version (2.0.1(39)) lacks flexible parts. Fortunately, with some tweaks (and a few caveats), it is possible to use LDCad flexible parts in Studio.

If you created your model with Studio, you need to
  • export it as LDraw
  • open the exported model with LDCad
  • add the flex parts using the guidelines that follow.
  • reload the LDraw model in Studio.
If, like me, you are a die-hard LDCad user, you can still use these tips to make use of the great photorealistic rendering engine included in Studio, or its fast and user friendly instruction generator. I find that Studio editor is not nearly as convenient, flexible and powerful as LDCad, but I'm probably biased Wink

How it works?
LDCad uses specialized meta-commands to describe the flexible parts but also create a generic fallback LDraw representation. It is this fallback which is visible in Studio if two conditions are met:
  • the fallback is made with segment parts present in the LDraw library of Studio
  • The segment parts are not scaled: Studio is not able to scale parts.
Important note:
This is NOT a LDCad flexible parts tutorial! For more details, see LDCad documentation, video tutorials and technical documentation.
Reply
1 - Directly compatible flexible parts
#2
[Image: easy-flex.jpg]
This is the easy case: LDCad fallback representation uses only unscaled LDraw parts. LDCAd model can then simply be loaded in Studio.
This is the case for all chains (Technic and System), System flexible hose and Technic ribbed hose. For this one, you must use the LQ template version (Technic Ribbed Hose LQ). HQ version doesn't use segment parts but a single mesh that can be visually better but doesn't import easily in Studio.
Files: LDraw, Studio
Reply
2 - Flexible parts with scaled segments
#3
[Image: unscaledflex.jpg]

Here LDCad fallback representation uses scaled LDraw segments, so you must tweak flexible parts to force LDCad to use unscaled segments. Otherwise flex parts looks like dashed lines in Studio, like this:
[Image: scaledflex.jpg]

This is the case for all Power Functions and Powered Up elements, as well as pneumatic hoses. You must always use the LQ template version (eg. Power Functions L Motor (LQ), Pneumatic Hose LQ). HQ versions don't use segment parts but a single mesh that can be visually better but don't import easily in Studio.

How to unscale segments:
  • In LDCad nested mode, click on the flexible section of the part to select it, then right-click -> properties
  • Set Basesize=100%, Segment size = 50%, maxmerge = 1 as shown in this screen capture.
[Image: skin1.jpg]

Of course you can also create a Studio compatible LDCad template instead of edit each and every flex part in your model!

I strongly suggest not to edit regular LDCad template, but copy it and edit the template copy. LDCad templates are located in %appdata%\LDCad\templates\ subfolders (Windows).

Here is for example a Studio-compatible pneumatic hose template. To use it place it in the same folder as regular template, in %appdata%\LDCad\templates\path\

Files: LDraw, Studio
Reply
RE: 2 - Flexible parts with scaled segments
#4
Philo,

Could you please copy these information into a wiki tutorial?

w.o
LEGO ergo sum
Reply
RE: 2 - Flexible parts with scaled segments
#6
(2018-11-02, 15:43)Philippe Hurbain Wrote: [Image: scaledflex.jpg]

Is there any similar workaround for using LSynth parts in Studio? I have exactly this issue with the renderer, where the part segments show as disconnected rather than continuous, for the flex system (rigid) hoses. (I'm using Mac, so Bricksmith is my LDraw editor which means LSynth is my option for flexible parts, since Studio's is not usable.)
Reply
3 - Flexible parts that need segment changes
#5
[Image: trickyflex.jpg]

This is the most complex situation: LDCad uses (scaled) segment parts that are not in LDraw library, so you have to find a suitable segment that is in library and modify flex part accordingly.

This is the case for strings, rubber belts, 9V and NXT/EV3 cables, Technic flexible axles and flex-system hoses.

How to change and unscale segments:
  • In LDCad nested mode, click on the flexible section of the part to select it, then right-click -> properties
  • Set Basesize=100%, Segment size = 50%, maxmerge = 1 as shown in this screen capture.
  • Change Donor placement type to Static references and Final scale to Segment merge only
  • Change the Part to the name of LDraw segment file.

[Image: skin2.jpg]

Suggested segment files:
  • 9V cable: 993.dat
  • NXT/EV3 cable: 932.dat
  • flex-system hose: 77.dat
  • round rubber band, strings: 4-4cyli.dat (result is a bit thin, but...)
  • square rubber band: box4o8a.dat
  • Body of Technic flex axle: axlehol8.dat. But you must also provide appropriate segments for the ends, so the best is to use this template!
Two other templates I made: NXT/EV3 cable, string with end studs.

 To use them, place them in the same folder as the matching regular templates, in %appdata%\LDCad\templates\path\

Files: LDraw, Studio

[Image: trickyflexrender.png]
Reply
RE: Using LDCad flexible parts with Studio
#7
Forgive me if this has been answered before, but is there something similar you have to do to use the spring parts? When I load a shock absorber into Studio, the spring mesh is not visible.
Reply
RE: Using LDCad flexible parts with Studio
#8
(2019-11-02, 5:54)N. W. Perry Wrote: Forgive me if this has been answered before, but is there something similar you have to do to use the spring parts? When I load a shock absorber into Studio, the spring mesh is not visible.
Well, yes, it's possible, but really convolved. The spring is generated by LDCad as a custom mesh, and there is no LQ version created with repeated LDraw elements. So the idea is to use the fallback code of the spring (used to see the spring outside LDCad) and put it as a custom part in Studio CustomParts\parts folder (Studio is unable to use parts embedded in MPD Sad ). Another drawback is that the spring is "frozen", so you can't adjust length after processing.

Here is the whole process...
- Start with LDCad code with shock absorbers (attachment shock1.mpd)
- Open it with a text editor.
- Search and replace string "springMesh.ldr" with "springMesh.dat" (Studio is unable to use part files with .ldr extensions Angry )
- Cut the section(s) of LDraw code after "0 FILE blahblah_springMesh.dat" and put them in separate file(s) named blahblah_springMesh.dat (attachments shock-06_5L-soft-1_springMesh.dat and shock-09_5L-hard-1_springMesh.dat).
- Place these files in Studio custom parts folder (C:\Users\<your user name>\AppData\Local\Stud.io\CustomParts\parts)
- Remove the 0 !LDCAD metacommand lines to avoid accidental changes of the code if you reopen file with LDCad
- Open resulting file in Studio (attachment shock2.mpd)

...but for most models I use uncompressed LDraw shortcuts to avoid the hassle!!!


Attached Files Thumbnail(s)
       

.mpd   shock1.mpd (Size: 1.77 MB / Downloads: 2)
.dat   shock-06_5L-soft-1_springMesh.dat (Size: 476.13 KB / Downloads: 2)
.dat   shock-09_5L-hard-1_springMesh.dat (Size: 1.3 MB / Downloads: 2)
.mpd   shock2.mpd (Size: 1.47 KB / Downloads: 2)
Reply
RE: Using LDCad flexible parts with Studio
#9
(2019-11-02, 10:52)Philippe Hurbain Wrote: Well, yes, it's possible, but really convolved. The spring is generated by LDCad as a custom mesh, and there is no LQ version created with repeated LDraw elements. So the idea is to use the fallback code of the spring (used to see the spring outside LDCad) and put it as a custom part in Studio CustomParts\parts folder (Studio is unable to use parts embedded in MPD Sad ). Another drawback is that the spring is "frozen", so you can't adjust length after processing.

Here is the whole process...
- Start with LDCad code with shock absorbers (attachment shock1.mpd)
- Open it with a text editor.
- Search and replace string "springMesh.ldr" with "springMesh.dat" (Studio is unable to use part files with .ldr extensions Angry )
- Cut the section(s) of LDraw code after "0 FILE blahblah_springMesh.dat" and put them in separate file(s) named blahblah_springMesh.dat (attachments shock-06_5L-soft-1_springMesh.dat and shock-09_5L-hard-1_springMesh.dat).
- Place these files in Studio custom parts folder (C:\Users\<your user name>\AppData\Local\Stud.io\CustomParts\parts)
- Remove the 0 !LDCAD metacommand lines to avoid accidental changes of the code if you reopen file with LDCad
- Open resulting file in Studio (attachment shock2.mpd)

...but for most models I use uncompressed LDraw shortcuts to avoid the hassle!!!

Wow, convolved indeed, but superbly helpful, thanks! I don't have much fear of accidentally ruining the file in Studio, as I'll only bring it in there for rendering…we'll see how that goes.
Reply
RE: Using LDCad flexible parts with Studio
#10
(2019-11-03, 5:34)N. W. Perry Wrote: Wow, convolved indeed, but superbly helpful, thanks! I don't have much fear of accidentally ruining the file in Studio, as I'll only bring it in there for rendering…we'll see how that goes.
No risk indeed with Custom parts folder. Actually I tend to use it in a "project specific" manner, I put there only the parts needed, and cleanup everything at the end (sometimes I zip the whole folder if I want to keep it for later). Too many parts there slows down Studio part editor startup.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)