AREA forums upgrade
Read more about the planned upgrade of our forums
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / SimpleObject Extending from Editable_Mesh
IMPORTANT ANNOUNCEMENT ABOUT AREA FORUMS
  RSS 2.0 ATOM  

SimpleObject Extending from Editable_Mesh
Rate this thread
 
9876
 
Permlink of this thread  
avatar
  • Total Posts: 3
  • Joined: 17 March 2008 03:25 PM

In general words, I need to create an object in 3DMax that behaves likes the editable mesh do in the way that it should be possible to select and edit faces/verties, etc. However, need that by pressing a button I could instance another mesh from the scene and edit it in this object.

Trying to accomplish that, I create a simpleObject plugin and make it extends from Editable_Mesh, then (just for testing) I assigned a box mesh to the plugin’s mesh so that the box could be edited. When this work I will make a button that could pick another object and edit it.

The problem is that after the mesh gets created and assigned, it is displayed in the viewport, but on the modify panel, it only appears the type of the object and not the expandable tree that appears with regular Editable_Mesh objects that let you select the vertices, meshes, and the other subobject components. Am I missing something?

BTW, the plugin also crash Max some times, Am I doing something wrong when assigning the mesh, is there another way of doing it?

plugin simpleObject StaticObject name:"StaticObject"     category:"Editor"  extends: Editable_mesh     classID:#(0xe855567c, 0xbcd73b8b)
(
    
local pChild
    
    on buildMesh 
do
    (
        
box createinstance box width100 height100 length100
        mesh 
box.mesh
    
)

    
tool create
    
(
        
on mousePoint click do
        (
            case 
click of
            
(
                
1: (coordsys grid (nodeTM.translation gridPoint)
                    
#stop)
            
)
        )
    )
 )


Replies: 0
avatar
  • Stokes
  • Posted: 17 March 2008 09:54 AM
  • Location: Boston Area, Massachusetts
  • Total Posts: 198
  • Joined: 22 August 2006 03:52 PM
  • Permlink of this post

A custom scripted attribute may be a better solution…



David “Stokes” Stokes
Senior Technical Artist, Blue Fang Games

Replies: 0
avatar

Thx that seems to be the right way add the extra features I need. However, now I’m facing another problem related to custom attributes.
How do I get the object itself. In the help docs it appears that the variable baseObject is the object or node being expanded.
But when try to access it, it appears as undefined.

For trying, I place code to print the name of the object and the number of faces (supposing the base object is an editable mesh) but it fails. Do you know any other way of accesing the object and node?

def attributes ExtraData attribID:#(0x1bc1d69a, 0x573aa1f0)
(
    
parameters main rollout:params
    
(
    )
    

    
rollout params "Extra Parameters"
    
(
        
button btn "Print it"

        
on btn pressed do
        (
                        -- 
just testing accesing the object and node

            
print baseobject.name
            
print baseobject.mesh.numfaces
            
print baseobject.pos.
        
)
    )
)

custAttributes.add $Mesh01 def baseObject:true


Replies: 0