Creating a SOE Update Help PLZ
-
On 10/09/2015 at 11:49, xxxxxxxx wrote:
Hi Guys!
My name is AshtonNeed help on this Plz
Creating a Selected Object ExporterThe 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())
-
On 11/09/2015 at 01:23, xxxxxxxx wrote:
Hello Asthon,
I guess this is the same topic as in your previous thread "Creating a Selected Object Exporter Plugin for C4D"? It would be nice of you if you could tell us if the answers given there were helpful.
To define the scale settings of a document you have to setup the scale using the UnitScaleData datatype and then apply it to the document using SetDocumentData(). Something like this:
unitScale = c4d.UnitScaleData() unitScale.SetUnitScale(1.0, c4d.DOCUMENT_UNIT_M) bc = c4d.BaseContainer() bc[c4d.DOCUMENT_DOCUNIT] = unitScale doc.SetDocumentData(c4d. DOCUMENTSETTINGS_DOCUMENT, bc) c4d.EventAdd()
best wishes,
Sebastian -
On 11/09/2015 at 05:43, xxxxxxxx wrote:
thanks bro i will try this and let you know if it work and sorry again
-
On 15/09/2015 at 05:46, xxxxxxxx wrote:
unitScale = c4d.UnitScaleData() unitScale.SetUnitScale(1.0, c4d.DOCUMENT_UNIT_M) bc = c4d.BaseContainer() bc[c4d.DOCUMENT_DOCUNIT] = unitScale doc.SetDocumentData(c4d. DOCUMENTSETTINGS_DOCUMENT, bc) c4d.EventAdd() Thanks S_Bach !`View Drop Down`[URL-REMOVED]
Thats works if u have it in a py script file and when u call out to it with a ID c4d give you, but when u use it by putting it in the code like this below, it dont work
def DAE_1_4_Format(self) :
c4d.CallCommand(100004820, 100004820) # Copy
c4d.CallCommand(12094, 12094) # New
c4d.CallCommand(600000032, 600000032) # PS_M_id <--i calling a py file from the script that works but if some use they might have this ID use already , so i would like to know what else i can try.
c4d.CallCommand(100004821, 100004821) # Paste
c4d.CallCommand(60000, 5) # Export Filter for DAE 1.4 in R16 and r17
c4d.CallCommand(12664, 12664) # Closeor how to call the script py file from my plugin folder to execute it
and instead c4d.CallCommand(12664, 12664), how can i close it with out ask me save doc or no, i just want to close by it self and i try killdocument but notting happens ,
hope yall can hep and this a video on how it looking so far :
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.