0

I have a problem: I'm trying to model a DNA. I have it set up, but when I have a color ramp set to two different colors, it only shows one when rendering. But when I click Material in the 3d view, I can see it fine...Does anyone know what is happening?

EDIT: As requested, here is my .blend file:

Here are some screenshots of what happened (and my nodes)

Material mode enter image description here Rendered mode enter image description here

sam1370
  • 208
  • 1
  • 9
  • 1
    I can't replicate this behaviour - please Edit your question to add additional details of how your scene is set up. For example, I've assumed each of the 'bars' is a separate mesh, but all with the same material. It would also be useful to be able to see your .blend file - please upload it to http://blend-exchange.giantcowfilms.com/ and edit your question to include the link. – Rich Sedman Aug 19 '18 at 22:58
  • @RichSedman Done – sam1370 Aug 20 '18 at 02:52
  • I can't replicate what you're seeing when I try your file on Blender 2.76 - in fact, I see exactly the opposite (ie, Material view shows all green but Rendered shows alternating colors). It is as if in Material mode that the object Location is always zero. – Rich Sedman Aug 20 '18 at 06:20

2 Answers2

2

Another approach is to assign a single colour material to each piece. You only need to model a segment with one of each colour and then use an array modifier to duplicate it to length.

In this example I created a section and used an array modifier to duplicate it a few times and then a simple deform to twist it 360 degrees, then I used a second array modifier to duplicate that multiple times.

base piece

full dna

You can also use an object to define the offset with a rotation as shown here.

sambler
  • 55,387
  • 3
  • 59
  • 192
  • Thank you so much! I knew nothing about array modifiers...I thought you had to do a complicated solution like the node setup I had then. :) I am accepting the other answer though because it was a quick and easy solution. – sam1370 Aug 25 '18 at 02:35
1

If I change the interpolation mode in the colorramp to something else than constant. It works correct. But I cannot tell the why I'm afraid.enter image description here

sorenfroststaal
  • 905
  • 4
  • 15
  • 2
    I think the maths are producing values from the Modulo node that alternate between 0.0 and 0.5 resulting in the 'green' color in each case - it is never higher than 0.5 so never hits the yellow region. Setting to Ease or other interpolation moves the yellow region below 0.5. However, even so I can't replicate the original behaviour since I always seem to get an object Location of zero when in Material mode - I can only get alternating colors in Rendered mode (after a similar change to the color ramp as you have discovered). – Rich Sedman Aug 20 '18 at 06:26