3D objects - scalable inport units

Discuss ideas for new features with other users. To submit feature requests to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Rhoel
Posts: 844
Joined: Fri Feb 25, 2005 8:09 am
Location: Phnom Penh, Cambodia
Contact:

3D objects - scalable inport units

Post by Rhoel »

The 3D import function of Anime Studio is an important feature and when used in conjunction with the z plane, certainly differentiates it from the competition

But there are big problems regarding the function's usability. From tests conducted using .obj files from Maya, Max and Blender. All import at impossibly large sizes. Often this means the .object cannot be seen and substantial fiddling is required if the object is to be seen without distortion: Unfortunately, when AS characters are imported, the scales and proportions are then impossible small.

What would make the use of 3D objects better would be to have some form of unit of scale option on the import side – that is, where a user could preselect the “1 unit” value of the object. For example, Blender opens with a 1 unit cube. Currently if it is imported into AS, the scale is 10 times too big. By selecting scale -0.1, the cube will import at its correct size and scale in the scene.

By having this scalability pre-set, people can build a library of default settings for each other the common software packages.

Once this is possible, building backgrounds and props in 3D will become a practical option, and the creative options of what is commercially possible will jump enormously.

Currently, using the 3D import for sets is just too problematic for commercial series use – that is a pity: - for one film released with a look like Disney's Aladdin, utilising 3D camera moves on 3D sets, would push the sale-ability of Anime Studio substantially.

My company has a department with 20 3DMax architectural animators who build cities for a living – I cannot use their output ... yet.

For us, we have both the capability and a project, and we have access to TV backing. With a fast predictable way to use 3D objects, the output could look stunning.

Rhoel


---------------------------------------
Edit

There should also be an "Orientation" button. I have discovered that objects constructed in the correct XYZ plane in Blemder, import as side view orientation.

Maybe we need to have a preview window with scale setting, and radio buttons of x,y, z.

The more work I do on this, the more I am convinced there is a huge potential here. It just like its drawing teeth without anaesthetic at the moment. It's getting in the way of creativity.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

There's no way to set that scale value on export from the 3D apps?

I know this isn't a good solution... I'm just curious.

I had this trouble with transferring a 3d file to another 3d app. Depending on how the files are written by one application I might have to change the scale on export from one to work with another.

Could the files be scaled down by 10x before export?

-vern
User avatar
Rhoel
Posts: 844
Joined: Fri Feb 25, 2005 8:09 am
Location: Phnom Penh, Cambodia
Contact:

Post by Rhoel »

heyvern wrote: Could the files be scaled down by 10x before export?

-vern
Yes and yes, that is what I am currently doing. But the scale is not native to Blender. Most objects are meshes built by extruding a standard cube, then applying subsurf division and other vertice changes. The problem is the 1 unit Blender cube is still larger than the AS camera.

IF you build a room set with 1000-2000 polygons, the scale is then 10,000:1 or more.

THe other problem is the orinetation. I am finding that objects are coming in 90' out on one or two axis. It's fixable but if you are doing volume series work (as I am trying to do) the workload is horrendous. Slowly I am building up a database of "fixes" but the real problem lies in the AS configuration.

Maybe its scriptable.

I am probably about 2 months away from being able to publish data ... just when you think you have got something right, something else crops up. THen its a case of figuring out if this is a Blender problem or a AS problem.

Bottom line is this facility has tremendous potential, and the early tests are very promising. Doing a When the Wind Blows type project is very do-able ... all the controls are there.

It's just very clunky at the moment.

Rhoel
User avatar
Rai López
Posts: 2289
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

...HI! Not sure if you are looknig for this but, just in case, I modified in the past one of the Rotate X/Y/Z menu scripts to get 3D models can be scaled directly in Moho, I remember that it was one of my first script hackings so maybe it would require a revision... I remember too that it helped to me in the past and I even wanted to make it like a Tool instead Menu script but I avandoned the idea when I decided don't work with 3D in Moho never more, although I think that it would be easy to do now and much more confortable to work with it, hmmm... Well, here is the menu script, paste the code into a text file and name it "RL_scale3D_XYZ.lua", the put it with the other 3D Menu scripts, you know... and sorry to all in advance to put it in this way but it's the more quick way and I have no time now...

Code: Select all

-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "RL_Scale3D_XYZ"

-- **************************************************
-- General information about this script
-- **************************************************

RL_Scale3D_XYZ = {}

function RL_Scale3D_XYZ:Name()
	return "Scale 3D XYZ"
end

function RL_Scale3D_XYZ:Version()
	return "5.0"
end

function RL_Scale3D_XYZ:Description()
	return "Scales a 3D model around his three axis."
end

function RL_Scale3D_XYZ:Creator()
	return "Lost Marble modified by R.e.M"
end

function RL_Scale3D_XYZ:UILabel()
	return("Scale XYZ...")
end

-- **************************************************
-- Recurring values
-- **************************************************

RL_Scale3D_XYZ.xyzscale = 0.5

-- **************************************************
-- Scale 3D XYZ dialog
-- **************************************************

local RL_Scale3D_XYZDialog = {}

function RL_Scale3D_XYZDialog:new(moho)
	local d = LM.GUI.SimpleDialog("XYZ Scalation", RL_Scale3D_XYZDialog)
	local l = d:GetLayout()

	d.moho = moho

	l:PushH()
		l:PushV()
			l:AddChild(LM.GUI.StaticText("Scale XYZ"), LM.GUI.ALIGN_LEFT)
		l:Pop()
		l:PushV()
			d.xyzscale = LM.GUI.TextControl(0, "0.0000", 0, LM.GUI.FIELD_UFLOAT)
			l:AddChild(d.xyzscale)
		l:Pop()
	l:Pop()

	return d
end

function RL_Scale3D_XYZDialog:UpdateWidgets()
	self.xyzscale:SetValue(RL_Scale3D_XYZ.xyzscale)
end

function RL_Scale3D_XYZDialog:OnValidate()
	local b = true
	if (not self:Validate(self.xyzscale, 0.0001, 100)) then
		b = false
	end
	return b
end

function RL_Scale3D_XYZDialog:OnOK()
	RL_Scale3D_XYZ.xyzscale = self.xyzscale:FloatValue()
end

-- **************************************************
-- The guts of this script
-- **************************************************

function RL_Scale3D_XYZ:IsEnabled(moho)
	if (moho.layer:LayerType() ~= MOHO.LT_3D) then
		return false
	end
	if (moho.layer:CurrentAction() ~= "") then
		return false -- creating new objects in the middle of an action can lead to unexpected results
	end
	return true
end

function RL_Scale3D_XYZ:Run(moho)
	local mesh = moho:Mesh3D()
	if (mesh == nil) then
		return
	end

	local dlog = RL_Scale3D_XYZDialog:new(moho)
	if (dlog:DoModal() == LM.GUI.MSG_CANCEL) then
		return
	end

	moho.document:PrepUndo(moho.layer)
	moho.document:SetDirty()

	local vec = LM.Vector3:new_local()

	for i = 0, mesh:CountPoints() - 1 do
		local v = mesh:Point(i)
		mesh:ScaleToRadius(self.xyzscale)
	end

	

	-- Because we modified the points directly, this mesh shouldn't be re-loaded from an external file.
	-- This can be prevented by telling the layer that there is no external file.
	local layer = moho:LayerAs3D(moho.layer)
	layer:SetSourceMesh("")
end
Well, I hope this helps... And BTW/JIC, take into account that your 3D model will become internal after apply the scale, as you can read in that last lines of the script, BYE!
...
User avatar
Rhoel
Posts: 844
Joined: Fri Feb 25, 2005 8:09 am
Location: Phnom Penh, Cambodia
Contact:

Re: 3D objects - scalable inport units

Post by Rhoel »

Rhoel wrote:Maybe we need to have a preview window with scale setting, and radio buttons of x,y, z.
The current scripts/3d.suto-scale work well and could be the basis of a new import system.

The problem is auto-scale reduces the size of the object to an unknown scale. If you are importing several items, then if each item autoscales, the relative sizes of the objects are lost.

IF there is a preview window, then all the objects can be scales and rotated uniformly.

Rhoel
Post Reply