Hi Natan, OK thats what i figured the last time i tried it, it will not work in python. btw. why is the texture written to the temp dir at all if it is a memory texture ? I’ve found that i can access and change it ?
_
c.
Hi Natan, OK thats what i figured the last time i tried it, it will not work in python. btw. why is the texture written to the temp dir at all if it is a memory texture ? I’ve found that i can access and change it ?
_
c.
The RDK writes one or more versions of any texture that is used. If you add a procedural texture to a material you’ll find that you get an image in tmp for that procedural as well - it is also just a memory/on-the-fly texture.
Thanks, i know that it writes a ton of images. I need to clear these folders often, otherwise i would run out of disk space.
_
c.
I’m one of those lazy users which find it useful when I search the forum and get hits in the source code.
Thank you for the useful code example which made me end up in this thread.
// Rolf
Hi guys, thanks for the info, but I realize that this is a bit over my skills.
So a quick question: What is the simplest way to save an image from python when I have a image defined the way I want it?
(I start off with:
NewWidth=100
NewHeight=100
bmpOut = System.Drawing.Bitmap(NewWidth, NewHeight)
And then I set the pixles)
Is bmpOut.Save(saveImagePath) a way to do it?
(Sorry for asking obvious questions, but it’s a bit new for me )
Yes.
Thanks, I’ll figure that out and should be up and running with an OK solution soon.
…when I have a few hours to spare…
But first I shall attend my Finnish Yoga class for some friday relaxation:
Loosing up those hard to reach back muscles are important after a long week in front of the monitor
Cheers!
All relaxed and managed to make a 5 color gradient saved as png next to the Rhino model.
So that’s the big step towards the goal.
Thanks for the help so far @nathanletwory !
(And Cheers!)
Small update for those interested:
Here’s what I’m wokring on:
A “shader” that generates a 5 color gradient to illustrate altitude on terrains.
The 5 colors are customizable and so are the “steps” in the colors. I want those so it easy to follow a contour.
Here you can see the same gradient with out steps:
And shown from top on a peaky landscape:
And a with/without comparison:
Now I just need to iron out a few material generating issues, but it serves my purpose so I can live with a few hickups for a while
Cheers!
In v7 there is a gradient hatch created by @stevebaer - maybe it can be used for this type of shading as well?
Thanks, that would probably have been good enough if it was available in V6, but now that I started the journey I sat my eyes on a higher goal and that is to add steps and also subtle contourlines that brightens or darkens the underlying color.
So as always, A BIG Thank You for all your help Nathan, you really help me out a lot!!!
With Raytraced you could make a custom material and have a color ramp driven by that height (:
For fun
terrain_height.3dm (655.7 KB)
terrain_height.gh (15.0 KB)
here a slightly cleaned up GH with some groupings and namings. Maybe a bit easier to understand: terrain_height.gh (15.7 KB)
I love it, here I work my butt off at night time and you just cook an interactive tool together for fun… Thanks for sharing, I’ll dig into it and see what I can learn. And come over to Norway for a weekend, I have some beers here with your name on it!
To give you a bit more work, I suppose that perhaps ideally, you would have a shader that is both elevation and slope dependent. On flatter parts, up to a certain elevation, you would have more greens than on steeper parts.
Ah, yes, for renderings a slope based material blend with procedurals would be nice… for sure!
Something like this:
Then also take from the geometry input node the normal and factor that into the equation as well.
I leave that as an excercise to all readers (:
Too bad I don’t have time to read this (ø:
GhGL could do this, but it would only work for OpenGL display and not for rendering.
You know me, I prefer realtime anyway, but I’m good anyway now that the script is working well
@nathanletwory Thanks alot for your in-memory texture sample.
I’m having some trouble getting it to update the texture each time I run the command. It seems to generate a custom texture the first time, then reload the same one even if the supplied bitmap has changed.
If I modify the mapping channel, it seems to update once, but then reloads that new bitmap when its called again.
//rtex.SetProjectionMode(TextureProjectionMode.WcsBox, RenderContent.ChangeContexts.Ignore);
rtex.SetProjectionMode(TextureProjectionMode.MappingChannel, RenderContent.ChangeContexts.Ignore);
The RDK writes one or more versions of any texture that is used. If you add a procedural texture to a material you’ll find that you get an image in tmp for that procedural as well - it is also just a memory/on-the-fly texture.
Where would this sample be saving these images? Maybe if I clear this folder, as @clement suggested.
I’d like to use this sample as a workaround to the memory issues with Displaybitmaps noted here
Cheers