[Closed] DotNet Character Selection Framework
Hello,
I realise it’s been a while since I posted, hopefully the reasons will become clear as I will try to write a few articles explaining what I have been researching.
This week’s post is detailing a dotnet XML based character selection generator. It’s all dotnet and uses serialization to store the entire layout to XML. All of this allows an artist to generate a rig selection dialog without writing a single line of code.
check it out on http://lonerobot.net
Pete,
That’s really really nice!
Now it’s just waiting for you to get some custom sliders in and find a way to hook them to a max ik/fk blend for example
I love how you’re pushing it. Really great to see you and for example Paul share these ideas and insights,
Thanks,
-Johan
P.s. really too bad you can’t come to EUE this year!
Hi Johan,
How are you? Thanks for your comments, you are welcome!
Ack Sliders too eh? there’s no pleasing some people
I’m sorry about that, I did everything I could to see if I could come along, but this year has just been mental. I can’t belive it’s June already. I’d love to collaborate next year, if the offer was still open.
PRO stuff, Pete !
Can you change properties in mass ? (eg. select three buttons and change their colors)
…The obvious approach (in terms of linking the dotnet framework to 3dsMax objects) was binding controls to the names of scene nodes. Okay, maybe scene node names might not be the most robust of solutions but it is fine for this sort of thing but if someone starts renaming rigs just for fun, youre going to be screwed on a bigger level than just the selection tools.
Why not storing the picked node by an UserPropBuffer rather then its name ?
setuserPropBuffer someNode someDef
get_UPB = getUserPropBuffer characterControls
if (get_UPB == someDef)
then
(
selectMore filteredNode
format "node= % | getUserPropBuffer= %
" filteredNode.name get_UPB
) -- end if
keep going =)
Sooooooo good :drool:
I think this would make a lot of people very very happy, including myself
Guess what we have been working on at PEN… you beat us to it Pete, nice work.
Hey Pete great stuff as usual!
In watching your demo video I was thinking that it would make it even faster to be able to just select all the controls you want in max and press a button that would then create each selection control thingy in your UI, colour them according to their wirecolor and calculate their position based on their position in the front view. Actually it would probably be better to calculate the positions using the same camera view as was used to render the background image. Just a thought…
Hi all,
thanks for the feedback!
joel – that is a great idea, my thoughts originaly were that once you had built a library of templates you would have a few options to build the control layout faster based on them. But an automated placement from selection would be a great addition. I think that there was something posted recently about converting object world space to screen coordinates? any suggestions welcome!
The IDE still needs a bit of work to get it as robust as possible but it is getting there!
Keep having a nasty feeling that i need to learn WPF… 😮
Once you do, you’ll never look back. I’ve been doing a lot of work on this front lately and wish now that I had jumped in a lot sooner. I’ve been thinking about writing something up on my findings, starting with how to host a WPF control inside of Max. Maybe now is the time.
That was awesome!! Looks like it turned out rock solid!
What do you think of an addRange method so you don’t have to assign a node to a control one by one? Did you have to script yourself the re-sizable behavior on a control or is that a magic property I missed?
I was babbling about a runtime design surface a few months ago to substitute the maxscript visual editor It seems you’ve figured it out and even went further! This seems to be an excelent tool.
Congrats Pete!
for this purpose this should do the trick:
objs = selection as array
cam = $Camera01
cam.fovType = 2
theta = cam.fov / 2
maxX = tan theta
minX = -maxX
theta = cam.curFov / 2
maxY = tan theta
minY = -maxY
posArr = for o in objs collect o.pos * inverse cam.transform
finalPoints = #()
for i = 1 to posArr.count do
(
p = posArr[i]
-- divde through by z value to set the depth to 1 unit
p /= p.z
-- subtract the minX/Y to make the range 0 to whatever instead of -whatever to whatever
p.x -= minX
p.y -= minY
-- divide my (maxX/Y * 2) making the range 0 to 1
p.x /= maxX * 2
p.y /= maxY * 2
-- flip the y axis for use in .NET
p.y = 1 - p.y
-- append to array
append finalPoints [p.x,p.y] -- (dotnetobject "System.Drawing.Point" p.x p.y)
)
there are a few requirements that the above code assumes are met such as using a standard max cam with orthographic projection and that none of the selected objects are outside the camera’s fov. results in an array of 0-1 point2s but could easily be adapted to return .NET Points and taking the wirecolor and object names along for the ride is pretty straight forward too.
Keep having a nasty feeling that i need to learn WPF…
me too, well, not ‘need’ to learn but apparently it’s got some cool stuff, and i like cool stuff