Aerial Photo Texture Projected on Wrong Face Side - How to

Greetings,

Inadvertently I have applied/projected an aerial photo texture on a terrain.
Alas on a wrong face side.

As I have noticed in Twinmotion the texture has disappeared.

I would be really thankful for some piece of advice how to resolve this issue in a simplest way.
This is how to flip the faces side without loosing the projected terrain texture on a facing side.

I have tried to use a SU native option ‘reverse face’ but the aerial projected texture has been removed (changed probably the side of the face).
The problem is more complicated because of multiple irregular meshes with the texture.

One solution I have found was to apply the same texture on the opposite side (texture picker-drop) and then reverse face.

Perhaps there is any better (automated) solution to fix my stupid initial action. I have finished the model and there are quite many groups, faced to be fixed.

Thank you in advance for your advice and guidance, suggestion, etc.

My best regards

I don’t think there will be a simpler solution than this.


Renderer plugins and game engines usually ignores backfaces -for performance issues i think-
You can try applying a light pink color for your backfaces, so you distinguish it better.

image

Try this… paste the block of code into a file called PaintInsideSurfaces.rb, and move it into C:\Users<username>\AppData\Roaming\SketchUp\SketchUp 2017\SketchUp\Plugins

Start sketchup, right click an object, and there will be a menu item called ‘Centaur → Paint Inside Surfaces’.

All inside surfaces will be painted to match the outside surface (including textured surfaces), if you have a surface unpainted on the outside, then the inside surface will end up unpainted.

# PaintInsideSurfaces 1.0
# Copy the material, and texture, from the front to the back of each face
# 12 May 2011
#

require 'sketchup.rb'

class PaintInsideSurfaces


def PaintInsideSurfaces::PaintGroupFaces(entities, textureWriter)
	
	entities.each { |e|
		if e.class == Sketchup::Group
			PaintGroupFaces(e.entities, textureWriter)
		end
		
		if e.class == Sketchup::Face
			hasTexture = false
			face = e
			face.back_material = face.material
			if face.material != nil
				if face.material.texture != nil
				
					hasTexture = true
					ptarray = []
					uvhelper = face.get_UVHelper(true, true, textureWriter)
					face.outer_loop.vertices.each { |vert|
						uvq = uvhelper.get_front_UVQ(vert.position)
						ptarray.push(vert.position)
						ptarray.push(uvq)
					}
					begin
						face.position_material face.back_material,ptarray,false
					rescue
					end
				end
			end
		end
		
		if e.class == Sketchup::Edge
			e.material = nil
		end
	}
end
  
def PaintInsideSurfaces::Start()
	Sketchup.active_model.start_operation 'Paint inside surfaces',true ,false ,false
	
	textureWriter=Sketchup.create_texture_writer
	Sketchup.active_model.definitions.each { |component|
		PaintGroupFaces(component.entities, textureWriter)
	}
	entities=Sketchup.active_model.entities
	PaintGroupFaces(entities, textureWriter)
	Sketchup.active_model.commit_operation
	Sketchup.active_model.active_view.invalidate
end

end # Class PaintInsideSurfaces


unless file_loaded?(__FILE__)
	UI.add_context_menu_handler do |menu|
		submenu = menu.add_submenu("&Centaur Tools")
		submenu.add_item("Paint Inside Surfaces") { PaintInsideSurfaces.Start() }
	end
end

file_loaded(__FILE__)

Greetings,

I really do thank you for your guidance. I deeply appreciate it.
Thank you Centaur for the plugin I will keep it in the safest place.

Thank you filibis for the suggestion. I have applied this colorful scheme for a long time. Alas I have not pay attention enough to respect it correctly. Most of the time I work with Vray where there are no such material/texture problems (in principle).

I have finally duplicate material/aerial photo projected on meshes and the model finally was accepted by Twinmotion.
I think it is enough to just duplicate the texture without reversing faces afterwards. A rendering piece of software ™ will read the face side (in my case - back one) ignoring the back (pink - in your setting) facing one.

My best regards with repeated thanks.

PS
Why texturing has to be so complicated - one face on both side (?) would not do the expected results?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.