OctaneRender for Rhino Beta 1.20.1 [OBSOLETE]

Rhino 3D (Export script developed by SamPage; Integrated Plugin developed by Paul Kinnane)

Moderator: face_off

newske
Licensed Customer
Posts: 126
Joined: Sat Nov 03, 2012 11:51 pm

mantukaitis wrote:Hi there,

Could anyone share the best method of scattering Octane proxies? Just don't really get how to generate CSV file in Rhino.

Many thanks in advance.

mantukaitis,
I prefer this method which I've been keeping up to date through python (rather than using GH). You just scatter your geometry around the scene and it will produce a csv file for you. It just pops up with a list of blocks in the scene and you choose which ones you want to export the .csv for

Code: Select all

#-------------------------------------------------------------------------------
# Name:        CSV Scatter Exporter
# Purpose:     Exports Rhino block instance transformation matrixes to .csv files
# Author:      PaulM, extended & updated CamN
# Created:     28/07/2012
# Notes:       Updated (reduced) to only export .csv
#-------------------------------------------------------------------------------

__copyright__ = "Copyright 2013, PaulM, CamN"
__license__ = "MIT license, http://www.opensource.org/licenses/mit-license.php"
__version__ = "0.4 Development"
__status__ = "Alpha"
__url__ = (" ")

import rhinoscriptsyntax as rs
import os.path
import Rhino

def Interface():
    #Choose which blocks to use
    blocks = rs.BlockNames(sort=True)
    defaults = [True for i in range(len(blocks))]
    vals = Rhino.UI.Dialogs.ShowCheckListBox("Blocks", "Choose blocks to export:", blocks, defaults)
    useBlocks = []
    for block in blocks:
        index = blocks.index(block)
        if vals[index] == True:
            useBlocks.append(block)
    return useBlocks

def XFormFlipYZ(xfm):
    flp = rs.XformChangeBasis2((1,0,0),(0,1,0),(0,0,1),(1,0,0),(0,0,1),(0,-1,0))
    return(flp * xfm)

def GetExportPath():
    pth = rs.DocumentPath()
    pth = pth[:pth.rfind("\\")] + "\\"
    pth = rs.BrowseForFolder(folder = pth, message = "ObjFileLocation", title = "location for ObjFiles")  + "\\"
    return pth

def TransformsBlocksOctane(pth):
    for block in useBlocks:
        instance_lst = []
        for inst01 in rs.BlockInstances(block):
            inst = rs.BlockInstanceXform(inst01)
            if not rs.IsXformIdentity(inst):
                inst = XFormFlipYZ(inst)
                matrixVals = [inst.M00, inst.M01, inst.M02, inst.M03, inst.M10, inst.M11, inst.M12, inst.M13, inst.M20, inst.M21, inst.M22, inst.M23]
                for x, val in enumerate(matrixVals):
                    instance_lst.extend(str(val))
                    if x != len(matrixVals) -1: instance_lst.extend(",")
                instance_lst.extend(" \n")
        name_of_file = block
        completeName = os.path.join(pth, name_of_file+".csv")
        file1 = open(completeName, "w")
        for x in instance_lst:
            x = x.replace("[", "")
            x = x.replace("]", "")
            file1.write(x)
        file1.close()

if __name__ == "__main__":
    useBlocks = Interface()
    pth = GetExportPath()
    TransformsBlocksOctane(pth)
Last edited by newske on Sun Sep 08, 2013 12:30 pm, edited 2 times in total.
Octane for Rhino | Windows 8.1 x64 | i7-3820 OC | GTX970 4GB OC & GTX 560 Ti 1GB OC | 32GB DDR3
User avatar
face_off
Octane Plugin Developer
Posts: 15715
Joined: Fri May 25, 2012 10:52 am
Location: Adelaide, Australia

Thank you for posting this Newske.

Paul
Win7/Win10/Mavericks/Mint 17 - GTX550Ti/GT640M
Octane Plugin Support : Poser, ArchiCAD, Revit, Inventor, AutoCAD, Rhino, Modo, Nuke
Pls read before submitting a support question
newske
Licensed Customer
Posts: 126
Joined: Sat Nov 03, 2012 11:51 pm

face_off wrote:Thank you for posting this Newske.

Paul
No worries... and actually now that I think of it, it could be something worth even including just as a button in the plugin. But of course, up to you.
Octane for Rhino | Windows 8.1 x64 | i7-3820 OC | GTX970 4GB OC & GTX 560 Ti 1GB OC | 32GB DDR3
User avatar
face_off
Octane Plugin Developer
Posts: 15715
Joined: Fri May 25, 2012 10:52 am
Location: Adelaide, Australia

it could be something worth even including just as a button in the plugin. But of course, up to you.
I'll definitely look at doing that. Thank you.

Paul
Win7/Win10/Mavericks/Mint 17 - GTX550Ti/GT640M
Octane Plugin Support : Poser, ArchiCAD, Revit, Inventor, AutoCAD, Rhino, Modo, Nuke
Pls read before submitting a support question
User avatar
Bendbox
Licensed Customer
Posts: 478
Joined: Wed Aug 21, 2013 1:38 pm

Hi Paul,

I'm working on a project today and noticed that when assigning a texture map within the Rhino Material Editor in the transparency slot, the file name of that texture map does not transfer over to the Octane Material. Please see the image below. The texture map is named "Floor Gradient" and the Octane file name is a long string of letters and numbers. Can the names of the texture maps be made to transfer over to the Octane material so that they are the same?
Image
Win10x64 / AMD Ryzen 9 5900X / 64g RAM / 2 x RTX 3090
User avatar
face_off
Octane Plugin Developer
Posts: 15715
Joined: Fri May 25, 2012 10:52 am
Location: Adelaide, Australia

I'm working on a project today and noticed that when assigning a texture map within the Rhino Material Editor in the transparency slot, the file name of that texture map does not transfer over to the Octane Material. Please see the image below. The texture map is named "Floor Gradient" and the Octane file name is a long string of letters and numbers. Can the names of the texture maps be made to transfer over to the Octane material so that they are the same?
I am unable to replicate that issue. Would it be possible to save that Rhino material and send it to me pls? paul at physicalc-software dot com.

Thanks
Win7/Win10/Mavericks/Mint 17 - GTX550Ti/GT640M
Octane Plugin Support : Poser, ArchiCAD, Revit, Inventor, AutoCAD, Rhino, Modo, Nuke
Pls read before submitting a support question
ALTO
Licensed Customer
Posts: 54
Joined: Mon May 10, 2010 1:26 pm

That happens when you edit a map with Rhino material editor using for example Invert, Grayscale or other values in Output Adjustment.
Basically Rhino create a new bitmap called rdk$2342... the new map is stored in C:\Documents and Settings\Administrator\Local Settings\Temp\McNeel\RDK\Texture Cache.
mantukaitis
Licensed Customer
Posts: 4
Joined: Sat Sep 22, 2012 11:25 am

face_off

Thanks for the reply. As I'm not advanced user of Grasshopper still cannot figure it out how to save/export CSV out of GH definition and tutorial link is no longer working. Anyway seems quite promising, so will have to spend more time on this one.

newske,

Great script. Would you share any tips on using it - sometimes I get weirdly scaled objects (proxies) when assigning generated CSV? Many thanks.
User avatar
face_off
Octane Plugin Developer
Posts: 15715
Joined: Fri May 25, 2012 10:52 am
Location: Adelaide, Australia

Thanks for the reply. As I'm not advanced user of Grasshopper still cannot figure it out how to save/export CSV out of GH definition and tutorial link is no longer working. Anyway seems quite promising, so will have to spend more time on this one.
I think Newske's script supersede's the Grasshopper method from the other thread. I haven't had time to personally try either method, so would be interested in your results and findings.
That happens when you edit a map with Rhino material editor using for example Invert, Grayscale or other values in Output Adjustment.
Basically Rhino create a new bitmap called rdk$2342... the new map is stored in C:\Documents and Settings\Administrator\Local Settings\Temp\McNeel\RDK\Texture Cache.
Thanks Alto - you are right. I have referred the issue to McNeel to determine if it is an SDK issue or if this situation needs to be handled by the plugin. Regardless of the outcome, this situation will most likely become a non-issue with the proposed Material integration (coming in the next month or two) - since there won't be a concept of converting a Rhino material to an Octane material - everything will be a Rhino Material (including Octane Materials).

Paul
Win7/Win10/Mavericks/Mint 17 - GTX550Ti/GT640M
Octane Plugin Support : Poser, ArchiCAD, Revit, Inventor, AutoCAD, Rhino, Modo, Nuke
Pls read before submitting a support question
User avatar
Bendbox
Licensed Customer
Posts: 478
Joined: Wed Aug 21, 2013 1:38 pm

face_off wrote:
That happens when you edit a map with Rhino material editor using for example Invert, Grayscale or other values in Output Adjustment.
Basically Rhino create a new bitmap called rdk$2342... the new map is stored in C:\Documents and Settings\Administrator\Local Settings\Temp\McNeel\RDK\Texture Cache.
Thanks Alto - you are right. I have referred the issue to McNeel to determine if it is an SDK issue or if this situation needs to be handled by the plugin. Regardless of the outcome, this situation will most likely become a non-issue with the proposed Material integration (coming in the next month or two) - since there won't be a concept of converting a Rhino material to an Octane material - everything will be a Rhino Material (including Octane Materials).

Paul
Thanks for the quick response Alto and Paul. And Paul, the concept of having Octane and Rhino materials the same with no conversions sounds GREAT!
Win10x64 / AMD Ryzen 9 5900X / 64g RAM / 2 x RTX 3090
Post Reply

Return to “Rhinoceros 3D”