Commits

Julian Mann committed a9a88f1

added send_to_maya python command

Comments (0)

Files changed (6)

Context.sublime-menu

+[   
+    {"id": "end"},  
+    { "command": "send_to_maya", "caption": "Send Selection to Maya" }
+]
Add a comment to this file

Preferences/Miscellaneous.tmPreferences.cache

Binary file added.

Add a comment to this file

Preferences/Symbol List.tmPreferences.cache

Binary file added.

Add a comment to this file

Syntaxes/MEL.tmLanguage.cache

Binary file added.

+import sublime, sublime_plugin, socket, re
+
+
+
+
+class SendToMayaCommand(sublime_plugin.TextCommand):
+	def run(self, edit):
+		s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+		s.connect(('localhost', 2222))
+		regions = self.view.sel()  
+
+		for r in regions:
+			txt = self.view.substr(r)
+			txt = re.sub('//.*?(\r\n?|\n)|/\*.*?\*/', '', txt, re.S)
+			txt = txt.replace('\n', ' ').replace('\r',' ')
+			s.send(txt)
+
+		s.close()
+
+		# self.view.insert(edit, 0, "Hello, World!")

Binary file added.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.