Symulator EU07 (i nie tylko) > Na warsztacie
Skrypty do 3ds max
szczawik:
Nie mam czasowo dostępu do plików, ale zapewne musi być we wszystkich wspomnianych przez Ciebie miejscach. Zapewne są obydwie formy użyte, w zależności od miejsca.
Benek:
Ci co tak spamują w Inne Niekolejowe, może tutaj coś pokażecie:
To jest ten fragment w zmieniacz.ms. Widocznie skrypt zmienia Tex1, Tex2, i inne, ale nie zmienia isolated. Hm, ale z drugiej strony... hm.
--- Kod: ---rollout findObjProp "Zmiana wg Wlasciwosci obiektu (Tex1, Tex2, ExportString, trakcja)"
(
edittext nName "Nazwa: " text:"Rail_screw_used1"
edittext nZmien "Zmien na: " text:"Rail_screw_used1.dds"
radiobuttons rb1 labels:#("cale wyrazy", "tekst(np. .tga, .dds)", "jesli znajdzie tekst to wymieni na calosc(np. Rail na Rail_screw_used1.dds)") default:1
button btn2 "Zmien"
label lb2 "Zmieniono 0 obiektow" align:#left
function ZmienNazweWObjectProp=
(
licznik1 = 0
licznik2 = 0
if(rb1.state == 1) then
(
for node in objects do
(
prop1 = (getUserProp node "ExportString")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "ExportString" nZmien.text
licznik1 +=1
)
if (SuperClassOf node == shape) then
(
prop1 = (getUserProp node "Tex1")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Tex1" nZmien.text
licznik1 +=1
)
prop1 = (getUserProp node "Tex2")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Tex2" nZmien.text
licznik1 +=1
)
for nrslupa=1 to 20 do
(
prop1 = (getUserProp node (nrslupa as string))
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node (nrslupa as string) nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
)
)
if(rb1.state == 3) then
(
for node in objects do
(
prop1 = (getUserProp node "ExportString")
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node "ExportString" nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
if (SuperClassOf node == shape) then
(
prop1 = (getUserProp node "Tex1")
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node "Tex1" nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
prop1 = (getUserProp node "Tex2")
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node "Tex2" nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
for nrslupa= 1 to 20 do
(
prop1 = (getUserProp node (nrslupa as string))
if (prop1 != undefined) then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
setUserProp node (nrslupa as string) nZmien.text
licznik1 +=1
)
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
)
)
)
if(rb1.state == 2) then
(
for node in objects do
(
prop1 = (getUserProp node "ExportString")
if ((prop1 as string) != "undefined") then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node "ExportString" (text1 + nZmien.text)
else setUserProp node "ExportString" (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
if (SuperClassOf node == shape) then
(
--Tex1
prop1 = (getUserProp node "Tex1")
if ((prop1 as string) != "undefined") then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node "Tex1" (text1 + nZmien.text)
else setUserProp node "Tex1" (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
--Tex2
prop1 = (getUserProp node "Tex2")
if ((prop1 as string) != "undefined") then
(
pos1 = FindString prop1 nName.text
if(pos1 as string) != "undefined" then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node "Tex2" (text1 + nZmien.text)
else setUserProp node "Tex2" (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
for nrslupa=1 to 20 do
(
prop1 = (getUserProp node (nrslupa as string))
if ((prop1 as string) != "undefined") then
(
pos1 = undefined
pos1 = FindString prop1 nName.text
if pos1 != undefined then
(
text1 = SubString prop1 1 (pos1-1)
text2 = SubString prop1 (pos1+nName.text.count ) -1
if text2 == "" then setUserProp node (nrslupa as string) (text1 + nZmien.text)
else setUserProp node (nrslupa as string) (text1 + nZmien.text + text2)
licznik1 +=1
lb2.text = "Zmieniono " + (licznik1 as string) + " obiektow"
)
)
)
)
)
)
)
on btn2 pressed do
(
lb2.text = "Zmieniono 0 obiektow"
ZmienNazweWObjectProp()
)
)
addRollout findObjProp changeProp
--- Koniec kodu ---
dejotzbych:
Ja spróbowałbym tak:
Zaraz po tym:
--- Kod: ---if (SuperClassOf node == shape) then
(
--- Koniec kodu ---
dołóż coś takiego:
--- Kod: --- prop1 = (getUserProp node "Isolated")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Isolated" nZmien.text
licznik1 +=1
)
--- Koniec kodu ---
Powinno być coś takiego:
--- Kod: ---if (SuperClassOf node == shape) then
(
prop1 = (getUserProp node "Isolated")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Isolated" nZmien.text
licznik1 +=1
)
prop1 = (getUserProp node "Tex1")
if (prop1 != "undefined" and prop1 == nName.text) then
(
setUserProp node "Tex1" nZmien.text
licznik1 +=1
)
....
itd.
--- Koniec kodu ---
z tym Isolated to małe/wielkie literki zrób tak, jak potrzeba
Zaznaczam, że nie sprawdzałem i nie mam pojęcia, czy będzie działać.
Benek:
Wiem o co Ci chodzi, ale to też nie pójdzie. Wiesz dlaczego? Teraz np. też nie mogę zmienić czegoś takiego:
--- Kod: ---Type = normal
Radius1 = 0
Roll1 = 0.0
Roll2 = 0.0
MaxDist = 1000
MinDist = 0
TrackWidth = 1.435
Friction = 0.25
SoundDist = 25.0
Quality = 20
DamageFlag = 0
Environment = Flat
Visibility = vis
Tex1 = rail_screw_used1
TexLength = 4
Tex2 = tpd-oil3
TexPar1 = 0.2
TexPar2 = 0.5
TexPar3 = 1.1
Event2 = wjazd
Length = 98.6199
--- Koniec kodu ---
na coś takiego:
--- Kod: ---Type = normal
Radius1 = 0
Roll1 = 0.0
Roll2 = 0.0
MaxDist = 1000
MinDist = 0
TrackWidth = 1.435
Friction = 0.25
SoundDist = 25.0
Quality = 20
DamageFlag = 0
Environment = Flat
Visibility = vis
Tex1 = rail_screw_used1
TexLength = 4
Tex2 = tpd-oil3
TexPar1 = 0.2
TexPar2 = 0.5
TexPar3 = 1.1
event2 = wjazd <-----
Length = 98.6199
--- Koniec kodu ---
dejotzbych:
Aaaa, to Ty chcesz hurtowo zmienić nazwy właściwości?
Proteza (spodobało mi się to określenie):
Niech skrypt wyszukuje nazwy właściwości, która zaczyna się małą literką, prop1 = (getUserProp node "isolated"), a dodaje pisane wielką: setUserProp node "Isolated" nZmien.text
Trzeba pewnie gdzieś po drodze wstawić jakąś komendę usuwającą właściwość z małą literką. Spróbuj zerknąć w helpa od maxscriptu za czymś w stylu "delUserProp". Nie mam niestety maxa przy sobie.
Nawigacja
[#] Następna strona
Idź do wersji pełnej