0
$\begingroup$

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

$\endgroup$
3
  • 1
    $\begingroup$ 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 blend-exchange.giantcowfilms.com and edit your question to include the link. $\endgroup$ Aug 19, 2018 at 22:58
  • $\begingroup$ @RichSedman Done $\endgroup$
    – sam1370
    Aug 20, 2018 at 2:52
  • $\begingroup$ 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. $\endgroup$ Aug 20, 2018 at 6:20

2 Answers 2

1
$\begingroup$

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

$\endgroup$
1
  • 2
    $\begingroup$ 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). $\endgroup$ Aug 20, 2018 at 6:26
2
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – sam1370
    Aug 25, 2018 at 2:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .