Home Coding, Scripting, Shaders

[3Dsmax] Autorig Scale...

polycounter lvl 7
Offline / Send Message
dg3duy polycounter lvl 7
I made a system to create lips and jaws based on Paul Neale, the whole system is created based on initial points.
The question is how to create the starting points and then manipulate them all together and transform them into smaller or bigger ones as if they were a single group and based on that size I modify generate the final rig.
Imagine I have a very small gnome and a giant to use the rig.
The solution I found is that after generating the rig I select everything and using scale I adjust it to the size I want.

According to Paul neale:

When you store the positions for the nodes that you are going to create you need to normalize, or maybe better to say scale them first.
What that means is makeing sure that all values are 1 or less.
Then you can just multiply the values by the size that you want on creation.

Anyone who can give me an example?, Paul seems to be in other matters and it is not possible to continue with this topic.

It's just a picture of what I want to do for my automatic system. It's by way of example.

 As an example here I show you what I'm looking to do, 
is not of my authorship is just an example of what I'm looking for
Example image...



Replies

  • monster
    Offline / Send Message
    monster polycounter
    I'm sorry I don't understand your issue. The gif looks like you have it working.
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 7
    monster said:
    I'm sorry I don't understand your issue. The gif looks like you have it working.
    As an example here I show you what I'm looking to do, 
    is not of my authorship is just an example of what I'm looking for.
    The author of this autorig system is https://www.superrune.com/index.php

    When I placed the image I was not clear, it is just an example of what I am looking to do.

  • monster
    Offline / Send Message
    monster polycounter
    Ha! Sorry, I was so confused because you said you were trying to do exactly what you were showing.



    I'm having trouble understanding Paule's quote there too. But basically you just multiply the starting position by the spinner value. It get's a little more complex when you have to handle undo and canceling when dragging.

    All this code for that one little spinner.
    rollout rolSizer "Sizer"
    (
    	spinner spnSizer "Size:" range:[0.1,100.0,1.0]
    		
    	local objectPosArray = #()
    	
    	--FUNCTION TO MULTIPLY INITIAL POSITION BY THE SPINNER VALUE
    	fn setPosition val =
    	(
    		for i = 1 to selection.count do
    		(
    			selection[i].pos = objectPosArray[i] * val
    		)
    	)
    
    	--GET ALL THE INITIAL POSITIONS WHEN A USER STARTS A SPINNER OPERATION
    	on spnSizer buttondown do
    	(
    		objectPosArray = #()
    		
    		for i = 1 to selection.count do
    		(
    			objectPosArray[i] = selection[i].pos
    		)
    		
    		flagForeground selection true
    	)
    	
    	--WHEN DRAGING PREVIEW THE CHANGE WITH UNDO OFF
    	--TO AVOID CREATING A TRAIL OF UNDOS
    	on spnSizer changed val do with undo off setPosition val
    
    	--RESET THE POSITIONS WHEN DRAG IS DONE
    	on spnSizer buttonUp isCanceled do
    	(
    		with undo off
    		(
    			for i = 1 to selection.count do
    			(
    				selection[i].pos = objectPosArray[i]
    			)
    		)
    		
    		flagForeground selection false
    	)
    	
    	--WHEN THE USER RELEASES THE SPINNER COMMIT THE CHANGE WITH AN UNDO
    	--RESET THE SPINNER TO 1
    	on spnSizer entered isSpin isCanceled do
    	(
    		if not isCanceled then
    		(
    			with undo "Set Size" on 
    			(
    				setPosition spnSizer.value
    			)
    		)
    		
    		spnSizer.value = 1.0
    	)
    )
    
    createDialog rolSizer

  • monster
    Offline / Send Message
    monster polycounter
    BTW, your example lets you set the height and not just multiply the position. It's the same idea. In that case you would store the initial position as a custom attribute in the helper objects. And your spinner starting value is the heights of your helper skeleton.
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 7
    monster said:
    BTW, your example lets you set the height and not just multiply the position. It's the same idea. In that case you would store the initial position as a custom attribute in the helper objects. And your spinner starting value is the heights of your helper skeleton.
    That's a very good example you set, it's going to come in handy.
    I was able to solve it "by hand" if after using scale on the objects I apply resetxform. For now I'm not using a slider, here your example is going to be very good for me to apply it, thanks.
Sign In or Register to comment.