Page 1 of 1

Issue with SU colorized texture

Posted: Fri Jun 13, 2014 10:32 am
by ppoublan
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

Re: Issue with SU colorized texture

Posted: Fri Jun 13, 2014 4:49 pm
by fuzzybro
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!

[workaround] Re: Issue with SU colorized texture

Posted: Sat Jun 14, 2014 8:23 am
by ppoublan
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[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[0]
m.color=nil
m.texture=nil
end
for i in 0...mats.length
m=mats[0]
w=mats[1]
h=mats[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}