New Texture Viewer in Model Viewer - Page 3 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 09-17-2018, 09:38 PM   #21
51thPolux
Junior Member
 
Join Date: Apr 2009
Location: nimes
Posts: 54
Default

it works, thanks for the help
51thPolux is offline   Reply With Quote
Old 11-24-2018, 05:53 PM   #22
Kolyma
Junior Member
 
Kolyma's Avatar
 
Join Date: Dec 2014
Location: Tennessee, USA
Posts: 70
Default

Ugh, if I just cut-n-paste what you have it doesn't work. I can change the model in LoadModel and get different models, but the LoadLivery has no effect

Code:
--autoexecute sample for model viewer
--mount_vfs_liveries_path("Mods/aircrafts/Wunderluft/Liveries")
--mount_vfs_liveries_path("CoreMods/aircraft/FA-18C/Liveries")
--mount_vfs_texture_path("Mods/aircrafts/Wunderluft/Textures/base_zip_package")

--LoadModel("Bazar/World/Shapes/A-10.edm")
--LoadLivery("A-10C","184th FS Arkansas ANG, Fort Smith (FS)")
--SetArgument(0,1)
--SetArgument(3,1)
--SetArgument(5,0.75)

local lfs = require("lfs")
local function service_file(file)
	return file == "." or
		   file == ".." or
		   file == ".svn" or
		   file == "_svn"
end

function scan_for_textures(path)
	local lower_case      = path:lower()
	if lower_case:find("liveries") then
	   mount_vfs_liveries_path(path)
	   return
	end
	local is_texture_path  = lower_case:find("texture") ~= nil
	local mounted_already  = false
	for file in lfs.dir(path) do
		if not service_file(file) then
		   local fn 	  = path.."/"..file
		   local attr 	  = lfs.attributes (fn)
		   if attr.mode	 == "directory" then
			  scan_for_textures(fn)
		   elseif is_texture_path then
			  local ext = string.sub(file,-4)
			  if '.zip' == ext then
					mount_vfs_texture_path(fn)
			  elseif not mounted_already and (
				 '.dds' == ext or
			     '.bmp' == ext or
				 '.jpg' == ext or
				 '.png' == ext or
				 '.tga' == ext) then
					mount_vfs_texture_path(path)
					mounted_already = true
			  end
		   end
		end
	end
end

function scan_for_environment_cubes(path)
	local lower_case = path:lower()
	for file in lfs.dir(path) do
		if not service_file(file) then
			local fn = path.."/"..file
			local attr = lfs.attributes(fn)
			if attr.mode == "file" then
				local ext = string.sub(file,-4)
				if '.dds' == ext then
					AddEnvironmentMap(file)
				end
			end
		end
	end
end

print("----------------------------------------------------------------")
print("scan for textures and liveries")
scan_for_textures("CoreMods")
print("----------------------------------------------------------------")
scan_for_textures("Mods")
scan_for_environment_cubes("Bazar/EffectViewer/envcubes")
print("scan done")
print("----------------------------------------------------------------")

--LoadLodModel("tech.lds");

--[[
LoadModel("d:\\Projects\\trunk\\LockOnExe\\Bazar\\World\\Shapes\\farp.edm");
Move(0, -1.22, 0);
local d = 10;
local f = LoadLodModel; local file_name = "tech.lds";
--local f = LoadStaticCharacterModel; local file_name = "tech_animation.chanimgpu";
--local f = LoadCharacterModel;
if f ~= nil then
    for i = -d,d do
        for j = -d,d do
            --f("d:\\Projects\\trunk\\LockOnExe\\Data\\tech_animation.lua")
            --f("d:\\Projects\\trunk\\LockOnExe\\Data\\tech_animation.chanimgpu")
            --f("tech_animation.chanimgpu")
            f(file_name);
            Move(i, 0, j);
        end;
    end;
end;
--]]

LoadModel("CoreMods/aircraft/FA-18C/Shapes/fa-18c.lods")
LoadLivery("FA-18C_hornet","Australian 75th Squadron")
SetArgument(0,0)
SetArgument(3,0)
SetArgument(5,0)
Here's the model viewer log

Code:
12:50:24 INFO: DCS log enabled!
12:50:24 WARNING: libpng warning: iCCP: known incorrect sRGB profile
3.3455	TRACE  	lua_loadfile	ModelViewer2::createLua: Config\ModelViewer\DefaultAnimation.lua
3.4719	ERROR  	EDCORE	Can't mount c:/program files/eagle dynamics/dcs world openbeta/coremods/aircraft/fa-18c/shapes/textures. Drivers errors: 
3.4719	ERROR  	EDCORE		FSDriver: there is no directory c:/program files/eagle dynamics/dcs world openbeta/coremods/aircraft/fa-18c/shapes/textures
3.4719	ERROR  	EDCORE		ZipDriver: Can't open zip archive c:/program files/eagle dynamics/dcs world openbeta/coremods/aircraft/fa-18c/shapes/textures.zip.
3.4900	ERROR  	EDCORE	Can't open file 'c:/program files/eagle dynamics/dcs world openbeta/coremods/aircraft/fa-18c/shapes/fa-18c.lods.ilv' from fs.
3.4900	ERROR  	EDCORE	Can't open file 'c:/program files/eagle dynamics/dcs world openbeta/coremods/aircraft/fa-18c/shapes/fa-18c.lods.ilv' from fs.
3.4900	WARNING	VIEWERCOMMON	file c:/program files/eagle dynamics/dcs world openbeta/coremods/aircraft/fa-18c/shapes/fa-18c.lods.ilv not found
3.4901	TRACE  	EFFECTS	creating ODCSParticleSystem effect
3.4901	ERROR_ONCE	DX11BACKEND	render target 'cockpitDepth' not found
3.4921	TRACE  	lua_loadfile	ModelViewer2::createLua: C:\Users\kolyma\Saved Games\edModelViewer2.openbeta\autoexec.lua
3.4921	TRACE  	lua_loadfile	ModelViewer2::createLua: Config/ModelViewer/autoexec.lua
3.4923	DEBUG  	ModelViewer2::createLua	----------------------------------------------------------------
3.4923	DEBUG  	ModelViewer2::createLua	scan for textures and liveries
3.7548	DEBUG  	ModelViewer2::createLua	----------------------------------------------------------------
4.5440	ERROR  	EDCORE	Can't mount mods/terrains/caucasus/vfstextures/trees.zip. Drivers errors: 
4.5440	ERROR  	EDCORE		FSDriver: there is no directory mods/terrains/caucasus/vfstextures/trees.zip
4.5440	ERROR  	EDCORE		ZipDriver: Can't open zip archive mods/terrains/caucasus/vfstextures/trees.zip.
4.7447	DEBUG  	ModelViewer2::createLua	scan done
4.7447	DEBUG  	ModelViewer2::createLua	----------------------------------------------------------------
4.7450	ERROR  	EDCORE	Can't mount coremods/aircraft/fa-18c/shapes/textures. Drivers errors: 
4.7450	ERROR  	EDCORE		FSDriver: there is no directory coremods/aircraft/fa-18c/shapes/textures
4.7450	ERROR  	EDCORE		ZipDriver: Can't open zip archive coremods/aircraft/fa-18c/shapes/textures.zip.
4.7451	ERROR  	EDCORE	Can't open file 'coremods/aircraft/fa-18c/shapes/fa-18c.lods.ilv' from fs.
4.7451	ERROR  	EDCORE	Can't open file 'coremods/aircraft/fa-18c/shapes/fa-18c.lods.ilv' from fs.
4.7451	WARNING	VIEWERCOMMON	file coremods/aircraft/fa-18c/shapes/fa-18c.lods.ilv not found
4.7451	TRACE  	EFFECTS	creating ODCSParticleSystem effect
4.7533	INFO   	DX11BACKEND	resize to resolution 1201x629
6.1331	INFO   	DX11BACKEND	resize to resolution 1841x666
7.0053	ERROR_ONCE	DX11BACKEND	texture 'MISSING_TEXTURE_COMPARATOR_THIS_IS_NOT_ERROR' not found. Asked from 'VIEWERCOMMON'
7.0072	ERROR_ONCE	DX11BACKEND	texture 'MISSING_TEXTURE_normal_COMPARATOR_THIS_IS_NOT_ERROR' not found. Asked from 'VIEWERCOMMON'
Help!!!???
__________________
Something clever goes here...
Kolyma is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:38 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.