On 10/09/2015 at 11:49, xxxxxxxx wrote:
Hi Guys!
My name is Ashton
Need help on this Plz
Creating a Selected Object Exporter
The problem is were i have --[Right Here]-- in the code , plz read it.
Now I try this but it paste it in active doc you are in so it is export the hole thing when i open it back up.
projUnit = c4d.UnitScaleData()
projUnit.SetUnitScale(1, c4d.DOCUMENT_UNIT_INCH)
doc[c4d.DOCUMENT_DOCUNIT] = projUnit
---------------------------------------------------------------------------------------------------------------------------
My code the problem is were i have --[Right Here]-- in the code , plz read it.
------------------------------------------------------------------------------------------------------
import c4d
from c4d import plugins
import os
from c4d import gui, bitmaps
from c4d import documents, storage
#\_\__MY Cammands\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_#
def Command (self, id, msg) :
if id == 123344:
self.SetLong(self.format_list, 123344)
#Now Export
elif id == UI_BT_Export:
c4d.CallCommand(100004820, 100004820) # Copy
c4d.CallCommand(12094, 12094) # New
----------------[ RIGHT HERE ]-------------------------------------------
[How can I change the New Document
Project Settings to meters, then paste
the model in there or Find a project with
meters and open it and paste the
model in there and I want all of this to
run in the background ] plz help!
c4d.CallCommand(100004821, 100004821) # Paste
c4d.CallCommand(60000, 5) # Export Filter for DAE 1.4 in R16 and r17
c4d.CallCommand(12664, 12664) # Close
return True
return True
#\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_#
#\_\__Cammand DATA InFo\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_#
class SelectedObjectExporter(c4d.plugins.CommandData) :
dialog = None
def Init(self, op) :
return True
def Message(self, type, data) :
return True
def Execute(self, doc) :
if self.dialog is None:
self.dialog = SelectedObjectExporterDialog()
return self.dialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, pluginid=PLUGIN_ID, defaultw=400, defaulth=200)
#\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_#
if \__name\_\_ == '\__main\_\_':
bmp = c4d.bitmaps.BaseBitmap()
dir, file = os.path.split(\__file\_\_)
fn = os.path.join(dir, "res", "Icon_3.png")
bmp.InitWith(fn)
print "Selected Object Exporter loaded."
result = plugins.RegisterCommandPlugin(PLUGIN_ID, "SelectedObjectExporter", 0, bmp, "SelectedObjectExporter", SelectedObjectExporter())