C3POwen

[Guide] Rendering LDraw models using POV-Ray

454 posts in this topic

Since I'm new to all this rendering stuff, I have a problem with an error message in POV-Ray. I was trying to render my 7190 Millennium Falcon Model but the Part 4150ps4 seems to be not liked by POV-Ray. The Line: LDX_1_dash_16ri19_dot_dat_in_part causes the Error: Expected 'object', undeclared identifier 'LDX_1_dash_16ri19_dot_dat_in_part'. I don't have any clue what that means.

Share this post


Link to post
Share on other sites

Since I'm new to all this rendering stuff, I have a problem with an error message in POV-Ray. I was trying to render my 7190 Millennium Falcon Model but the Part 4150ps4 seems to be not liked by POV-Ray. The Line: LDX_1_dash_16ri19_dot_dat_in_part causes the Error: Expected 'object', undeclared identifier 'LDX_1_dash_16ri19_dot_dat_in_part'. I don't have any clue what that means.

I've come across this, and there seems to be a problem with the POV-Ray file that LDView creates, but I've not worked out how to stop it automatically happening each time.

The easiest way to manually fix this is to go to Search > Replace and then paste LDX_1_dash_16rin19_dot_dat_in_part into "Find" and LDX_1_dash_16ri19_dot_dat_in_part into "Replace with" and then click Replace All. When you try to run the render, it should now work without issue.

The actual LDraw file that POV-Ray is trying to recreate is called "1-16ri19.dat", and LDView seems to add an "n" to a couple of instances of this within the POV-Ray file.

Share this post


Link to post
Share on other sites

I've come across this, and there seems to be a problem with the POV-Ray file that LDView creates, but I've not worked out how to stop it automatically happening each time.

The easiest way to manually fix this is to go to Search > Replace and then paste LDX_1_dash_16rin19_dot_dat_in_part into "Find" and LDX_1_dash_16ri19_dot_dat_in_part into "Replace with" and then click Replace All. When you try to run the render, it should now work without issue.

The actual LDraw file that POV-Ray is trying to recreate is called "1-16ri19.dat", and LDView seems to add an "n" to a couple of instances of this within the POV-Ray file.

But there is no "n" in the line in question...

Share this post


Link to post
Share on other sites

But there is no "n" in the line in question...

No, not in the line it marks as being in error, but it is there elsewhere in the file, and this is what causes the problem.

Did you try the fix that I suggested?

Share this post


Link to post
Share on other sites

No, not in the line it marks as being in error, but it is there elsewhere in the file, and this is what causes the problem.

Did you try the fix that I suggested?

Yes, and it worked. Thank you.

Another thing. Transparent-Black looks almost opaque (although very "glossy") in my renders. Any suggestion how to fix this? I've placed Han and Chewie in the cockpit, but all you see is black :sad:

Edited by TK-949

Share this post


Link to post
Share on other sites

Hello again!

I hava a problem, maybe someone here can help me.

When I insert a TECHNIC flex system hose into my model (from part file or with LSynth) both ends disappear when I render it. In LDView, and in MLCad it looks complete and good, but in SR3D and when rendering the hose both ends disappear.

Like here at the drain pipe:

10218_1b_2fl.png

Share this post


Link to post
Share on other sites

Transparent-Black looks almost opaque (although very "glossy") in my renders. Any suggestion how to fix this? I've placed Han and Chewie in the cockpit, but all you see is black :sad:

Are you using MLCad or SR 3D Builder for your models? If you're using MLCad, are you sure that the colour you're selecting is "40 Trans_Black" and not "32 Trans_Black_IR_Lens"? The latter will produce something that looks opaque, and not transparent.

When I insert a TECHNIC flex system hose into my model (from part file or with LSynth) both ends disappear when I render it. In LDView, and in MLCad it looks complete and good, but in SR3D and when rendering the hose both ends disappear.

I don't believe SR 3D Builder supports anything generated using LSynth, but if you export the model from LDView to POV-Ray, then it should work.

Are the hose ends set to be hidden within MLCad? Do you have an example LDR file I could look at?

Share this post


Link to post
Share on other sites

I don't believe SR 3D Builder supports anything generated using LSynth, but if you export the model from LDView to POV-Ray, then it should work.

Are the hose ends set to be hidden within MLCad? Do you have an example LDR file I could look at?

Actually SR3D shows some part of the hose (nearly the same as in the render).

Here is the LSynth version of the building floor:

LDR

If you change it to the official "Technic Flex-system hose 9L 76324.dat" it is the same. I looked into the model file but only the Lsynth waypoints are hidden.

Share this post


Link to post
Share on other sites

I will post one of my new renders sometime this week, so you can all see the progress. The minifigs look horrible now compared to the rest of the bricks. Will have to re-render all of my models without them, I think. Or maybe I'll do one with and one without.

And here they are:

castle_guard_trans.pngcastle_guard1.png

castle_guard2.pngcastle_guard3.png

defense_archer.png

I used, quite obviously. Different lightings for the different renderings, but which one would you say looks the best? The colours are not right, and I suppose once you have them it will be then I will still have to work on the lighting to make sure it looks right with the particular colour.

The first one is a render with a transparent background, supposedly, but it doesn't really seem transparent and Photoshop did not recognize it as being transparent, either. :sceptic: Am I missing something here?

Share this post


Link to post
Share on other sites

Does PovRay saves the image as an png? If not, it can create a transparant background, but it will be white in the actual image, because e.g. jpg don't support transparant. So, you'll need a png to get working transparant backgrounds.

Share this post


Link to post
Share on other sites

Here is the LSynth version of the building floor:

If you change it to the official "Technic Flex-system hose 9L 76324.dat" it is the same. I looked into the model file but only the Lsynth waypoints are hidden.

I ran a (very quick) render from the LDR file you supplied and got the following:

10218_1b_2fl.png

I didn't modify the file that LDView created in any way, nor the LDR file before exporting it, and it seemed to work without issue. As the POV-Ray file is based on what LDView shows, I'm not quite sure what to suggest. Has everything been installed in the way shown at the beginning of the guide? Is LSynth installed in a different location?

The colours are not right, and I suppose once you have them it will be then I will still have to work on the lighting to make sure it looks right with the particular colour.

If it helps, I'll post a preliminary version of the file here.

It needs to be placed into the "lg" folder within the LGEO directory, for example: "C:\Program Files\LDRAW\LGEO\lg"

The first one is a render with a transparent background, supposedly, but it doesn't really seem transparent and Photoshop did not recognize it as being transparent, either. :sceptic: Am I missing something here?

Does PovRay saves the image as an png? If not, it can create a transparant background, but it will be white in the actual image, because e.g. jpg don't support transparant. So, you'll need a png to get working transparant backgrounds.

To force PNG output, you need to add +FN to the text box in POV-Ray next to the image resolution dropdown box. To force transparency, use +FN +UA. It is something I put into the guide, and can be currently found under "7.6 Transparency".

Edited by C3POwen

Share this post


Link to post
Share on other sites

I didn't modify the file that LDView created in any way, nor the LDR file before exporting it, and it seemed to work without issue. As the POV-Ray file is based on what LDView shows, I'm not quite sure what to suggest. Has everything been installed in the way shown at the beginning of the guide? Is LSynth installed in a different location?

I often had problems with this. LDView seems to not always recognize parts from the LSynth library for some reason. I think it also depends on the installation folder, for some reason.

If it helps, I'll post a preliminary version of the file here.

It needs to be placed into the "lg" folder within the LGEO directory, for example: "C:\Program Files\LDRAW\LGEO\lg"

Thanks, C3POwen!

To force PNG output, you need to add +FN to the text box in POV-Ray next to the image resolution dropdown box. To force transparency, use +FN +UA. It is something I put into the guide, and can be currently found under "7.6 Transparency".

Yeah, I tried it the first time, but I accidently changed, in the "floor" menu. the 1-yes to 0-yes. So I had both 0-yes and 0-no and then the floor was on 1, so I guess that's why it did what it did. :blush:

Once again, thanks a lot C3POwen!

Share this post


Link to post
Share on other sites

I ran a (very quick) render from the LDR file you supplied and got the following:

I didn't modify the file that LDView created in any way, nor the LDR file before exporting it, and it seemed to work without issue. As the POV-Ray file is based on what LDView shows, I'm not quite sure what to suggest. Has everything been installed in the way shown at the beginning of the guide? Is LSynth installed in a different location?

Okay I looked through the whole POV-Ray file, but did not find anything. So I uninstalled and re-installed LDView, and now it is okay.

Thanks for the help!

Edited by Calabar
Quoted image removed

Share this post


Link to post
Share on other sites

Okay I looked through the whole POV-Ray file, but did not find anything. So I uninstalled and re-installed LDView, and now it is okay.

Thanks for the help!

I don't know why it does this. Had a similar problem with MLCad a while back and another time with the LDraw library in general, but I finally got them working again. When I installed SR 3D Builder, there was a couple conflicts with the previously installed LDraw library, but I just left it as I don't use MLCad much anymore anyway.

Share this post


Link to post
Share on other sites

Are you using MLCad or SR 3D Builder for your models? If you're using MLCad, are you sure that the colour you're selecting is "40 Trans_Black" and not "32 Trans_Black_IR_Lens"? The latter will produce something that looks opaque, and not transparent.

I'm using MLCad and always take 40 for Trans Black. After I replaced the lg_colors.inc with your file it worked. Now you can actually see, what happens in the cockpit.

Share this post


Link to post
Share on other sites

*oh2* Ahhhhhh, computer crashed. After 24 hrs of rendering! Any chance to rescue the image through the pov-state file? *huh*

(2 minutes later):

Oh, found it. It's still there! PHEW!

[Edit]:

Done!

7190sm.jpg

It looks alright, although I think the blue bricks don't have the right color. And can someone tell me, which light I have to move/turn (and how) so that the reflection is not directly on the cockpit?

Edited by TK-949

Share this post


Link to post
Share on other sites

Does the lg_colors.inc mess with the LDConfig.ldr? Because, since I installed your file the colors in MLCad are confused, have other numbers and Reddish Brown is missing... *huh*

Share this post


Link to post
Share on other sites

It looks alright, although I think the blue bricks don't have the right color. And can someone tell me, which light I have to move/turn (and how) so that the reflection is not directly on the cockpit?

The blue in the lg_color.inc is based on the official blue values from Peeron, but if you wish to enter your own RGB value for the colour you can do so by opening the file with a text editor and running a search for "lg_blue" and changing the RGB values.

Telling you which light you would need to move would not be possible without actually looking at the the .pov file you have and running test renders, as you may not have your model set at the same rotation as someone else's. Experimentation would be the best thing to try, and there are plenty of POV-Ray guides out there that go into detail, some of which I list in the "More information" section.

Does the lg_colors.inc mess with the LDConfig.ldr? Because, since I installed your file the colors in MLCad are confused, have other numbers and Reddish Brown is missing... *huh*

No, it has no effect on it whatsoever, as it is a file that is purely referenced by POV-Ray, and not MLCad or any other LDraw-based software (such as LDView or LeoCAD).

Share this post


Link to post
Share on other sites

The blue in the lg_color.inc is based on the official blue values from Peeron, but if you wish to enter your own RGB value for the colour you can do so by opening the file with a text editor and running a search for "lg_blue" and changing the RGB values.

Maybe it's just the lighting.

Telling you which light you would need to move would not be possible without actually looking at the the .pov file you have and running test renders, as you may not have your model set at the same rotation as someone else's. Experimentation would be the best thing to try, and there are plenty of POV-Ray guides out there that go into detail, some of which I list in the "More information" section.

Yeah, that was a dumb question anyway.

No, it has no effect on it whatsoever, as it is a file that is purely referenced by POV-Ray, and not MLCad or any other LDraw-based software (such as LDView or LeoCAD).

That's odd, I don't know where this confused palette came from.

Share this post


Link to post
Share on other sites

Just a question: is there any benefits/disadvantages of working on a 64-bit computer as opposed to a 32-bit one? Are any programs needed incompatable with 64-bit or produce better or worse results?

Any updates soon to be added to the guide?

Share this post


Link to post
Share on other sites

Nice tutorials WhiteWolf.

I wonder when C3POwen will get around to updating this tutorial. He hasn't been around in over a week. :cry_sad:

Does the lg_colour.inc downloadable file here contain the correct colours for all the original brick colours?

Edited by palathadric

Share this post


Link to post
Share on other sites

I think there are several different lg_color.inc files, because of using different POV-Ray settings renders different colours.

Here is what I've done:

There is a site with offcial LEGO colours LUGNET color reference(unfortunatelly right now the server is down)and it has some .inc files. The problem is that these colors are the old ones (i.e. no light-bluish grey color) so I used the offical colours for the old ones and tried to figure out the new colours.

Here is the result:

lg_colors.inc

Again, it is not 100% the official colors, but close to them.

Share this post


Link to post
Share on other sites

Can someone send me a link to the lg_color.inc C-3POwen posted a while ago? I accidentally deleted mine.

Share this post


Link to post
Share on other sites

Can someone send me a link to the lg_color.inc C-3POwen posted a while ago? I accidentally deleted mine.

First post on this page, mate.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.