Announcement

Collapse
No announcement yet.

C# Adding Materials

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • C# Adding Materials

    Hello,

    In my workflow I create a Multi Material for each layer with a matching name. I have created a Grasshopper component that detects what materials exist and if they do not exist, it creates them.

    My current method is really rough. It involves creating a separate material (using System.IO) in a folder and then importing it into the scene. Is there a way that I could directly generate the materials in C# (maybe using the VRay API?) without using this work around?


    Ash


    Attached Files

  • #2
    Hi,

    Currently you cannot create plugins (inc. materials) in the active scene, but only modify them. The reason is that this may mess with the interactive renderer updates system and produce wrong results or - if you delete plugins - may crash.
    We're looking to refactor that in the near future so that external plugin creation/deletion is allowed.

    At this point your workflow is good enough.
    It could be enhanced a bit, but creating the template .vrmat file on-the-fly using the scene library, but that is completely detached from the "active scene", and will still rely on saving temp files which will be then loaded via vrayImportMaterial.

    Furthermore that library is written in C, and will require much more C# code to hook it up.

    Comment


    • #3
      Thanks nikolay.bakalov!

      I'm not amazing at coding, so you have saved me a lot of time hunting around for stuff that isn't there. I'm guessing that this is also true for other functionality like saving render passes from the VfB?

      I've used V-Ray in Houdini and, while I know that it's a different beast, I'm look forward to any developments that you make in Grasshopper/C# that can make the process more node based.

      Thanks again,


      Ash

      Comment


      • #4
        V-Ray In Houdini uses different SDK, that is exposed to a greater extend. That is expected, having in mind the audience that uses Houdini. There is simply not that strong (almost none in fact) demand in Rh/Gh for doing such sort of stuff.
        However I'll consider that as a request from you and rake into account when the time for API expansion comes

        Comment


        • #5
          That's completely understandable. Actually the reason that I got into C# for Rhino was that when I was doing motion graphics, I kept having to use Wrangles to script everything that I wanted to do. One day it dawned on me that most of the things that I was trying to script in VEX could more easily be done in C# in Rhino. The only thing that was missing is the ability to animate and make some rendering automations.

          Maybe the API expansion could open the door for that kind of thing - "Build it and they will come"? Just a thought.

          Thanks again,


          Ash

          Comment

          Working...
          X