View Full Version : Here is what I have been working on slowely.
So far it is working well. A pile more features to add into it now. http://penproductions.ca/temp/LHM_screenData04.jpg
|
|
VVaari
11-05-2009, 08:02 AM
Looks nice and useful! Maybe it could also display objects user defined properties (whole buffer or properties user want to see). Is this commercial project or just doing it for fun? :)
It is a commercial project and will not be released. I might do something based on this. There is more that is in there but really can't be shown without showing other assets from the project and I can't do that.
It will also be showing trajectories, in a way. It will show the XYZ distances and the point to point distance for each position key. I'm also looking for a way to show the angles of objects but need to work out just how I want to calculate those.
MerlinEl
11-06-2009, 07:19 PM
Hi Paul
very nice arrows and popups :thumbsup:
Did you made all this stuff via dotNet ?
It is all a dotNet form that is parented to Max (Thanks to all that helped with that) and I'm drawing into using the graphics engine. It is quite fast so far, wait till you see all the new features that it is getting. I will post a screen grab of that when I'm done.
MerlinEl
11-09-2009, 01:35 PM
Here is what I have been working on (slowly*100 000 000)
I cant use some drawing function like gw.Polygon :hmm: (to make these nice arrows)
because in Direct3D is not works.
http://img264.imageshack.us/img264/1086/manip11.jpg
All made by gw with help of my friends in cg :-) (thanks to all for patience)
some day will be finished...
Looks good. I dropped GW drawing because of the mixed results that I was getting. In some cases I wasn't getting any results at all. If you don't want to use dotNet then using manipulators is probably a better idea.
I'm heavy on learning manipulators too now, but I see some erratic behaviour with text in manipulators too, on my home workstation it draws ok, but on my workstation most times it doesn't display at all... lucky for me it's not a big deal, since I'm using them as helper objects, but it is kind of annoying.
*edit* I have to take that back, I was doing something wrong and text seems to draw ok again.
-Johan
MerlinEl
11-10-2009, 03:11 PM
Looks good. I dropped GW drawing because of the mixed results that I was getting. In some cases I wasn't getting any results at all. If you don't want to use dotNet then using manipulators is probably a better idea.
I would like to use dotnet , but first I must learn some stuff about it.
Starting with the basic drawing method ,
how to calculate position on screen and other thinks ;)
About manipulators ... ?
I don't know how to run them right without using max command panel :shrug:
Polimeno
11-10-2009, 04:54 PM
I will post a screen grab of that when I'm done.
would be lovely, i canīt wait to see this in action.
tell me Paul:
what do you mean by 'graphic engine ' ? is it some kind of .NETīs property ?
could you please describe what are the basics concepts of '.NET parented to Max' ?
seeya,
nice job
denisT
11-10-2009, 05:23 PM
I would like to use dotnet , but first I must learn some stuff about it.
Starting with the basic drawing method ,
how to calculate position on screen and other thinks ;)
About manipulators ... ?
I don't know how to run them right without using max command panel :shrug:
what's the problem to create?
plugin simpleManipulator resize3D_Manipulator
name:"3D Resizer"
classID:#(0x2feb1967, 0x173d058a)
--invisible:on
category:"Manipulators"
(
local rd = colorMan.getColor #manipulatorsSelected
local yc = [1,1,0]
local bc = [0,1,1]
local ac = [0,0.8,0.8]
local ic = [0,0.7,0.7]
local mpoint, mpos
parameters main rollout:paramRollout
(
xPos type:#float animatable:off ui:ui_xPos default:0.0
yPos type:#float animatable:off ui:ui_yPos default:0.0
width type:#float animatable:off ui:ui_width default:0.0
length type:#float animatable:off ui:ui_length default:0.0
height type:#float animatable:off ui:ui_height default:0.0
)
rollout paramRollout "Target Manipulator"
(
group "Parameters: "
(
spinner ui_xPos "X Position: " fieldwidth:56 range:[-1e9, 1e9, 0.0] type:#worldunits align:#right offset:[0,0]
spinner ui_yPos "Y Position: " fieldwidth:56 range:[-1e9, 1e9, 0.0] type:#worldunits align:#right offset:[0,-2]
spinner ui_width "Width: " fieldwidth:56 range:[-1e9, 1e9, 0.0] type:#worldunits align:#right offset:[0,0]
spinner ui_length "Length: " fieldwidth:56 range:[-1e9, 1e9, 0.0] type:#worldunits align:#right offset:[0,-2]
spinner ui_height "Height: " fieldwidth:56 range:[-1e9, 1e9, 0.0] type:#worldunits align:#right offset:[0,-2] enabled:off
)
)
on canManipulate target return (iskindof target resize3D_Manipulator)
tool create
(
local pos
on mousePoint click do case click of
(
1:
(
pos = nodeTM.translation = gridPoint
)
2: #stop
)
on mouseMove click do case click of
(
2:
(
this.width = gridPoint.x - pos.x
this.length = gridPoint.y - pos.y
)
)
)
on updateGizmos do
(
local cc = if (target != undefined) then
(
this.xPos = target.xPos
this.yPos = target.yPos
this.width = target.width
this.length = target.length
this.height = target.height
ac
)
else ic
local pos = [this.xPos,this.yPos,0]
local size = [this.width,this.length,0]
local tooltip = ""
this.clearGizmos()
local f = (gizmoUseScreenSpace + gizmoActiveViewportOnly)
giz = manip.makeGizmoShape()
giz.startNewLine()
giz.addPoint pos
giz.addPoint (pos + [this.width,0,0])
giz.addPoint (pos + [this.width,this.length,0])
giz.addPoint (pos + [0,this.length,0])
giz.addPoint pos
this.addGizmoShape giz gizmoDontHitTest cc cc
this.addGizmoMarker #bigBox pos 0 yc rd
this.addGizmoMarker #hollowBox (pos+size) 0 bc rd
if target != undefined and this.mousestate == #mouseDragging do
(
local node = refs.dependentnodes target firstonly:on
spos = mouse.pos
spos = [spos.x,spos.y,0]+[12,0,0]
case mpoint of
(
1:
(
ppos = (point3 this.xPos this.yPos 0)*node.objecttransform
pstr = "Position: [ " + (units.formatValue ppos.x) + ", " + (units.formatValue ppos.y) + ", " + (units.formatValue ppos.z) + " ] "
this.addGizmoText pstr spos f yc yc
)
2:
(
size = (point3 this.width this.length this.height)
sstr = "Size: [ " + (units.formatValue size.x) + ", " + (units.formatValue size.y) + ", " + (units.formatValue size.z) + " ] "
this.addGizmoText sstr spos f yc yc
)
)
)
)
on mouseMove m which do if target != undefined do
(
mpoint = which
mpos = m
projectedPoint = [0,0,0]
viewRay = this.getLocalViewRay mpos
local pl2 = manip.makePlaneFromNormal z_axis [0,0,0]
pl2.mostOrthogonal viewRay pl2
if (pl2.intersect viewRay &projectedPoint) do case which of
(
1:
(
target.xPos = projectedPoint.x
target.yPos = projectedPoint.y
)
2:
(
target.width = projectedPoint.x - target.xPos
target.length = projectedPoint.y - target.yPos
)
)
)
)
fn createResizeManipulator =
(
tool create
(
local pos, node
on mousePoint click do case click of
(
1:
(
pos = gridPoint
node = resize3D_Manipulator pos:pos
)
2: #stop
)
on mouseMove click do case click of
(
2:
(
node.width = gridPoint.x - pos.x
node.length = gridPoint.y - pos.y
)
)
)
startTool create
node
)
/*
-- call to start creation
createResizeManipulator()
*/
would be lovely, i canīt wait to see this in action.
tell me Paul:
what do you mean by 'graphic engine ' ? is it some kind of .NETīs property ?
could you please describe what are the basics concepts of '.NET parented to Max' ?
seeya,
nice job
Every DotNet Control lets you create a Graphics object (a GDI+ object) that then lets you draw directly into it (including lines, text, bezier splines, all kinds of filled or non-filled polygons, rectangles, pies, icons etc.) Basically you can develop your own graphics engine, for example your own node-based editor implementation :)
I am not suggesting writing Zookeeper in MAXScript, but with some effort you can do quite interesting things.
MerlinEl
11-10-2009, 06:03 PM
Hi Denis
You used two tools one internal and one external. wow!
That's the missing piece that I was looking for.
I did not know this way.
well done , thank you :thumbsup:
What Bobo said. It is fairly quick as well when just created with Max script. I have a form that fits over the viewport and is transparent. Only major speed hit unfortunately comes from the form being transparent. The drawing isn't that bad at all. It is also reliable and allows for just about anything as Bobo mentioned. Something to note as well, drawing rectangles for instance is way faster then drawing labels with the same properties. When you start to move objects around like a label it gets slow but redrawing a rectangle is much faster.
Hi Denis
You used two tools one internal and one external. wow!
That's the missing piece that I was looking for.
I did not know this way.
well done , thank you :thumbsup:
I think the second tool is there, because when creating an instance by script the internal tool clause is not executed. I was having a similar "problem".
-Johan
CGTalk Moderation
11-11-2009, 08:28 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.