[Plugin] Front Face - 1.2
-
In the meanwhile, before it gets written into something better - to make ALL rear faces in the model [and faces inside definitions too] have the default material on their backs, just copy and paste this line of code into the Ruby Console - I compressed it into one line for ease of pasting...
m=Sketchup.active_model;es=m.entities;es.each{|e|e.back_material=nil if e.class==Sketchup;;Face};ds=m.definitions;ds.each{|d|d.entities.each{|e|e.back_material=nil if e.class==Sketchup;;Face}};return nil
-
Ok. I said I was busy, but I had to refresh my memory, how to write a Tool in SU, so played with FrontFace and here we go:
Version 1.2 is ready.Greetings
Tomasz -
Beautiful. Thank you.
-
@tig said:
to make ALL rear faces in the model [and faces inside definitions too] have the default material on their backs, just copy and paste this line of code into the Ruby Console - I compressed it into one line for ease of pasting...
m=Sketchup.active_model;es=m.entities;es.each{|e|e.back_material=nil if e.class==Sketchup;;Face};ds=m.definitions;ds.each{|d|d.entities.each{|e|e.back_material=nil if e.class==Sketchup;;Face}};return nil
TIG, this is probably one of the most useful pieces of code ever. Thank you very much.
-
TIG, does it also make all groups and components have the default material? (in case one or two got accidentally painted somehow?)
-
Fletch, Matthieu Noblet wrote a plugin for that:
http://forums.sketchucation.com/viewtopic.php?p=102323#p102323 -
@fletch said:
TIG, does it also make all groups and components have the default material? (in case one or two got accidentally painted somehow?)
No, it fixes back_materials inside them, but not materials applied to them - to do that you need this line...
Sketchup.active_model.definitions.each{|d|d.instances.each{|i|i.material=nil}}
-
gosh thank you so much for this works great
-
Thanks
Tomasz -
Hi Tomasz
I have found now this plugin!! This is fantastic. Thanks a lot! -
Thomasz
It seams that when material is on normal face and i use this plugin then material will be default SU material when turned the faces. Why is it like this? I think it should keep material and just turn faces. -
Hi all,
Proud to announce that there is finally a solution to the face flipping problem. You can now reverse faces and preserve UV coordinates! I tested it and the results are accurate!
The UV Toolkit makes it possible. You also need to download the TT_Lib and put it in your plugins folder.
To reverse a face, first select what you want reversed, then go to Plugins > UV Toolkit > Frontface material to Backface (or the opposite).
Hope it helps,
Jeremy -
I find it works 50% of the time, sometimes textures are mapped wrongly, maybe I am doing something wrong?
-
LOOK AT MY USER NAME, ENOUGH SAID. Need2SeeAttachments.
I WANT TO DOWNLOAD, NOW BYE FOREVER SKETCHUCATION.
Meant no offence, k thx bai. -
Bye bye.
-
Thank you for plugin this
-
Hi Tomasz,
I was installed Fredo Additional Plugin folder plugin http://sketchucation.com/forums/viewtopic.php?p=345150#p345150
and have a problem with finding icons if I use your plugin in another dir.Its only work with Sketchup 2013/Plugins place. Can you look at this?
Regards,
Daniel -
@dancho said:
Hi Tomasz,
I was installed Fredo Additional Plugin folder plugin http://sketchucation.com/forums/viewtopic.php?p=345150#p345150
and have a problem with finding icons if I use your plugin in another dir.Its only work with Sketchup 2013/Plugins place. Can you look at this?
Regards,
Daniel
This is an old script...
You are unlikely to get it chnaged now...
BUT you can adjust the tool's code yourself.
It is quite easy...
Open the filefrontface.rb
using Notepad, or another plain text editor like Notepad++ - BUT NEVER USE a word-processor!Near the beginning there are three lines that setup the button icons [#36/40/44]
The first line reads:
cursor_path = Sketchup.find_support_file("FrontFaceCursor.png", "Plugins/FrontFace_files")
You must rewrite it to read:
cursor_path = File.join(File.dirname(__FILE__), "FrontFace_files", "FrontFaceCursor.png")
so it now looks in a folder namedFrontFace_files
that is in the folder with the .rb file [wherever that is located], rather than always the main Plugins folder as the original code sets.
The other two entries forcursor_path =
need to be similarly recast, using:FrontFaceCursorOff
andFrontFace_OnDef
for the .png respectively... -
Hi TIG,
thanks for help, I do it like you wroteclass FrontFaceTool
def initialize
@ip = Sketchup::InputPoint.newcursor_path = File.join(File.dirname(__FILE__) ,"FrontFace_files","FrontFaceCursor.png" if cursor_path @cursor_on = UI.create_cursor(cursor_path, 12, 12) end cursor_path = File.join(File.dirname(__FILE__) ,"FrontFace_files","FrontFaceCursorOff.png" if cursor_path @cursor_off = UI.create_cursor(cursor_path, 12, 12) end cursor_path = File.join(File.dirname(__FILE__) ,"FrontFace_files","FrontFace_OnDef.png" if cursor_path @cursor_on_def= UI.create_cursor(cursor_path, 12, 12) end
end
and receive this error message, have you any idea?
THX
Dancho
-
You have mistyped.
It should be:
cursor_path = File.join(File.dirname(__FILE__), "FrontFace_files", "FrontFaceCursor.png"**)**
The error message tells you the error...
Add the final)
to the three lines and it will work OK...
Advertisement