Home Technical Talk

m2u - development and feedback

Hi there, this is the first beta-release, so there may still be a lot of bugs, limitations and only a basic amount of features ;)
But since it allows you to place at least existing objects with the tools of maya, it may be useful to some of you, so we release a first version.

I created this thread so we have a clean spot where to get feedback and discuss features. Feel free to comment.

download v0.1 here

How to install:
extract the content of the zip file as a folder named "m2u" to some place where your maya python script paths point to. Then you can invoke the script by calling
import m2u
from m2u import init_maya
(this may change in future updates)

if you don't know what this tool is about, take a look at our short videos presenting the current features:
[vv]75810969[/vv]
[vv]76288247[/vv]


Please Note:
- The current version is limited to a Maya-implementation. The 3dsMax implementation is currently on hold, development will resume in a few weeks.
- IMPORTANT: the current version only works wit Z-up space in Maya! (you can set maya to z-up in the preferences)
- Feel free to browse through the code but keep in mind that it is very untidy, we had no time to clean up yet.


Limitations, Problems, Bugs:

- the camera in UDK may not reflect over-head rotations correctly
This is because UDK has maximum values for camera rotations in certain directions, this may be fixable but is low priority.

- multiple UDKs running at once
currently the first instance that is found is taken (most likely the first one started). We may provide some means of providing a list the user can select from in the future, but it is low priority.

- selection in UDK is lost after transforming objects
this is happening because every object is pasted individually, only the last pasted object will be selected in UEd. A re-selection is possible but is not very important, we think, so it's a low priority. (yes, pasting all transformed objects at once is possible too and is a future development target)

- No Location Attribute Found error appears
if you get this error message, you are trying to transform an object that resides in the absolute center of the world in UDK. In that case, there is not Location statement in the ascii-representation. Our script currently uses this as the anchor for replacing the transform information. This is fixable but requires some string-decomposition code work...

- Objects are not transformed in UDK
This still happens sometimes and keeps at specific objects. Sometime it helps to transform another object and then try again, sometimes it doesn't. This problem appears very unregularly and we didn't nail down the reason yet.

- When transforming objects with shift+mmb in maya, the update will be issued when the shift key is released
This is to prevent UDK from calling the Save To Clip Pad modal dialog which will thread-lock both applications. It may still happen if you tap shift again while the commands are being sent to udk. Please read the Technical Description section in the second post for more information.

Replies

  • alfalfasprossen
    * Technical Description:
    This will describe how the tool works on the technical side and why some problems arise. You don't need to read this to work with the tool, but if you want to help bugfixing, maybe some information herein is important.

    ** How we communicate
    Communication between The Program and UDK works generally by using Windows functions to send commands to the Windows GUI. The most important here is SendMessage which will send a command to a window and return when the command has been processed. There is the alternative PostMessage which will return immeditely. We are forced to use the second one whenever the target goes into a state from which it won't return without further processing from our side. The typical would be a modal dialog which yields SendMessage from returning but won't close by itself of course.

    Sending messages means everything from setting the text in a control to pushing a button or activating a menu entry. Our main target for most commands is the command line from UDK (the text field in the lower left corner). There are only a few editor commands available (they are listed on UDN) and their purpose is not to remote control the Editor but to debug levels and such.

    The magic behind being able to move objects in UDK is to tell the Editor to select specific objects (referenced by their unique name) and copy the selection to the clipboard. Then we take the text from the clipboard (unreal text is plainly readable) and modify the transformation values. We push the modified text back to the clipboard and tell the Editor to paste that.

    This whole process is by no means thread-safe, and whenever another application is interfering (by accessing the clipboard exactly between our copy and paste operations, or directing focus away from a window we were required to set focus to), the result is undefined.

    ** Why popup dialogs freeze both applications
    This is because the Threads are attached and while the one is issuing a modal dialog, the other is still waiting for the function to return. An unexpected popup window which is not handled by the script will thus freeze the UI.
    You will have to kill one of the two programs using the task-manager (kill process).

    ** Save To Clip Pad dialog from UDK
    This dialog appens when holding the shift-key while issuing Cut, Copy or Paste commands, since shift-copy calls this clip pad functionality from UDK. I never before knew that even existed ;)
    I tried everything to fix this, namely
    - SendMessage with WM_KEYUP for the shift key before sending the command
    - SendInput for the whole command, but this requires UDK to be focused, which requires time and interferes with the users workflow
    - keyb_event which is similar to SendInput
    - SetKeyboardState
    I tried all options windows probvides to simulate another key-state, but none worked like desired. UDK will get the actual state of the shift key on the hardware keyboard from windows (using GetAsyncKeyState) which will circumvent all the virtual hacks you can get. Telling the user to let go off the shift key is only option that was left for us to prevent thread-lock, but it is by no means a safe option.
  • DougClayton4231
    Offline / Send Message
    DougClayton4231 polycounter lvl 3
    Looks pretty cool, I'm gonna keep my eye on this :P
  • Hellfire
    Offline / Send Message
    Hellfire polycounter lvl 14
    This is amazing! I can't wait for 3ds max script! :)
  • [Deleted User]
    Looks great - do UV map changes go through?
  • alfalfasprossen
    thanks for the comments ;)
    Yuze wrote: »
    Looks great - do UV map changes go through?
    No. Currently there is only this kind of "fast-fetch-mode" where objects have to exist in both applications or you can get them exported from UDK. Getting "new" objects back into UDK would be a much more complicated task. We have plans for that, but we don't know if it will be possible to automate it completely. We will go into detail more when we have more of the basic features running (upcoming next will be duplicating, deleting, hiding/unhiding and probably renaming of objects)
  • Lucas Annunziata
    Offline / Send Message
    Lucas Annunziata polycounter lvl 13
    Any more progress on this? It seems like an amazing tool. Possibly with UE4 integration?
  • alfalfasprossen
    Sorry for not posting for so long, but development on the UDK version was very slow, my friend got a new job and had no time to work on the max-implementation anymore and I was annoyed by all the problems that came with not being able to tell UDK exactly what to do.

    Anyway, UDK is dead, long live UE4.
    [vv]101552170[/vv]

    This time working with a c++ written plugin on the UE4 side, sending commands via a TCP port. It is much more pleasant to work with than the Windows-UI approach we had to use for UDK.
Sign In or Register to comment.