Bug? RenderTexture - SetProjectionMode

When I set texture projection mode for my texture:
SetProjectionMode(TextureProjectionMode.MappingChannel, ChangeContexts.Ignore);
SetMappingChannel(1, ChangeContexts.Ignore);

The result looks like if it was set to TextureProjectionMode.EnvironmentMap

And this one results in the correct mappingChannel mode
SetProjectionMode(TextureProjectionMode.View, ChangeContexts.Ignore);

Am I doing something wrong? (Or the enums are maybe mixed?)


@marton.parlagh I seem to be unable to reproduce with attached 3dm file TextureProjectionModeSettingTest.3dm (4.0 MB) and this code snippet:

import scriptcontext as sc
import Rhino as r

for rt in sc.doc.RenderTextures:
    rt.SetProjectionMode(r.Render.TextureProjectionMode.MappingChannel, r.Render.RenderContent.ChangeContexts.Program)
    rt.SetMappingChannel(1, r.Render.RenderContent.ChangeContexts.Program)

print "done"

The texture in the 3dm file gets properly its projection mode set.

after - mapping channel 1

If this is not the case then please share self-contained code example where the behavior is not correct.

Hello Nathan,

I have attached a sample codeTextureTest.cs (1.7 KB)

I don’t understand why it behaves like an environment mapping. (Probably I do something wrong.)

I add this texture to a simple box (via Custom material, diffuse channel)

and it looks wrong


Hello Nathan,

In case you have some time could you check my code please? Something is very unclear for me with texture projection settings it seems.


Ah sorry, I missed your replies. I’ll check your texture code.

Nathan, have you had time?

I was ill after that (shortness of breath and all that), so I haven’t looked yet. I mean, I briefly looked at it, but haven’t figured out yet what the cause is.