Notifications
Clear all

[Closed] dropdownlist for morph targets

Hey folks, this code should make sense with the comments I’ve put.

rollout test "Select Morph Target"
(	
	--Create filter for selecting an object with a morpher modifier
	fn morphFilter obj = classOf obj.modifiers[1] == Morpher
	--Pick button for object
	pickbutton pickMesh "Select Obj With Morphs" width:140 height:40 filter:morphFilter
	--List for morph slots to be filled
	dropdownlist meshMorphs items:#() enabled:false
	
	--Picked
	on pickMesh picked obj do
	(
		--Ensure that nothing interrupted the picking
		if obj != undefined then
		(
			meshMorphs.enabled = true
			for i = 1 to 100 do
			(
				if WM3_MC_HasData obj.Morpher i == true then
				(
					append meshMorphs.items i
				)
			)
		)
	)
)
createDialog test 175 150

The problem I’m having is that when I select my mesh with a morph target it’s not adding them/updating the dropdownlist.

I’ve been looking at this for so long kinda need a fresh pair of eyes. Thanks in advance.

2 Replies

you can’t directly add/insert an item to dropdownlist items, or delete an item. you have to assign new item list to items property to make a list updated:


 -- not working:
 append <dropdownlist>.items item
 -- working 
 <dropdownlist>.items = append <dropdownlist>.items item
 

probably there is some sort of bug in dropdownlist update. after many years of its existence the bug became a feature

Ah! Cheers very much!