Compare commits
1 Commits
obj
...
test-files
Author | SHA1 | Date | |
---|---|---|---|
8598147214 |
1559
Cargo.lock
generated
1559
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
19
Cargo.toml
19
Cargo.toml
@ -1,28 +1,11 @@
|
||||
[package]
|
||||
name = "map-tool"
|
||||
version = "1.4.0"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
clap = { version = "4.4.2", features = ["derive"] }
|
||||
flate2 = "1.0.27"
|
||||
image = "0.24.7"
|
||||
image_dds = "0.1.1"
|
||||
lazy-regex = "3.1.0"
|
||||
rbx_binary = "0.7.1"
|
||||
rbx_dom_weak = "2.5.0"
|
||||
rbx_reflection_database = "0.2.7"
|
||||
rbx_xml = "0.13.1"
|
||||
vbsp = "0.5.0"
|
||||
vmdl = "0.1.1"
|
||||
vmt-parser = "0.1.1"
|
||||
vpk = "0.2.0"
|
||||
vtf = "0.2.1"
|
||||
|
||||
#[profile.release]
|
||||
#lto = true
|
||||
#strip = true
|
||||
#codegen-units = 1
|
||||
|
28
LICENSE
28
LICENSE
@ -1,23 +1,9 @@
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
MIT License
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
BIN
ScriptFinder.rbxl
Normal file
BIN
ScriptFinder.rbxl
Normal file
Binary file not shown.
126
allowed/0.lua
Normal file
126
allowed/0.lua
Normal file
@ -0,0 +1,126 @@
|
||||
--local Model=game:GetService'InsertService':LoadAsset(1079831188):GetChildren()[1] Model:SetModelCFrame(CFrame.new(0,Model:GetModelSize().y/2,0))
|
||||
--[[ Load ID list
|
||||
local ids={5692157375}
|
||||
local ServerStorage=game:GetService'ServerStorage'
|
||||
local function load(id)
|
||||
local Model=game:GetObjects("rbxassetid://"..id)[1]
|
||||
Model.Parent=workspace
|
||||
Model:MoveTo(Vector3.new(0,Model:GetExtentsSize().y/2,0))
|
||||
wait()
|
||||
Model.Parent=ServerStorage
|
||||
end
|
||||
for i=1,#ids do
|
||||
local succ,err=ypcall(load,ids[i])
|
||||
if not succ then
|
||||
print(ids[i],"error",err)
|
||||
end
|
||||
end
|
||||
--]]
|
||||
--[[ Format map names
|
||||
local c=game:GetService'ServerStorage':GetChildren()
|
||||
for i=1,#c do
|
||||
local le_name=c[i].Name:gsub("%s+","_"):lower()
|
||||
c[i].Name=le_name
|
||||
local DisplayName=c[i]:FindFirstChild("DisplayName",true)
|
||||
if DisplayName and DisplayName.ClassName=="StringValue" then
|
||||
local dn=DisplayName.Value
|
||||
local ndn={}
|
||||
for w in dn:gmatch'%S+' do
|
||||
ndn[#ndn+1]=w:sub(1,1):upper()..w:sub(2)
|
||||
end
|
||||
if table.concat(ndn," ")~=dn then
|
||||
print("Fix name:",le_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
--]]
|
||||
--[[ Duplicate script labeler
|
||||
local IsA=game.IsA
|
||||
|
||||
local ID=0
|
||||
local SourceHash={}
|
||||
local SourceHashCount={}
|
||||
local NameHash={}
|
||||
local IDHash={}
|
||||
|
||||
local c=game:GetService'ServerStorage':GetDescendants()
|
||||
for i=1,#c do
|
||||
local s=c[i]
|
||||
if IsA(s,"LuaSourceContainer") then
|
||||
local src=s.Source
|
||||
NameHash[s]=s.Name
|
||||
local id=SourceHash[src]
|
||||
if id then
|
||||
s.Name="copy "..id
|
||||
SourceHashCount[id]=SourceHashCount[id]+1
|
||||
else
|
||||
ID=ID+1
|
||||
IDHash[ID]=s
|
||||
SourceHash[src]=ID
|
||||
SourceHashCount[ID]=1
|
||||
if src:find'getfenv' or src:find'require' then
|
||||
s.Name="flagged "..ID
|
||||
else
|
||||
s.Name="unique "..ID
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for i=1,ID do
|
||||
local s=IDHash[i]
|
||||
local hc=SourceHashCount[i]
|
||||
s.Name=s.Name..(hc==1 and " (1 copy)" or " ("..hc.." copies)")
|
||||
end
|
||||
_G.NameHash=NameHash
|
||||
--]]
|
||||
--[[ Undo labeler
|
||||
local NameHash=_G.NameHash
|
||||
for s,n in next,NameHash do
|
||||
s.Name=n
|
||||
end
|
||||
--]]
|
||||
local IsA=workspace.IsA
|
||||
local GetChildren=workspace.GetChildren
|
||||
local function rsearch(search,cond1,cond2)
|
||||
local found={}
|
||||
for _,thing in next,GetChildren(search) do
|
||||
if not cond1 or cond1(thing) then
|
||||
found[#found+1]=thing
|
||||
end
|
||||
if not cond2 or cond2(thing) then
|
||||
local nfound=#found
|
||||
local r=rsearch(thing,cond1,cond2)
|
||||
for i=1,#r do
|
||||
found[nfound+i]=r[i]
|
||||
end
|
||||
end
|
||||
end
|
||||
return found
|
||||
end
|
||||
local function cond1(thing)
|
||||
return IsA(thing,"LuaSourceContainer")
|
||||
end
|
||||
local Maps=GetChildren(game:GetService'ServerStorage')
|
||||
for i=1,#Maps do
|
||||
local Map=Maps[i]
|
||||
if Map.ClassName=="Model" then
|
||||
local Scripts=rsearch(Map,cond1)
|
||||
if #Scripts>0 then
|
||||
local ScriptHolder=Instance.new("Model",workspace)
|
||||
ScriptHolder.Name=Map.Name.."("..#Scripts..")"
|
||||
for i=1,#Scripts do
|
||||
local sc=Scripts[i]
|
||||
local scd
|
||||
if sc.ClassName~="ModuleScript" then
|
||||
sc.Disabled=true
|
||||
end
|
||||
local s=sc:Clone()
|
||||
s.Name=sc:GetFullName()
|
||||
s.Parent=ScriptHolder
|
||||
if sc.ClassName~="ModuleScript" then
|
||||
sc.Disabled=scd
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
BIN
bhop_dumb_blocks_5.rbxm
Normal file
BIN
bhop_dumb_blocks_5.rbxm
Normal file
Binary file not shown.
13180
bhop_easyhop.rbxmx
Executable file
13180
bhop_easyhop.rbxmx
Executable file
File diff suppressed because it is too large
Load Diff
126
blocked/0.lua
Normal file
126
blocked/0.lua
Normal file
@ -0,0 +1,126 @@
|
||||
--local Model=game:GetService'InsertService':LoadAsset(1079831188):GetChildren()[1] Model:SetModelCFrame(CFrame.new(0,Model:GetModelSize().y/2,0))
|
||||
--[[ Load ID list
|
||||
local ids={5692157375}
|
||||
local ServerStorage=game:GetService'ServerStorage'
|
||||
local function load(id)
|
||||
local Model=game:GetObjects("rbxassetid://"..id)[1]
|
||||
Model.Parent=workspace
|
||||
Model:MoveTo(Vector3.new(0,Model:GetExtentsSize().y/2,0))
|
||||
wait()
|
||||
Model.Parent=ServerStorage
|
||||
end
|
||||
for i=1,#ids do
|
||||
local succ,err=ypcall(load,ids[i])
|
||||
if not succ then
|
||||
print(ids[i],"error",err)
|
||||
end
|
||||
end
|
||||
--]]
|
||||
--[[ Format map names
|
||||
local c=game:GetService'ServerStorage':GetChildren()
|
||||
for i=1,#c do
|
||||
local le_name=c[i].Name:gsub("%s+","_"):lower()
|
||||
c[i].Name=le_name
|
||||
local DisplayName=c[i]:FindFirstChild("DisplayName",true)
|
||||
if DisplayName and DisplayName.ClassName=="StringValue" then
|
||||
local dn=DisplayName.Value
|
||||
local ndn={}
|
||||
for w in dn:gmatch'%S+' do
|
||||
ndn[#ndn+1]=w:sub(1,1):upper()..w:sub(2)
|
||||
end
|
||||
if table.concat(ndn," ")~=dn then
|
||||
print("Fix name:",le_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
--]]
|
||||
--[[ Duplicate script labeler
|
||||
local IsA=game.IsA
|
||||
|
||||
local ID=0
|
||||
local SourceHash={}
|
||||
local SourceHashCount={}
|
||||
local NameHash={}
|
||||
local IDHash={}
|
||||
|
||||
local c=game:GetService'ServerStorage':GetDescendants()
|
||||
for i=1,#c do
|
||||
local s=c[i]
|
||||
if IsA(s,"LuaSourceContainer") then
|
||||
local src=s.Source
|
||||
NameHash[s]=s.Name
|
||||
local id=SourceHash[src]
|
||||
if id then
|
||||
s.Name="copy "..id
|
||||
SourceHashCount[id]=SourceHashCount[id]+1
|
||||
else
|
||||
ID=ID+1
|
||||
IDHash[ID]=s
|
||||
SourceHash[src]=ID
|
||||
SourceHashCount[ID]=1
|
||||
if src:find'getfenv' or src:find'require' then
|
||||
s.Name="flagged "..ID
|
||||
else
|
||||
s.Name="unique "..ID
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for i=1,ID do
|
||||
local s=IDHash[i]
|
||||
local hc=SourceHashCount[i]
|
||||
s.Name=s.Name..(hc==1 and " (1 copy)" or " ("..hc.." copies)")
|
||||
end
|
||||
_G.NameHash=NameHash
|
||||
--]]
|
||||
--[[ Undo labeler
|
||||
local NameHash=_G.NameHash
|
||||
for s,n in next,NameHash do
|
||||
s.Name=n
|
||||
end
|
||||
--]]
|
||||
local IsA=workspace.IsA
|
||||
local GetChildren=workspace.GetChildren
|
||||
local function rsearch(search,cond1,cond2)
|
||||
local found={}
|
||||
for _,thing in next,GetChildren(search) do
|
||||
if not cond1 or cond1(thing) then
|
||||
found[#found+1]=thing
|
||||
end
|
||||
if not cond2 or cond2(thing) then
|
||||
local nfound=#found
|
||||
local r=rsearch(thing,cond1,cond2)
|
||||
for i=1,#r do
|
||||
found[nfound+i]=r[i]
|
||||
end
|
||||
end
|
||||
end
|
||||
return found
|
||||
end
|
||||
local function cond1(thing)
|
||||
return IsA(thing,"LuaSourceContainer")
|
||||
end
|
||||
local Maps=GetChildren(game:GetService'ServerStorage')
|
||||
for i=1,#Maps do
|
||||
local Map=Maps[i]
|
||||
if Map.ClassName=="Model" then
|
||||
local Scripts=rsearch(Map,cond1)
|
||||
if #Scripts>0 then
|
||||
local ScriptHolder=Instance.new("Model",workspace)
|
||||
ScriptHolder.Name=Map.Name.."("..#Scripts..")"
|
||||
for i=1,#Scripts do
|
||||
local sc=Scripts[i]
|
||||
local scd
|
||||
if sc.ClassName~="ModuleScript" then
|
||||
sc.Disabled=true
|
||||
end
|
||||
local s=sc:Clone()
|
||||
s.Name=sc:GetFullName()
|
||||
s.Parent=ScriptHolder
|
||||
if sc.ClassName~="ModuleScript" then
|
||||
sc.Disabled=scd
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
1338
src/main.rs
1338
src/main.rs
File diff suppressed because it is too large
Load Diff
41
src/obj.rs
41
src/obj.rs
@ -1,41 +0,0 @@
|
||||
|
||||
pub fn generate_indexed_model_list_from_obj(data:obj::ObjData,color:Color4)->Vec<IndexedModel>{
|
||||
let mut unique_vertex_index = std::collections::HashMap::<obj::IndexTuple,u32>::new();
|
||||
return data.objects.iter().map(|object|{
|
||||
unique_vertex_index.clear();
|
||||
let mut unique_vertices = Vec::new();
|
||||
let groups = object.groups.iter().map(|group|{
|
||||
IndexedGroup{
|
||||
texture:None,
|
||||
polys:group.polys.iter().map(|poly|{
|
||||
IndexedPolygon{
|
||||
vertices:poly.0.iter().map(|&tup|{
|
||||
if let Some(&i)=unique_vertex_index.get(&tup){
|
||||
i
|
||||
}else{
|
||||
let i=unique_vertices.len() as u32;
|
||||
unique_vertices.push(IndexedVertex{
|
||||
pos: tup.0 as u32,
|
||||
tex: tup.1.unwrap() as u32,
|
||||
normal: tup.2.unwrap() as u32,
|
||||
color: 0,
|
||||
});
|
||||
unique_vertex_index.insert(tup,i);
|
||||
i
|
||||
}
|
||||
}).collect()
|
||||
}
|
||||
}).collect()
|
||||
}
|
||||
}).collect();
|
||||
IndexedModel{
|
||||
unique_pos: data.position.iter().map(|&v|Planar64Vec3::try_from(v).unwrap()).collect(),
|
||||
unique_tex: data.texture.iter().map(|&v|TextureCoordinate::from_array(v)).collect(),
|
||||
unique_normal: data.normal.iter().map(|&v|Planar64Vec3::try_from(v).unwrap()).collect(),
|
||||
unique_color: vec![color],
|
||||
unique_vertices,
|
||||
groups,
|
||||
instances:Vec::new(),
|
||||
}
|
||||
}).collect()
|
||||
}
|
Reference in New Issue
Block a user