Page 9 of 10
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Sat Sep 07, 2013 12:12 pm
by newske
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)
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Sun Sep 08, 2013 10:45 am
by face_off
Thank you for posting this Newske.
Paul
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Sun Sep 08, 2013 11:16 am
by newske
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.
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Sun Sep 08, 2013 11:29 am
by face_off
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
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Mon Sep 09, 2013 1:41 pm
by Bendbox
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?

Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Mon Sep 09, 2013 2:04 pm
by face_off
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
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Mon Sep 09, 2013 2:51 pm
by ALTO
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.
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Mon Sep 09, 2013 3:12 pm
by mantukaitis
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.
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Tue Sep 10, 2013 12:05 am
by 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.
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
Re: OctaneRender for Rhino Beta 1.20.1 [STABLE]
Posted: Tue Sep 10, 2013 1:35 am
by Bendbox
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!