Skocz do zawartości
View in the app

A better way to browse. Learn more.

Max3D.pl

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Napisano

Witam

 

Ostatnio bawię się w riggowanie postaci. Szukałem skryptu, który by mi przenosił wartości verteksów z jednej postaci na drugą (modyfikator Skin). Jako iż nie mam smykałki do skryptowania w końcu udało mi się coś znaleźć.

Jednakże kod skryptu zamieszczony na zagranicznym forum działa tylko z jednym zaznaczonym verteksem. Przez co nawet mając zaznaczoną ich większą ilość skrypt kopiuje i wkleja informacje o punkcie tylko dla jednego verteksa. Chciałbym, żeby skrypt właśnie ogarniał większą liczbę verteksów jakie zaznaczę.

 

Może ktoś z was by popatrzył na kod i udało mu się zmienić coś w nim by tak działał. Próbowałem wiele by przenieść riggowanie z jednej postaci na drugą m.in. Skin Warp.

 

Kod skryptu.

 

global BoneArray
global BoneNArray
global WeightArray
global PasteArray


-- Pass the vert id to extract all the weights to arrays
fn CopyWeight theVert =
(
-- Empty the arrays
BoneArray = #()
BoneNArray =#()
WeightArray = #()

theSkin = $.modifiers[#skin]
BNumber = skinOps.getVertexWeightCount theSkin theVert
BN = BNumber as string

for i = 1 to BNumber do
(
boneID = skinOps.getVertexWeightBoneId theSkin theVert i
boneName = skinOps.GetBoneName theSkin boneID 0
boneWeight = skinOps.getVertexWeight theSkin theVert i

append BoneArray boneID
append BoneNArray boneName
append WeightArray boneWeight
)
)


fn PasteWeight pVert =
(
disableSceneredraw()

theSkin = $.modifiers[#skin]

print "these are the stored arrays for copying"
print pastearray
print weightarray

skinOps.ReplaceVertexWeights theskin pVert pasteArray WeightArray


enableSceneredraw()
redrawViews()
)


rollout blank "Single Skin Copy and Paste"
(
label lbl1 "Select vert, press copy, then select vert and press paste." pos:[9,8] width:197 height:48
button ButtonC "Copy" pos:[18,40] width:75 height:24
button ButtonP "Paste" pos:[110,40] width:75 height:24


on ButtonP pressed do
(
theSkin = selection[1].modifiers[#Skin]
n = skinOps.getNumberVertices theSkin

selVert=0

for i = 1 to n do
(
if (skinops.isVertexSelected theSkin i == 1) then
(
selVert=i
)
)

-- Call the copy function
PasteWeight selVert
)




on ButtonC pressed do
(
-- Get vert id
theSkin = selection[1].modifiers[#Skin]
n = skinOps.getNumberVertices theSkin

selVert=0

for i = 1 to n do
(
if (skinops.isVertexSelected theSkin i == 1) then
(
selVert=i
)
)

-- Call the copy function
CopyWeight selVert

-- We now have 3 arrays - bone id, bone name, and bone weight.
-- some of the bones might need to be mirrored so for each bone, find the possible mirror
n = BoneArray.count
pastearray = bonearray

)
)

-- Create floater
theNewFloater = newRolloutFloater "Rollout title" 220 100

-- Add the rollout section
addRollout blank theNewFloater

Edytowane przez Victor_V

  • Wyświetleń 1,3k
  • Created
  • Ostatniej odpowiedzi

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Powiadomienie o plikach cookie

Wykorzystujemy cookies. Przeczytaj więcej Polityka prywatności

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.