Issue with SU colorized texture

Forums: Issue with SU colorized texture
SketchUp Integrated Plugin (Integrated Plugin maintained by OTOY)

Issue with SU colorized texture

Postby ppoublan » Fri Jun 13, 2014 10:32 am

ppoublan Fri Jun 13, 2014 10:32 am
Hi
It looks like the new plugin does not support colorized textures.
Left object has a unmodified texture, and object at the right the same texture has been colorized within the SU Material window.
Is it something that could be added int the future to the plugin ?
Thanks
Pascal
Attachments
Capture.JPG
ppoublan
Licensed Customer
Licensed Customer
 
Posts: 56
Joined: Fri Nov 18, 2011 8:47 am

Re: Issue with SU colorized texture

Postby fuzzybro » Fri Jun 13, 2014 4:49 pm

fuzzybro Fri Jun 13, 2014 4:49 pm
ppoublan wrote:Hi
It looks like the new plugin does not support colorized textures.
Left object has a unmodified texture, and object at the right the same texture has been colorized within the SU Material window.
Is it something that could be added int the future to the plugin ?
Thanks
Pascal


Hi Pascal,

Early versions of Octane4SU supported colorization but Sketchup has a very weird colorization method, it is not just plan color multiplication. Result was wrong anyway so I turned this feature off until I figure out how to support it properly.

Thanks!
User avatar
fuzzybro
OctaneRender Team
OctaneRender Team
 
Posts: 562
Joined: Mon Jun 03, 2013 7:10 am
Location: Los Angeles, California

[workaround] Re: Issue with SU colorized texture

Postby ppoublan » Sat Jun 14, 2014 8:23 am

ppoublan Sat Jun 14, 2014 8:23 am
Thanks fuzzybro for your explanation,
Here is a quick and "very" dirty workaround I apply to my models when lot of colorized textures exists.
If it could help others to wait for integrated fix into Octane.

Before :
before.jpg


After :
after.jpg


This ruby script export all colorized textures, reset materials and reload into SU.
Just save it as .rb file into your SU Plugins directory.
Warning: No warranty, no support. Use at your own risks. Save your files before.

Yours
Pascal


module OctaneFixColorizedTextures
def self.savecolorizedtextures()
model = Sketchup.active_model
materials = model.materials
temp_dir = Sketchup.temp_dir
puts "debug:temp_dir:"+temp_dir
tw=Sketchup.create_texture_writer
mats=[]
materials.each { |m|
if m.materialType==2
mats<<[m,m.texture.width,m.texture.height]
end
}
for i in 0...mats.length
g=model.entities.add_group
g.material=mats[i][0]
tw.load(g)
puts "debug:exporting"
tw.write(g,temp_dir+"/tempmat"+i.to_s+".jpg")
end
for i in 0...mats.length
m=mats[i][0]
m.color=nil
m.texture=nil
end
for i in 0...mats.length
m=mats[i][0]
w=mats[i][1]
h=mats[i][2]
m.texture=temp_dir+"/tempmat"+i.to_s+".jpg"
m.texture.size=[w,h]
end
end
end
UI.menu("Plugins").add_item("Octane:FixColorizedTextures"){OctaneFixColorizedTextures.savecolorizedtextures}
ppoublan
Licensed Customer
Licensed Customer
 
Posts: 56
Joined: Fri Nov 18, 2011 8:47 am

Return to SketchUp


Who is online

Users browsing this forum: No registered users and 12 guests

Fri Apr 19, 2024 5:08 am [ UTC ]