Hello,
I’ve used very well in Rhino6 the VB component provided by @DavidRutten in an old post from Grasshopper forum ( https://bit.ly/2GvBTrZ ) but in RhinoWIP it doesn’t work and as I’m not a programmer I don’t know how to fix it! Any help will be apreciated!
Thank you in advance!
I still don’t know how to fix it but it seems that the function
mat.SetEnvironmentTexture(T, True)
doesn’t work.
Others functions works
mat.SetBitmapTexture(T, True)
mat.SetTransparencyTexture(T, True)
Related to that !!
Hi @nathanletwory ,
I guess the problem is the DisplayMaterial.SetEnvironmentTexture doesn’t work as expected.
private void RunScript(Mesh x, ref object A)
{
_m = x;
}
// <Custom additional code>
Mesh _m;
public override void DrawViewportMeshes(IGH_PreviewArgs args)
{
var mat = new DisplayMaterial();
mat.SetEnvironmentTexture(@"D:\matcap.png", true);
args.Display.DrawMeshShaded(_m, mat);
}
// <Custom additional code>
[image]
other textures work as expected:
[image]
SetEnviron…
it seems that you can do the same using Matcap shader in GHGL
I’m going to do my best to attempt to show how GhGL works today at 10 AM Pacific Time. I will also try and record it for others to view later.
Topic: Rhino/Grasshopper Social - GhGL
Time: Apr 8, 2020 10:00 AM Pacific Time (US and Canada)
Join Zoom Meeting
Meeting ID: 544 829 175
With a picture like this one
zebra.gh (13.2 KB)
5 Likes
Thank you very much! Seems it works for me!
2 Likes
maje90
(Riccardo Majewski)
January 11, 2021, 9:04pm
4
Couldn’t get it to work properly with Rhino WIP myself. Probably best to go with @nathanletwory ’s suggestion in any case.
Hi @nathanletwory ,
I guess the problem is the DisplayMaterial.SetEnvironmentTexture doesn’t work as expected.
private void RunScript(Mesh x, ref object A)
{
_m = x;
}
// <Custom additional code>
Mesh _m;
public override void DrawViewportMeshes(IGH_PreviewArgs args)
{
var mat = new DisplayMaterial();
mat.SetEnvironmentTexture(@"D:\matcap.png", true);
args.Display.DrawMeshShaded(_m, mat);
}
// <Custom additional code>
[image]
other textures work as expected:
[image]
SetEnviron…
1 year later, it is still the same.
There are any plans for this to be fixed?
Do someone knows any workaround from c# ?
I could use GHGL but usually prefer to have definitions that works on any machine without further installation/restart… and that runs on both, rhino 6 and 7.