Jason C. Hand Posted November 10, 2017 Posted November 10, 2017 Just now, MReizinho said: Models built with LDCad are standard LDraw models. You'll have no problem with POV-Ray Ok, thanks. I asked because I have a number of LDD .lxf files that I wanna try & translate to this as well. Quote
MReizinho Posted November 10, 2017 Posted November 10, 2017 You can open the .lxf file in stud.io and export it to Ldraw. It does a better conversion than LDD. Quote
roland Posted November 10, 2017 Posted November 10, 2017 3 hours ago, MReizinho said: There's something that has been nagging me for some time: part 24246.dat - Tile 1 x 1 with Rounded End, has some problems rendering correctly. You can notice a distinct shadow in the top surface that will change orientation as you rotate the model around. Does anyone know why this happens or if there is any way to avoid this? @roland, do you have any "hidden" parameters accesible through the config files to tune up the OpenGL rendering (outline lines, primitive substitution, light, etc.)? It seems the smoothing algorithm trips on something, probably those very narrow triangle shaped rounded edges. I'll have to dive deeper in the part's construction to be able to improve on it. The main problem is LDraw files have no 'normals' so LDCad has to invent them while loading the parts. This depends on certain assumptions and part construction parameters (especially the edges). All LDraw related OpenGL options are found in the prefs/ldraw menu, the generic OpenGL options are in prefs/openGL 3 hours ago, Jason C. Hand said: I'm gonna try out this software this weekend. Just curious, though: Can any models built with LDCad be made POV-Ray compatible? As of version 1.6 LDCad also has it's own POV-Ray export feature, and if you want extreme HQ you can open the made LDR/MPD model in LDView to export while using the LGEO library. Quote
Jason C. Hand Posted November 10, 2017 Posted November 10, 2017 @roland Oh ok, thank you again! Quote
Neuenk Posted December 30, 2017 Posted December 30, 2017 (edited) Hi, first of all thank you for the Great Tool. I am also often get lxf Files(LDD). I Translate it with lxf2ldr, bedaure it uses the subgroups as submodules. Than I trying to add steps by disassembling the model backwards. And here is my question or suggestion. It would be helpful if there were an "insertAfter step " function that would insert an new empty step after the current step without leaving the current step. Then there should be a "Move selection to Next Step" function, which inserts the parts in reverse order as selected. Of course, it would be even better if there were a disassemble mode, which would move each clicked part to the first position of the next step. Do you think, this could be possible? Dirk Edited December 30, 2017 by Neuenk Typo Quote
legolijntje Posted December 30, 2017 Author Posted December 30, 2017 8 hours ago, Neuenk said: Hi, first of all thank you for the Great Tool. I am also often get lxf Files(LDD). I Translate it with lxf2ldr, bedaure it uses the subgroups as submodules. Than I trying to add steps by disassembling the model backwards. And here is my question or suggestion. It would be helpful if there were an "insertAfter step " function that would insert an new empty step after the current step without leaving the current step. Then there should be a "Move selection to Next Step" function, which inserts the parts in reverse order as selected. Of course, it would be even better if there were a disassemble mode, which would move each clicked part to the first position of the next step. Do you think, this could be possible? Dirk Maybe not exactly what you're looking for, but it's what I personally think works the easiest: open a new 'source window' by going to View -> New source window. In the source window you can arrange parts and steps in any order you like just using drag&drop functionality. Quote
Neuenk Posted December 30, 2017 Posted December 30, 2017 Thanks for reply, but if you have a long list of parts, than it is a lot of scrolling, do drop to the right step. Currently I have open the stepLIst, the source window and the reorganizing move step. Than I select the parts and click on the step after higlighted in the moving step window. I like it, if i move a part, that it wil be move away, without hidding, because I am in the Step before. If a than use a new Step, I click in the step Window to next Step (or by keboard), click Insert and go to the previous Step. It is only a wish, and I think the both function are more or less trivial to programming (I currently try to understand the lua api, than I can make these function by myself, but without debugging and understanding the full api, it is a little bit hard...) Quote
roland Posted December 30, 2017 Posted December 30, 2017 (edited) 4 hours ago, Neuenk said: Thanks for reply, but if you have a long list of parts, than it is a lot of scrolling, do drop to the right step. Currently I have open the stepLIst, the source window and the reorganizing move step. Than I select the parts and click on the step after higlighted in the moving step window. I like it, if i move a part, that it wil be move away, without hidding, because I am in the Step before. If a than use a new Step, I click in the step Window to next Step (or by keboard), click Insert and go to the previous Step. It is only a wish, and I think the both function are more or less trivial to programming (I currently try to understand the lua api, than I can make these function by myself, but without debugging and understanding the full api, it is a little bit hard...) You can open multiple source windows if you need to move multiple things from the bottom to elsewhere. Be sure to disable 'follow current step' and 'follow selection' for both windows (right click inside source win). As for scripting, I think you want something like this (not extensively tested though), Add it to "%appdata%/LDCad/scripts/default/global/steps.lua" above the register function function runSelInsStep() --only useful if a model is active. local sf=ldc.subfile() if not sf:isLinked() then ldc.dialog.runMessage('No active model.') return end local ses=ldc.session() local sel=ses:getSelection() if sel:getRefCount()>0 then local curStep=ses:getCurStepNr() local idx=sf:getStepLineInfo(curStep+1) sf:addNewLine(idx, '0 STEP') for i=1,sel:getRefCount() do sf:moveLine(sel:getRef(i), idx) end ses:setCurStepNr(curStep) end end And add macro:register('Move selection to new step') macro:setHint('This will move the selection to a new step after the current one.') macro:setEvent('run', 'runSelInsStep') To its register function Sorry for the lack of (>=1.6) API documentation it is still on my to do list :) edit: This script won't work for the last step, I made a improvement for this but that version won't work in 1.6a due to a bug in moveLine. You can workaround it by adding a empty step to the model. You can remove it again when working with steps other then the last one. Edited December 30, 2017 by roland Quote
Neuenk Posted December 31, 2017 Posted December 31, 2017 (edited) --Insert selected Steps into Step after current Step ============================================================================================================= function insertSelectionIntoNextStep(createNewStep) --only useful if a model is active. local sf=ldc.subfile() if not sf:isLinked() then ldc.dialog.runMessage('No active model.') return end local ses=ldc.session() local sel=ses:getSelection() local refCnt = sel:getRefCount() if refCnt>0 then local curStep=ses:getCurStepNr() local idxCurStep=sf:getStepLineInfo(curStep) local idxNewStep local addNewStep= createNewStep == true if (sf:getStepCount() > curStep) then idxNewStep=sf:getStepLineInfo(curStep+1) local lineCnt=sf:getLineCount() if ( idxNewStep == 0) then --print('nextStep has no items, we use nextStep for insert') addNewStep= false if (idxCurStep > 0) then --print('curStep has items, so search for curStep Line...') idxNewStep= idxCurStep repeat idxNewStep= idxNewStep+1 until sf:getLine(idxNewStep):isStepMeta() idxNewStep= idxNewStep+1 else --print('curStep has also no items, search for curStep line ...') local steps= curStep repeat idxNewStep= idxNewStep+1 if sf:getLine(idxNewStep):isStepMeta() then steps= steps -1 end until idxNewStep>=lineCnt or steps== 0 if (idxNewStep>=lineCnt) then --print('curStep Line not found') --else --print('curStep Line found: '..idxNewStep) end end elseif (sf:getLine(idxNewStep):isStepMeta()) then --print('nextStep is last step without items, than we get directly the STEP line and use this for insert') addNewStep=false idxNewStep= idxNewStep + 1 else --print('nextStep has items..'..idxNewStep) if (createNewStep) then idxNewStep= idxNewStep - 1 if (idxCurStep == 0) then --print('curStep has no items, we use curStep for insert') addNewStep=false --else --print('curStep has items') end else --print('search for last position..') repeat idxNewStep= idxNewStep+1 until idxNewStep>lineCnt or sf:getLine(idxNewStep):isStepMeta() end end else --print('current Step is last Step') if (not createNewStep) then return end idxNewStep= sf:getLineCount() + 1 if (sf:getLine(idxCurStep):isStepMeta()) then --print('curStep has no items, but at last step we get directly the STEP line; use curStep for insert') addNewStep=false --else --print('curStep has items') end end --collect all selectect Items, because on moving the selection object will be damaged local refList= {} for i=1,refCnt do local ref= sel:getRef(i) refList[i]= {} refList[i].ref= sel:getRef(i) refList[i].correctIdx= ref:getLineIndex() < idxNewStep end local useHelpLine if (idxNewStep > sf:getLineCount()) then useHelpLine= idxNewStep sf:addNewLine(idxNewStep, 'temporary helpline for tail-insert') end for i=1,refCnt do sf:moveLine(refList[i].ref, idxNewStep) if refList[i].correctIdx then idxNewStep= idxNewStep-1 end end if (useHelpLine) then sf:deleteLine(useHelpLine) end if (addNewStep) then sf:addNewLine(idxNewStep, '0 STEP') ses:setCurStepNr(curStep) end end end --Insert selected Steps into a new Step after current step ============================================================================================================= function runSelInsStep() insertSelectionIntoNextStep(true) end --Insert selected Steps into next Step after current step ============================================================================================================= function runSelInsNextStep() insertSelectionIntoNextStep(false) end macro:register('Move selection to new step') macro:setHint('This will move the selection to a new step after the current one.') macro:setEvent('run', 'runSelInsStep') macro:register('Move selection to next step') macro:setHint('This will move the selection to the next step after the current one.') macro:setEvent('run', 'runSelInsNextStep') Edited December 31, 2017 by Neuenk splitted into 2 functions Quote
roland Posted January 3, 2018 Posted January 3, 2018 (edited) On 12/31/2017 at 1:08 PM, Neuenk said: ..big script... There are still some situations that won't work (e.g. if the current step is the last one and has no items nor a step meta (getStepLineInfo returns 0) Also it seems the wrong line is deleted when deleting the helper line because of the index shift caused by the new lines. I'll make some improvements to the api to handle this kind of scenario much cleaner/shorter. It will be available in 1.6b which I'm hoping to release this month. If anyone has some additional ideas for a practical script please let me know so I can test if it's possible using the current api etc and/or extend it if needed. Edited January 3, 2018 by roland Quote
Neuenk Posted January 4, 2018 Posted January 4, 2018 (edited) Hi Roland, On editing my Post above, I also removed some hints Form me above the Code... so before I didn't start directly with code, sorry. There I descripe also the Situation Edith the getSteplineinfo and that has to be confused me..., with result 0 and that the last line Works in an other way. I wrote also, that I Read your editing with the bug to Late and that I had implement a Workaround.(helperline). And this one I can fully understand: On 30.12.2017 at 8:32 PM, roland said: Sorry for the lack of (>=1.6) API documentation it is still on my to do list :) And than I ask you, if you can apply this Script to your Next Version. But if you have changed your API, I can also improve my Script. 22 hours ago, roland said: I'll make some improvements to the api to handle this kind of scenario much cleaner/shorter. It will be available in 1.6b which I'm hoping to release this month. Nice to Read this, you make a great job, thank you Dirk Edited January 4, 2018 by Neuenk Quote
roland Posted January 4, 2018 Posted January 4, 2018 11 hours ago, Neuenk said: And than I ask you, if you can apply thus Script to your Next Version. But if you habe changed Sour API, I can also improve my Script. Yes, you'll probably only have to check the moveLine usage as that function has a big problem in 1.6a (It uses an incorrect index conversion, needed because the internals never really delete lines. Deleted lines are then only hidden for undo purposes so a move is really a del+add opp) Quote
Neuenk Posted January 4, 2018 Posted January 4, 2018 (edited) Ok, if I have installed the next version, I will check and test it. Edited January 4, 2018 by Neuenk Quote
roland Posted March 10, 2018 Posted March 10, 2018 I've released LDCad 1.6b. It contains mostly bugfixes and support for the newest LDraw libraries part snapping wise etc. Enjoy: http://www.melkert.net/LDCad/download Quote
Ivan_M Posted February 21, 2019 Posted February 21, 2019 Afrer a long time using stud.io I have decided to take step forward and use LDCad as my main tool. There are however two things that bugs me a lot: 1) Is it possible to map camera movement to mouse wheel button i.o. propertiers? 2) Is it possible to create folders in favourite parts bin, preferable with fixed parts colors? it is extremly tedious to look for the parts, esp. when they have different color than I'm used to. Most of the technic parts are available in one color anyway. Any I don't want to browse "gear" category filled with obsolete or weird parts that i do not use at all. Like this: https://drive.google.com/file/d/19bF0UTdJtpfH1-VBB1hgZSyByUndVhEM/view?usp=sharing Thank you Quote
roland Posted February 21, 2019 Posted February 21, 2019 1) I'm not sure what you mean with this 2) I tried to organize the bin in such a matter content will automatically grow with new LDraw part releases. But you are free to re-organize / extend them for use with static (colored) part lists by editing files located in %appdata%\LDCad\partBin. See also http://www.melkert.net/LDCad/tech/partBin Quote
Ivan_M Posted February 22, 2019 Posted February 22, 2019 12 hours ago, roland said: 1) I'm not sure what you mean with this 2) I tried to organize the bin in such a matter content will automatically grow with new LDraw part releases. But you are free to re-organize / extend them for use with static (colored) part lists by editing files located in %appdata%\LDCad\partBin. See also http://www.melkert.net/LDCad/tech/partBin Thank you for the reply, I have figured out the custom bins, I should have expected this, it is quite obvious Regarding the 1) - the middle mouse button (when I click with the wheel) brings up properties window. I would like to remap it to camera movement left-right/up-down (currently shift+right mouse button). Quote
roland Posted February 23, 2019 Posted February 23, 2019 On 2/22/2019 at 9:59 AM, Ivan_M said: Regarding the 1) - the middle mouse button (when I click with the wheel) brings up properties window. I would like to remap it to camera movement left-right/up-down (currently shift+right mouse button). I might make that an option in 1.6c if I can implement it without too much of a hassle. Quote
Ivan_M Posted February 26, 2019 Posted February 26, 2019 On 2/23/2019 at 7:47 PM, roland said: I might make that an option in 1.6c if I can implement it without too much of a hassle. Cool, thank you. One more thing that would make my life easier - would it be possible to add custom commands similar to other non-visual LDraw commands? I'm particullarly looking for LPub commands 0 !LPUB PLI BEGIN IGN and 0 !LPUB PLI END. When I use a lot of buffer exchange it would be easier to add this command directly in LDcad rather then in LPub, bacause it would be possible to move it much easier. Now I use !LICENCE and !KEYWORD to mark the PLI IGN start and end, then I open the mpd file in notepad replacing all instances with correct text. Thanks Quote
roland Posted February 26, 2019 Posted February 26, 2019 10 hours ago, Ivan_M said: One more thing that would make my life easier - would it be possible to add custom commands similar to other non-visual LDraw commands? I'm particullarly looking for LPub commands 0 !LPUB PLI BEGIN IGN and 0 !LPUB PLI END. You can do that using macros or by simply paste it from elsewhere (e.g. notepad). For macros you'll need to learn lua scripting though. Examples are in the %appdata%\ldcad\scripts\default\global folder. Quote
roland Posted February 26, 2019 Posted February 26, 2019 (edited) 4 hours ago, roland said: You can do that using macros Thought a specific sample would be helpful as it isn't that complicated but documentation is (very) lacking at the moment. Create (while ldcad is closed) e.g. lpub.lua in %appdata%\ldcad\scripts\default\global With the below content. When you start LDCad a new item will be added in the scripts menu, which leads to a submenu containing 'LPub snippet' when you click that it will add the three test lines to the current building step. function addLine(ses, text) local sf=ldc.subfile() local lineOfs, lineCnt=sf:getStepLineInfo(ses:getCurStepNr()) local lineOfs=lineOfs+lineCnt local line, cnt=sf:addNewLine(lineOfs, text) ses:getSelection():add(line) end function lpubSnip_1() local ses=ldc.session() if ses:isLinked() then ses:getSelection():remove() addLine(ses, '0 !LPUB some cool command') addLine(ses, '0 !LPUB another cool command') addLine(ses, '0 !LPUB etc') end end function register() local macro=ldc.macro('LPub snippet') --macro:setHint('') macro:setEvent('run', 'lpubSnip_1') end register() Edited February 26, 2019 by roland Quote
roland Posted February 27, 2019 Posted February 27, 2019 12 hours ago, Ivan_M said: Thank you, it is working fine Also it's best to use this in combination with the source editor window inside LDCad so you can e.g. move content around for things like substitution. Or write a more complicated script that auto substitutes the selection or something like that :) Quote
Jaco Posted March 4, 2019 Posted March 4, 2019 I have a script for a few LPub commands: function addLine(ses, text) local sf=ldc.subfile() local lineOfs, lineCnt=sf:getStepLineInfo(ses:getCurStepNr()) local lineOfs=lineOfs+lineCnt local line, cnt=sf:addNewLine(lineOfs, text) ses:getSelection():add(line) end function LPubCallout() local ses=ldc.session() if ses:isLinked() then ses:getSelection():remove() addLine(ses, '0 !LPUB CALLOUT BEGIN') addLine(ses, '0 !LPUB CALLOUT END') end end function LPubPLI_Ign() local ses=ldc.session() if ses:isLinked() then ses:getSelection():remove() addLine(ses, '0 !LPUB PLI BEGIN IGN') addLine(ses, '0 !LPUB PLI END') end end function LPubPartIgn() local ses=ldc.session() if ses:isLinked() then ses:getSelection():remove() addLine(ses, '0 !LPUB PART BEGIN IGN') addLine(ses, '0 !LPUB PART END') end end function LPubPLI_PartSub() local ses=ldc.session() if ses:isLinked() then ses:getSelection():remove() addLine(ses, '0 !LPUB PLI BEGIN SUB filename.ldr 16') addLine(ses, '0 !LPUB PART BEGIN IGN') addLine(ses, '0 Line for Submodel to be replaced by filename.ldr') addLine(ses, '0 !LPUB PLI END') addLine(ses, '0 !LPUB PART END') end end function register() local macro=ldc.macro('LPub Callout') --macro:setHint('Add LPub Callout metacommands') macro:setEvent('run', 'LPubCallout') local macro=ldc.macro('LPub PLI ignore') --macro:setHint('Add LPub PLI ignore metacommands') macro:setEvent('run', 'LPubPLI_Ign') local macro=ldc.macro('LPub PART ignore') --macro:setHint('Add LPub PART ignore metacommands') macro:setEvent('run', 'LPubPartIgn') local macro=ldc.macro('LPub PLI and PART substitution') --macro:setHint('Add LPub PLI and PART substitution metacommands') macro:setEvent('run', 'LPubPLI_PartSub') end register() 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.