looking for maxscripter to port this open source plugin

looking for maxscripter to port this open source plugin

Anonymous
Not applicable
1,531 Views
8 Replies
Message 1 of 9

looking for maxscripter to port this open source plugin

Anonymous
Not applicable

https://heimlich1024.github.io/OD_CopyPasteExternal/

Oliver Hotz has released an open source tool that lets you copy and paste geometry between different 3D applications. The current 3D applications supported are Maya, Houdini, Modo, Lightwave and Blender. UVW coordinates are supported in all these packages except for Maya at this point. Hotz is also hoping that others might contribute to this project and add compatibility with other 3D applications. Listed in his “to do” are support for 3DS Max, Cinema 4D, XSI and Sketchup, while also looking to see if it’s possible to implement in Unreal and Unity. You can download the tool from Oliver’s Github page where you can also contact him if you want to help him implement the tool in other 3D packages

0 Likes
1,532 Views
8 Replies
Replies (8)
Message 2 of 9

Swordslayer
Advisor
Advisor

I've asked this on scriptspot without receiving a reply so I'll ask again here - why use a very limited custom plaintext format instead of for example alembic (or basically any other existing file format supported across the apps)?

0 Likes
Message 3 of 9

Anonymous
Not applicable

I think your missing the point ..before this there was NOTHING...zip....ziltch...nadda

old way:
you had to go file/export...chose a format that you hoped worked in the app you want to sent it to
got tick bit and bobs to hopefully make it compatible (fbx options and obj options..)
then name it...
and save it somewhere....maybe go find a temp folder..
then you go to you other app...go file  import...then go search your hard drive...what was that folder called?
ah... found it..oh...there's a few files in there..MM....let me list if by date...
..okay
import....
...oh.... it's rotated 180 degress.......fugg...

or

copy...
other app>> paste.


please go try the plugin in modo/blender/houdini

it's REALLY easy to use...ThAt was the point - easy to use means you'll USE  it. 🙂

i'm not the programmer, but it's very simple and it works even with 100,000 polys.
as for why python not C
yes it can be compiled into C
well write it in C then...
go ahead - it's open source...make all the plugins in C..nothing to stop you!
that's what the cinema 4d guy HAS to do for his version on the plugin

btw the modo version is getting live mesh fusion copy/paste no need to manually freeze before copy paste.

"positive vibes" = getting stuff done.



0 Likes
Message 4 of 9

Swordslayer
Advisor
Advisor
I'm asking about the reason for the choice of the custom limited format instead of existing full-featured one. I've already written a few bridges, exporters, importers and file parsers which is the main reason why I'd avoid going the custom file format way. Incidentally, alembic is also the format that existing solutions like Nyx Sidekick use. Nowhere did I question python vs C, by the way.
0 Likes
Message 5 of 9

Anonymous
Not applicable

sorry yeh i can't answer that for you as i'm not the developer but a mere mortal wishing to link my modo, blender and 3dsmax together!

i have no idea why he chose to do it this way other than maybe it's easy/simple to do so it actually got done and not just mused over for months. he says a decent scripter guru should get it working in 1/2 a day in any app such as 3ds max the thing that put him off is that he's not a max user and looking at the sdk . triangles.. quads with hidden edges...said yeh..i'll leave that for a max scripter to sort out!

what do you think? maybe?

The developer is on our lightwave skype group chat works mainly with lightwave but interops with other apps all the time.

so anyway (awkward chat up line!) do you fancy porting this for max?

re the app you're talking about
http://www.ycdivfx.com/product/nyx-sidekick/

that appears only works with max and houdini, isn;t open source but a commercial thing.

this already works with
maya
houdini
modo
blender
lightwave

with these being his next goals via other people jumping aboard
3ds max
cinema 4d (being worked on)
sketchup pro
unity
unreal editor
plus any other app  which has  scripts plugins like zbrush, 3d coat...

0 Likes
Message 7 of 9

Anonymous
Not applicable

3ds max version is basically working now, although when exporting from max you have to use  edit mesh and on import into other apps it's triangulated at the moment.

so any help on expanding this so it's a edit poly on import to 3ds max and and quad mesh object  on importing into other apps would be fantastic.

od-banner.jpg

0 Likes
Message 8 of 9

Anonymous
Not applicable

re help  on the format etc

Thats available in the docs folder
on the github:

here:

https://heimlich1024.github.io/OD_CopyPasteExternal/

documentation on github
https://github.com/heimlich1024/OD_CopyPasteExternal/tree/master/docs

i
f you want to contact oliver he's available for a chat.

Message 9 of 9

Swordslayer
Advisor
Advisor

The MNMesh access in the python wrapper is quite limited, MNFace doesn't even expose its verts so I had to test one by one. This exporter snippet was tested in 2018, might need further adjusments for lower versions:

 

import MaxPlus, tempfile, os

def writeODMesh(mesh):
	file = tempfile.gettempdir() + os.sep + 'ODVertexData.txt'
	f = open(file, 'w')
	f.write('VERTICES:%d\n' % mesh.VNum())
	for i in xrange(mesh.VNum()):
		f.write('%s %s %s\n' % (mesh.P(i).X, mesh.P(i).Z, mesh.P(i).Y * -1))

	verts = range(mesh.VNum())
	f.write('POLYGONS:%d\n' % mesh.FNum())
	for i in xrange(mesh.FNum()):
		face = mesh.F(i)
		#materialID = face.material
		fpts = []
		for x in xrange(face.deg):
			vert = next(v for v in verts if face.VertIndex(v) >= 0 and not v in fpts) 
			fpts.append(vert)
		fpts = sorted(fpts, key=lambda v: face.VertIndex(v), reverse=True)
		line = ','.join(map(str, fpts))
		#currently, material name and facetype are hardcoded
		line += ';;' + 'Default' + ';;' + 'FACE' + '\n'
		f.write(line)

	f.close()
	print 'Finished Copy...'

def validateInput():
	now = MaxPlus.Core.GetCurrentTime()
	polyObjectID = MaxPlus.Class_ID(0x5D21369A, 0)

	if MaxPlus.SelectionManager.GetCount() != 1:
		return pymxs.runtime.messageBox('Exactly one object has to be selected')

	obj = MaxPlus.SelectionManager.GetNode(0).EvalWorldState(now).Getobj()

	if not (obj.CanConvertToType(polyObjectID)):
		return pymxs.runtime.messageBox('Non-mesh objects not supported')
		
	mesh = MaxPlus.PolyObject__CastFrom(obj.ConvertToType(polyObjectID, now)).GetMesh()

	if mesh.VNum() == 0:
		return pymxs.runtime.messageBox('Empty meshes not supported.')

	return mesh

def main():
	input = validateInput()
	if isinstance(input, MaxPlus.MNMesh):
		writeODMesh(input)

if __name__ == '__main__':
	main()
0 Likes