removed texture renaming (too errorprone)

This commit is contained in:
Leon van Kammen 2025-11-28 20:10:23 +01:00
parent 916f82448b
commit 919a9461aa
4 changed files with 18 additions and 17 deletions

View file

@ -52,14 +52,8 @@ begin
# Iterate through the images array # Iterate through the images array
gltf['images'].each_with_index do |img, i| gltf['images'].each_with_index do |img, i|
name = img['name'] new_filename = "#{dir}/#{filenameWithoutExt}_img#{i}.png"
next unless name && !name.empty?
old_filename = "#{dir}/.xrforge/#{filenameWithoutExt}_img#{i}.png" old_filename = "#{dir}/.xrforge/#{filenameWithoutExt}_img#{i}.png"
new_filename = "#{dir}/#{name}.png"
puts old_filename
puts new_filename
# move file to modeldirectory (but dont overwrite if user overwrite it) # move file to modeldirectory (but dont overwrite if user overwrite it)
if File.exist?(old_filename) && !File.exist?(new_filename) if File.exist?(old_filename) && !File.exist?(new_filename)

View file

@ -48,16 +48,14 @@ begin
# Iterate through the images array # Iterate through the images array
gltf['images'].each_with_index do |img, i| gltf['images'].each_with_index do |img, i|
name = img['name'] new_filename = ""
next unless name && !name.empty? new_filename = "#{dir}/#{filenameWithoutExt}_img#{i}.png"
new_filename = "#{dir}/#{name}.png"
# move file to modeldirectory (but dont overwrite if user overwrite it) # move file to modeldirectory (but dont overwrite if user overwrite it)
XRForge.log("🤔 checking #{new_filename}",logfile) XRForge.log("🤔 checking #{new_filename}",logfile)
if File.exist?(new_filename) if File.exist?(new_filename)
XRForge.log("✅ importing #{new_filename} -> #{resource['path']}",logfile) XRForge.log("✅ importing #{new_filename} -> #{resource['path']}",logfile)
img['uri'] = "#{name}.png" img['uri'] = new_filename # NOTE: editing uri will cause assimp to drop image['name'] when exporting :/
update = true update = true
end end
end end

View file

@ -71,7 +71,7 @@ begin
if data['description'] && data['description'].match(JMLHeuristic) if data['description'] && data['description'].match(JMLHeuristic)
if data['description'].match(/autogenerate=['"]false['"]/) if data['description'].match(/autogenerate=['"]false['"]/)
XRForge.log("✅ autogenerate='false' found in JML..keeping this JML") XRForge.log("✅ autogenerate='false' found in JML..keeping this JML",logfile)
autogenerate = false autogenerate = false
jmlMatch = data['description'].match(JMLHeuristic) jmlMatch = data['description'].match(JMLHeuristic)
jml = jmlMatch[0] jml = jmlMatch[0]
@ -84,7 +84,7 @@ begin
<assetobject id="experience" src="#{federate_drive_host}/#{model_file.gsub("#","%23")}"/> <assetobject id="experience" src="#{federate_drive_host}/#{model_file.gsub("#","%23")}"/>
</Assets> </Assets>
<Room autogenerate="true" #{ data['keywords'].include?('singleuser') ? "private='true'" : ""}> <Room autogenerate="true" #{ data['keywords'].include?('singleuser') ? "private='true'" : ""}>
<object pos="0 0 0" collision_id="experience" id="experience" /> <object pos="0 0 5" rotation="-180 0 180" lighting="false" collision_id="experience" id="experience" />
</Room> </Room>
</FireBoxRoom> </FireBoxRoom>
<!-- archive.org hints --> <!-- archive.org hints -->
@ -117,6 +117,13 @@ begin
<janus-viewer> <janus-viewer>
#{jml} #{jml}
</janus-viewer> </janus-viewer>
<!-- map query args as attributes -->
<script>
args = new URLSearchParams(document.location.search)
for( const [k,v] of args.entries()) document.querySelector("Room").setAttribute(k,v)
</script>
<!-- archive.org hints --> <!-- archive.org hints -->
<a href="#{federate_drive_host}/#{model_file.gsub("#","%23")}"></a> <a href="#{federate_drive_host}/#{model_file.gsub("#","%23")}"></a>
</body> </body>

View file

@ -82,7 +82,7 @@
<% end %> <% end %>
<% if ENV['FEDERATE_DRIVE_HOST'].present? %> <% if ENV['FEDERATE_DRIVE_HOST'].present? %>
<% if @model.tags.where(name: "janusxr" ).any? %> <% if @model.tags.where(name: "xrfragments" ).any? %>
<tr> <tr>
<td> <td>
<img src="/assets/janusxr.svg" style="width: 16px; transform: translate(0px,-2px);"> <img src="/assets/janusxr.svg" style="width: 16px; transform: translate(0px,-2px);">
@ -123,7 +123,7 @@
<% end %> <% end %>
<% if @model.tags.where(name: "mml" ).any? %> <% if @model.tags.where(name: "xrfragments" ).any? %>
<tr> <tr>
<td> <td>
<i class="bi bi-eye-fill" role="img"></i> <i class="bi bi-eye-fill" role="img"></i>
@ -187,6 +187,7 @@
</div> </div>
</td> </td>
</tr> </tr>
<!--
<tr> <tr>
<td> <td>
<i class="bi bi-filetype-json" role="img"></i> <i class="bi bi-filetype-json" role="img"></i>
@ -205,6 +206,7 @@
</div> </div>
</td> </td>
</tr> </tr>
-->
<% end %> <% end %>
<% if @model.collection %> <% if @model.collection %>